1
+ #include " helper.h"
1
2
#include < library/cpp/testing/unittest/registar.h>
2
- #include " column_engine_logs.h"
3
- #include " predicate/predicate.h"
4
- #include " changes/cleanup.h"
3
+ #include < ydb/core/tx/columnshard/engines/ column_engine_logs.h>
4
+ #include < ydb/core/tx/columnshard/engines/ predicate/predicate.h>
5
+ #include < ydb/core/tx/columnshard/engines/ changes/cleanup.h>
5
6
6
7
#include < ydb/core/tx/columnshard/columnshard_ut_common.h>
7
8
#include < ydb/core/tx/columnshard/engines/changes/compaction.h>
8
9
#include < ydb/core/tx/columnshard/blobs_action/bs/storage.h>
9
10
#include < ydb/core/tx/columnshard/hooks/testing/controller.h>
11
+ #include < ydb/core/tx/columnshard/data_sharing/manager/shared_blobs.h>
10
12
11
13
12
14
namespace NKikimr {
@@ -16,6 +18,7 @@ namespace NTypeIds = NScheme::NTypeIds;
16
18
using TTypeId = NScheme::TTypeId;
17
19
using TTypeInfo = NScheme::TTypeInfo;
18
20
using TDefaultTestsController = NKikimr::NYDBTest::NColumnShard::TController;
21
+ using namespace NKikimr ::NOlap::NEngines::NTest;
19
22
20
23
namespace {
21
24
@@ -375,13 +378,23 @@ class TTestStoragesManager: public NOlap::IStoragesManager {
375
378
private:
376
379
using TBase = NOlap::IStoragesManager;
377
380
TIntrusivePtr<TTabletStorageInfo> TabletInfo = new TTabletStorageInfo();
381
+ std::shared_ptr<NOlap::NDataSharing::TSharedBlobsManager> SharedBlobsManager = std::make_shared<NOlap::NDataSharing::TSharedBlobsManager>();
378
382
protected:
383
+ virtual bool DoLoadIdempotency (NTable::TDatabase& /* database*/ ) override {
384
+ return true ;
385
+ }
386
+
379
387
virtual std::shared_ptr<NOlap::IBlobsStorageOperator> DoBuildOperator (const TString& storageId) override {
380
388
if (storageId == TBase::DefaultStorageId) {
381
- return std::make_shared<NOlap::NBlobOperations::NBlobStorage::TOperator>(storageId, NActors::TActorId (), TabletInfo, 1 );
389
+ return std::make_shared<NOlap::NBlobOperations::NBlobStorage::TOperator>(storageId, NActors::TActorId (), TabletInfo,
390
+ 1 , SharedBlobsManager->GetStorageManagerGuarantee (TBase::DefaultStorageId));
382
391
} else
383
392
return nullptr ;
384
393
}
394
+ public:
395
+ virtual const std::shared_ptr<NDataSharing::TSharedBlobsManager>& GetSharedBlobsManager () const override {
396
+ return SharedBlobsManager;
397
+ }
385
398
};
386
399
387
400
std::shared_ptr<NKikimr::NOlap::IStoragesManager> CommonStoragesManager = std::make_shared<TTestStoragesManager>();
@@ -411,8 +424,8 @@ Y_UNIT_TEST_SUITE(TColumnEngineTestLogs) {
411
424
engine.Load (db);
412
425
413
426
std::vector<TInsertedData> dataToIndex = {
414
- TInsertedData (2 , paths[0 ], " " , blobRanges[0 ].BlobId , {} , 0 , {}),
415
- TInsertedData (1 , paths[0 ], " " , blobRanges[1 ].BlobId , {} , 0 , {})
427
+ TInsertedData (2 , paths[0 ], " " , blobRanges[0 ].BlobId , TLocalHelper::GetMetaProto () , 0 , {}),
428
+ TInsertedData (1 , paths[0 ], " " , blobRanges[1 ].BlobId , TLocalHelper::GetMetaProto () , 0 , {})
416
429
};
417
430
418
431
// write
@@ -507,7 +520,7 @@ Y_UNIT_TEST_SUITE(TColumnEngineTestLogs) {
507
520
// PlanStep, TxId, PathId, DedupId, BlobId, Data, [Metadata]
508
521
std::vector<TInsertedData> dataToIndex;
509
522
dataToIndex.push_back (
510
- TInsertedData (txId, pathId, " " , blobRange.BlobId , {} , 0 , {}));
523
+ TInsertedData (txId, pathId, " " , blobRange.BlobId , TLocalHelper::GetMetaProto () , 0 , {}));
511
524
512
525
bool ok = Insert (engine, db, TSnapshot (planStep, txId), std::move (dataToIndex), blobs, step);
513
526
UNIT_ASSERT (ok);
@@ -605,7 +618,7 @@ Y_UNIT_TEST_SUITE(TColumnEngineTestLogs) {
605
618
// PlanStep, TxId, PathId, DedupId, BlobId, Data, [Metadata]
606
619
std::vector<TInsertedData> dataToIndex;
607
620
dataToIndex.push_back (
608
- TInsertedData (txId, pathId, " " , blobRange.BlobId , {} , 0 , {}));
621
+ TInsertedData (txId, pathId, " " , blobRange.BlobId , TLocalHelper::GetMetaProto () , 0 , {}));
609
622
610
623
bool ok = Insert (engine, db, TSnapshot (planStep, txId), std::move (dataToIndex), blobs, step);
611
624
for (auto && i : blobs) {
@@ -639,7 +652,7 @@ Y_UNIT_TEST_SUITE(TColumnEngineTestLogs) {
639
652
// PlanStep, TxId, PathId, DedupId, BlobId, Data, [Metadata]
640
653
std::vector<TInsertedData> dataToIndex;
641
654
dataToIndex.push_back (
642
- TInsertedData (txId, pathId, " " , blobRange.BlobId , {} , 0 , {}));
655
+ TInsertedData (txId, pathId, " " , blobRange.BlobId , TLocalHelper::GetMetaProto () , 0 , {}));
643
656
644
657
bool ok = Insert (engine, db, TSnapshot (planStep, txId), std::move (dataToIndex), blobs, step);
645
658
UNIT_ASSERT (ok);
@@ -680,7 +693,7 @@ Y_UNIT_TEST_SUITE(TColumnEngineTestLogs) {
680
693
// PlanStep, TxId, PathId, DedupId, BlobId, Data, [Metadata]
681
694
std::vector<TInsertedData> dataToIndex;
682
695
dataToIndex.push_back (
683
- TInsertedData (txId, pathId, " " , blobRange.BlobId , {} , 0 , {}));
696
+ TInsertedData (txId, pathId, " " , blobRange.BlobId , TLocalHelper::GetMetaProto () , 0 , {}));
684
697
685
698
bool ok = Insert (engine, db, TSnapshot (planStep, txId), std::move (dataToIndex), blobs, step);
686
699
UNIT_ASSERT (ok);
0 commit comments