aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrobot-piglet <robot-piglet@yandex-team.com>2024-10-01 14:31:52 +0300
committerrobot-piglet <robot-piglet@yandex-team.com>2024-10-01 14:41:26 +0300
commite2a808cdb1ed0d2c1c217498c5940e95be78b2a5 (patch)
tree35baea90e151fc303b1e5cc965b7396e86441762
parentbe8997d228bcaa662147146a9c7ecfd613dba718 (diff)
downloadydb-e2a808cdb1ed0d2c1c217498c5940e95be78b2a5.tar.gz
Intermediate changes
commit_hash:3cad2908c5fe0e3a7e703d15709be0f9970019db
-rw-r--r--yt/yt/client/unittests/mock/table_reader.cpp6
-rw-r--r--yt/yt/client/unittests/mock/table_reader.h6
-rw-r--r--yt/yt/client/unittests/mock/timestamp_provider.h23
3 files changed, 29 insertions, 6 deletions
diff --git a/yt/yt/client/unittests/mock/table_reader.cpp b/yt/yt/client/unittests/mock/table_reader.cpp
index 364381127c..ef3c44d0bd 100644
--- a/yt/yt/client/unittests/mock/table_reader.cpp
+++ b/yt/yt/client/unittests/mock/table_reader.cpp
@@ -7,10 +7,10 @@ namespace NYT::NApi {
////////////////////////////////////////////////////////////////////////////////
-TMockTableReader::TMockTableReader(const NTableClient::TTableSchemaPtr& schema)
- : Schema_(schema)
+TMockTableReader::TMockTableReader(NTableClient::TTableSchemaPtr schema)
+ : Schema_(std::move(schema))
, NameTable_(NTableClient::TNameTable::FromSchema(*Schema_))
-{}
+{ }
const NTableClient::TNameTablePtr& TMockTableReader::GetNameTable() const
{
diff --git a/yt/yt/client/unittests/mock/table_reader.h b/yt/yt/client/unittests/mock/table_reader.h
index 36ddda47ab..be901f4881 100644
--- a/yt/yt/client/unittests/mock/table_reader.h
+++ b/yt/yt/client/unittests/mock/table_reader.h
@@ -12,7 +12,7 @@ class TMockTableReader
: public ITableReader
{
public:
- TMockTableReader(const NTableClient::TTableSchemaPtr& schema);
+ explicit TMockTableReader(NTableClient::TTableSchemaPtr schema);
MOCK_METHOD(i64, GetStartRowIndex, (), (const, override));
@@ -31,8 +31,8 @@ public:
const NTableClient::TTableSchemaPtr& GetTableSchema() const override;
private:
- NTableClient::TTableSchemaPtr Schema_;
- NTableClient::TNameTablePtr NameTable_;
+ const NTableClient::TTableSchemaPtr Schema_;
+ const NTableClient::TNameTablePtr NameTable_;
};
DEFINE_REFCOUNTED_TYPE(TMockTableReader);
diff --git a/yt/yt/client/unittests/mock/timestamp_provider.h b/yt/yt/client/unittests/mock/timestamp_provider.h
new file mode 100644
index 0000000000..2a5f861a53
--- /dev/null
+++ b/yt/yt/client/unittests/mock/timestamp_provider.h
@@ -0,0 +1,23 @@
+#pragma once
+
+#include <yt/yt/client/transaction_client/timestamp_provider.h>
+
+namespace NYT::NTransactionClient {
+
+////////////////////////////////////////////////////////////////////////////////
+
+DECLARE_REFCOUNTED_CLASS(TMockTimestampProvider);
+
+class TMockTimestampProvider
+ : public ITimestampProvider
+{
+public:
+ MOCK_METHOD(TFuture<TTimestamp>, GenerateTimestamps, (int, NObjectClient::TCellTag), (override));
+ MOCK_METHOD(TTimestamp, GetLatestTimestamp, (NObjectClient::TCellTag), (override));
+};
+
+DEFINE_REFCOUNTED_TYPE(TMockTimestampProvider)
+
+////////////////////////////////////////////////////////////////////////////////
+
+} // namespace NYT::NTransactionClient