diff options
author | ivanmorozov <ivanmorozov@yandex-team.com> | 2023-10-23 09:26:11 +0300 |
---|---|---|
committer | ivanmorozov <ivanmorozov@yandex-team.com> | 2023-10-23 09:44:34 +0300 |
commit | 2bd12ab281298972a786567e5d364cc2786f71bd (patch) | |
tree | cefcc04aa505a32defc31cbda0a71f6de895f027 | |
parent | 25c7627c0f7844ae3aa28472051ff06fa64c7dac (diff) | |
download | ydb-2bd12ab281298972a786567e5d364cc2786f71bd.tar.gz |
KIKIMR-19213: rename granuleId -> pathId (granuleId is deprecated)
19 files changed, 36 insertions, 69 deletions
diff --git a/ydb/core/tx/columnshard/engines/changes/abstract/compaction_info.h b/ydb/core/tx/columnshard/engines/changes/abstract/compaction_info.h index 0545555ab9..40686472f5 100644 --- a/ydb/core/tx/columnshard/engines/changes/abstract/compaction_info.h +++ b/ydb/core/tx/columnshard/engines/changes/abstract/compaction_info.h @@ -28,29 +28,4 @@ public: } }; -struct TCompactionInfo { -private: - std::shared_ptr<TGranuleMeta> GranuleMeta; -public: - TCompactionInfo(std::shared_ptr<TGranuleMeta> granule) - : GranuleMeta(granule) - { - Y_ABORT_UNLESS(granule); - } - - std::shared_ptr<TGranuleMeta> GetGranule() const { - return GranuleMeta; - } - -}; - -struct TCompactionSrcGranule { - TMark Mark; - - TCompactionSrcGranule(const TMark& mark) - : Mark(mark) - { - } -}; - } diff --git a/ydb/core/tx/columnshard/engines/changes/compaction.cpp b/ydb/core/tx/columnshard/engines/changes/compaction.cpp index 7bb3700593..bb1f3fadc3 100644 --- a/ydb/core/tx/columnshard/engines/changes/compaction.cpp +++ b/ydb/core/tx/columnshard/engines/changes/compaction.cpp @@ -8,7 +8,7 @@ namespace NKikimr::NOlap { void TCompactColumnEngineChanges::DoDebugString(TStringOutput& out) const { TBase::DoDebugString(out); - out << "original_granule=" << GranuleMeta->GetGranuleId() << ";"; + out << "original_granule=" << GranuleMeta->GetPathId() << ";"; if (ui32 switched = SwitchedPortions.size()) { out << "switch " << switched << " portions:("; for (auto& portionInfo : SwitchedPortions) { @@ -87,7 +87,7 @@ TCompactColumnEngineChanges::TCompactColumnEngineChanges(const TCompactionLimits Y_ABORT_UNLESS(!portionInfo->HasRemoveSnapshot()); SwitchedPortions.emplace_back(*portionInfo); AFL_VERIFY(PortionsToRemove.emplace(portionInfo->GetAddress(), *portionInfo).second); - Y_ABORT_UNLESS(portionInfo->GetGranule() == GranuleMeta->GetGranuleId()); + Y_ABORT_UNLESS(portionInfo->GetPathId() == GranuleMeta->GetPathId()); } Y_ABORT_UNLESS(SwitchedPortions.size()); } diff --git a/ydb/core/tx/columnshard/engines/changes/general_compaction.cpp b/ydb/core/tx/columnshard/engines/changes/general_compaction.cpp index 46363b0892..9790dfba78 100644 --- a/ydb/core/tx/columnshard/engines/changes/general_compaction.cpp +++ b/ydb/core/tx/columnshard/engines/changes/general_compaction.cpp @@ -182,7 +182,7 @@ TConclusionStatus TGeneralCompactColumnEngineChanges::DoConstructBlobs(TConstruc TGeneralSerializedSlice slice(std::move(i)); auto b = batchResult->Slice(recordIdx, slice.GetRecordsCount()); std::vector<std::vector<IPortionColumnChunk::TPtr>> chunksByBlobs = slice.GroupChunksByBlobs(); - AppendedPortions.emplace_back(TPortionInfoWithBlobs::BuildByBlobs(chunksByBlobs, nullptr, GranuleMeta->GetGranuleId(), *maxSnapshot, SaverContext.GetStorageOperator())); + AppendedPortions.emplace_back(TPortionInfoWithBlobs::BuildByBlobs(chunksByBlobs, nullptr, GranuleMeta->GetPathId(), *maxSnapshot, SaverContext.GetStorageOperator())); NArrow::TFirstLastSpecialKeys primaryKeys(slice.GetFirstLastPKBatch(resultSchema->GetIndexInfo().GetReplaceKey())); NArrow::TMinMaxSpecialKeys snapshotKeys(b, TIndexInfo::ArrowSchemaSnapshot()); AppendedPortions.back().GetPortionInfo().AddMetadata(*resultSchema, primaryKeys, snapshotKeys, SaverContext.GetTierName()); diff --git a/ydb/core/tx/columnshard/engines/column_engine_logs.cpp b/ydb/core/tx/columnshard/engines/column_engine_logs.cpp index ccfe9715e5..02323ba18d 100644 --- a/ydb/core/tx/columnshard/engines/column_engine_logs.cpp +++ b/ydb/core/tx/columnshard/engines/column_engine_logs.cpp @@ -49,7 +49,7 @@ void TColumnEngineForLogs::UpdatePortionStats(const TPortionInfo& portionInfo, E const TPortionInfo* exPortionInfo) { UpdatePortionStats(Counters, portionInfo, updateType, exPortionInfo); - const ui64 pathId = portionInfo.GetGranule(); + const ui64 pathId = portionInfo.GetPathId(); Y_ABORT_UNLESS(pathId); if (!PathStats.contains(pathId)) { auto& stats = PathStats[pathId]; diff --git a/ydb/core/tx/columnshard/engines/column_engine_logs.h b/ydb/core/tx/columnshard/engines/column_engine_logs.h index fff06d8a05..bfda26fae3 100644 --- a/ydb/core/tx/columnshard/engines/column_engine_logs.h +++ b/ydb/core/tx/columnshard/engines/column_engine_logs.h @@ -186,9 +186,9 @@ public: return !!GetGranuleOptional(pathId); } - const TGranuleMeta& GetGranuleVerified(const ui64 granuleId) const { - auto it = Tables.find(granuleId); - AFL_VERIFY(it != Tables.end())("granule_id", granuleId)("count", Tables.size()); + const TGranuleMeta& GetGranuleVerified(const ui64 pathId) const { + auto it = Tables.find(pathId); + AFL_VERIFY(it != Tables.end())("path_id", pathId)("count", Tables.size()); return *it->second; } diff --git a/ydb/core/tx/columnshard/engines/portions/meta.cpp b/ydb/core/tx/columnshard/engines/portions/meta.cpp index 3dac564fab..4c7576ab61 100644 --- a/ydb/core/tx/columnshard/engines/portions/meta.cpp +++ b/ydb/core/tx/columnshard/engines/portions/meta.cpp @@ -114,7 +114,7 @@ TString TPortionMeta::DebugString() const { } TString TPortionAddress::DebugString() const { - return TStringBuilder() << "(granule_id=" << GranuleId << ";portion_id=" << PortionId << ")"; + return TStringBuilder() << "(path_id=" << PathId << ";portion_id=" << PortionId << ")"; } } diff --git a/ydb/core/tx/columnshard/engines/portions/meta.h b/ydb/core/tx/columnshard/engines/portions/meta.h index 6207944db8..1fdde5874a 100644 --- a/ydb/core/tx/columnshard/engines/portions/meta.h +++ b/ydb/core/tx/columnshard/engines/portions/meta.h @@ -46,11 +46,11 @@ public: class TPortionAddress { private: - YDB_READONLY(ui64, GranuleId, 0); + YDB_READONLY(ui64, PathId, 0); YDB_READONLY(ui64, PortionId, 0); public: - TPortionAddress(const ui64 granuleId, const ui64 portionId) - : GranuleId(granuleId) + TPortionAddress(const ui64 pathId, const ui64 portionId) + : PathId(pathId) , PortionId(portionId) { @@ -59,11 +59,11 @@ public: TString DebugString() const; bool operator<(const TPortionAddress& item) const { - return std::tie(GranuleId, PortionId) < std::tie(item.GranuleId, item.PortionId); + return std::tie(PathId, PortionId) < std::tie(item.PathId, item.PortionId); } bool operator==(const TPortionAddress& item) const { - return std::tie(GranuleId, PortionId) == std::tie(item.GranuleId, item.PortionId); + return std::tie(PathId, PortionId) == std::tie(item.PathId, item.PortionId); } }; @@ -72,7 +72,7 @@ public: template<> struct THash<NKikimr::NOlap::TPortionAddress> { inline ui64 operator()(const NKikimr::NOlap::TPortionAddress& x) const noexcept { - return CombineHashes(x.GetPortionId(), x.GetGranuleId()); + return CombineHashes(x.GetPortionId(), x.GetPathId()); } }; diff --git a/ydb/core/tx/columnshard/engines/portions/portion_info.h b/ydb/core/tx/columnshard/engines/portions/portion_info.h index b407c9b718..2ccb150da4 100644 --- a/ydb/core/tx/columnshard/engines/portions/portion_info.h +++ b/ydb/core/tx/columnshard/engines/portions/portion_info.h @@ -179,10 +179,6 @@ public: return Portion; } - ui64 GetGranule() const { - return PathId; - } - TPortionAddress GetAddress() const { return TPortionAddress(PathId, Portion); } diff --git a/ydb/core/tx/columnshard/engines/storage/granule.cpp b/ydb/core/tx/columnshard/engines/storage/granule.cpp index 12dbd0a991..2126a0042f 100644 --- a/ydb/core/tx/columnshard/engines/storage/granule.cpp +++ b/ydb/core/tx/columnshard/engines/storage/granule.cpp @@ -19,7 +19,7 @@ ui64 TGranuleMeta::Size() const { void TGranuleMeta::UpsertPortion(const TPortionInfo& info) { AFL_TRACE(NKikimrServices::TX_COLUMNSHARD)("event", "upsert_portion")("portion", info.DebugString())("path_id", GetPathId()); auto it = Portions.find(info.GetPortion()); - AFL_VERIFY(info.GetGranule() == GetPathId())("event", "incompatible_granule")("portion", info.DebugString())("path_id", GetPathId()); + AFL_VERIFY(info.GetPathId() == GetPathId())("event", "incompatible_granule")("portion", info.DebugString())("path_id", GetPathId()); AFL_VERIFY(info.Valid())("event", "invalid_portion")("portion", info.DebugString()); AFL_VERIFY(info.ValidSnapshotInfo())("event", "incorrect_portion_snapshots")("portion", info.DebugString()); diff --git a/ydb/core/tx/columnshard/engines/storage/granule.h b/ydb/core/tx/columnshard/engines/storage/granule.h index d7ec376cc9..3d17a0a6dd 100644 --- a/ydb/core/tx/columnshard/engines/storage/granule.h +++ b/ydb/core/tx/columnshard/engines/storage/granule.h @@ -268,10 +268,6 @@ public: return PathId; } - ui64 GetGranuleId() const { - return PathId; - } - const TPortionInfo& GetPortionVerified(const ui64 portion) const { auto it = Portions.find(portion); AFL_VERIFY(it != Portions.end())("portion_id", portion)("count", Portions.size()); diff --git a/ydb/core/tx/columnshard/engines/storage/optimizer/abstract/optimizer.cpp b/ydb/core/tx/columnshard/engines/storage/optimizer/abstract/optimizer.cpp index d3e82f8b21..4c6265d148 100644 --- a/ydb/core/tx/columnshard/engines/storage/optimizer/abstract/optimizer.cpp +++ b/ydb/core/tx/columnshard/engines/storage/optimizer/abstract/optimizer.cpp @@ -4,7 +4,7 @@ namespace NKikimr::NOlap::NStorageOptimizer { std::shared_ptr<TColumnEngineChanges> IOptimizerPlanner::GetOptimizationTask(const TCompactionLimits& limits, std::shared_ptr<TGranuleMeta> granule, const THashSet<TPortionAddress>& busyPortions) const { - NActors::TLogContextGuard g(NActors::TLogContextBuilder::Build(NKikimrServices::TX_COLUMNSHARD)("granule_id", GranuleId)); + NActors::TLogContextGuard g(NActors::TLogContextBuilder::Build(NKikimrServices::TX_COLUMNSHARD)("path_id", PathId)); auto result = DoGetOptimizationTask(limits, granule, busyPortions); if (!!result) { auto portions = result->GetTouchedPortions(); diff --git a/ydb/core/tx/columnshard/engines/storage/optimizer/abstract/optimizer.h b/ydb/core/tx/columnshard/engines/storage/optimizer/abstract/optimizer.h index db486568fc..db9926f451 100644 --- a/ydb/core/tx/columnshard/engines/storage/optimizer/abstract/optimizer.h +++ b/ydb/core/tx/columnshard/engines/storage/optimizer/abstract/optimizer.h @@ -50,7 +50,7 @@ public: class IOptimizerPlanner { private: - const ui64 GranuleId; + const ui64 PathId; YDB_READONLY(TInstant, ActualizationInstant, TInstant::Zero()); protected: virtual void DoModifyPortions(const std::vector<std::shared_ptr<TPortionInfo>>& add, const std::vector<std::shared_ptr<TPortionInfo>>& remove) = 0; @@ -66,8 +66,8 @@ protected: public: using TFactory = NObjectFactory::TObjectFactory<IOptimizerPlanner, TString>; - IOptimizerPlanner(const ui64 granuleId) - : GranuleId(granuleId) + IOptimizerPlanner(const ui64 pathId) + : PathId(pathId) { } @@ -113,7 +113,7 @@ public: } void ModifyPortions(const std::vector<std::shared_ptr<TPortionInfo>>& add, const std::vector<std::shared_ptr<TPortionInfo>>& remove) { - NActors::TLogContextGuard g(NActors::TLogContextBuilder::Build(NKikimrServices::TX_COLUMNSHARD)("granule_id", GranuleId)); + NActors::TLogContextGuard g(NActors::TLogContextBuilder::Build(NKikimrServices::TX_COLUMNSHARD)("path_id", PathId)); DoModifyPortions(add, remove); } diff --git a/ydb/core/tx/columnshard/engines/storage/optimizer/intervals/optimizer.cpp b/ydb/core/tx/columnshard/engines/storage/optimizer/intervals/optimizer.cpp index dbb319e66e..acab75cd86 100644 --- a/ydb/core/tx/columnshard/engines/storage/optimizer/intervals/optimizer.cpp +++ b/ydb/core/tx/columnshard/engines/storage/optimizer/intervals/optimizer.cpp @@ -170,8 +170,8 @@ void TIntervalsOptimizerPlanner::AddRanged(const TBorderPositions& data) { } } -TIntervalsOptimizerPlanner::TIntervalsOptimizerPlanner(const ui64 granuleId, const std::shared_ptr<IStoragesManager>& storagesManager) - : TBase(granuleId) +TIntervalsOptimizerPlanner::TIntervalsOptimizerPlanner(const ui64 pathId, const std::shared_ptr<IStoragesManager>& storagesManager) + : TBase(pathId) , StoragesManager(storagesManager) , Counters(std::make_shared<TCounters>()) , SizeProblemBlobs(Counters, storagesManager) diff --git a/ydb/core/tx/columnshard/engines/storage/optimizer/intervals/optimizer.h b/ydb/core/tx/columnshard/engines/storage/optimizer/intervals/optimizer.h index 0c6a65680a..5d7d0cd1ef 100644 --- a/ydb/core/tx/columnshard/engines/storage/optimizer/intervals/optimizer.h +++ b/ydb/core/tx/columnshard/engines/storage/optimizer/intervals/optimizer.h @@ -250,7 +250,7 @@ protected: virtual TString DoDebugString() const override; public: - TIntervalsOptimizerPlanner(const ui64 granuleId, const std::shared_ptr<IStoragesManager>& storagesManager); + TIntervalsOptimizerPlanner(const ui64 pathId, const std::shared_ptr<IStoragesManager>& storagesManager); }; } // namespace NKikimr::NOlap diff --git a/ydb/core/tx/columnshard/engines/storage/optimizer/lbuckets/optimizer.h b/ydb/core/tx/columnshard/engines/storage/optimizer/lbuckets/optimizer.h index 19f763158d..57d7df3dae 100644 --- a/ydb/core/tx/columnshard/engines/storage/optimizer/lbuckets/optimizer.h +++ b/ydb/core/tx/columnshard/engines/storage/optimizer/lbuckets/optimizer.h @@ -1024,8 +1024,8 @@ public: return Buckets.GetBucketPositions(); } - TOptimizerPlanner(const ui64 granuleId, const std::shared_ptr<IStoragesManager>& storagesManager, const std::shared_ptr<arrow::Schema>& primaryKeysSchema) - : TBase(granuleId) + TOptimizerPlanner(const ui64 pathId, const std::shared_ptr<IStoragesManager>& storagesManager, const std::shared_ptr<arrow::Schema>& primaryKeysSchema) + : TBase(pathId) , Counters(std::make_shared<TCounters>()) , Buckets(primaryKeysSchema, storagesManager, Counters) , StoragesManager(storagesManager) diff --git a/ydb/core/tx/columnshard/engines/storage/optimizer/levels/optimizer.h b/ydb/core/tx/columnshard/engines/storage/optimizer/levels/optimizer.h index e0f1458842..46a9988a13 100644 --- a/ydb/core/tx/columnshard/engines/storage/optimizer/levels/optimizer.h +++ b/ydb/core/tx/columnshard/engines/storage/optimizer/levels/optimizer.h @@ -509,8 +509,8 @@ protected: } public: - TLevelsOptimizerPlanner(const ui64 granuleId, const std::shared_ptr<IStoragesManager>& storagesManager, const std::shared_ptr<arrow::Schema>& primaryKeysSchema) - : TBase(granuleId) + TLevelsOptimizerPlanner(const ui64 pathId, const std::shared_ptr<IStoragesManager>& storagesManager, const std::shared_ptr<arrow::Schema>& primaryKeysSchema) + : TBase(pathId) , StoragesManager(storagesManager) , Counters(std::make_shared<TCounters>()) { diff --git a/ydb/core/tx/columnshard/engines/storage/storage.cpp b/ydb/core/tx/columnshard/engines/storage/storage.cpp index 02ce7fd8e1..7e6f7e81b5 100644 --- a/ydb/core/tx/columnshard/engines/storage/storage.cpp +++ b/ydb/core/tx/columnshard/engines/storage/storage.cpp @@ -4,7 +4,7 @@ namespace NKikimr::NOlap { void TGranulesStorage::UpdateGranuleInfo(const TGranuleMeta& granule) { if (PackModificationFlag) { - PackModifiedGranules[granule.GetGranuleId()] = &granule; + PackModifiedGranules[granule.GetPathId()] = &granule; return; } } diff --git a/ydb/core/tx/columnshard/engines/ut_logs_engine.cpp b/ydb/core/tx/columnshard/engines/ut_logs_engine.cpp index 2f97cca3ce..96e0e92513 100644 --- a/ydb/core/tx/columnshard/engines/ut_logs_engine.cpp +++ b/ydb/core/tx/columnshard/engines/ut_logs_engine.cpp @@ -74,7 +74,7 @@ public: *rowProto.MutablePortionMeta() = std::move(*proto); } - auto& data = Indices[index].Columns[portion.GetGranule()]; + auto& data = Indices[index].Columns[portion.GetPathId()]; NOlap::TColumnChunkLoadContext loadContext(row.GetAddress(), row.BlobRange, rowProto); auto itInsertInfo = LoadContexts[portion.GetAddress()].emplace(row.GetAddress(), loadContext); if (!itInsertInfo.second) { @@ -84,7 +84,7 @@ public: if (it == data.end()) { it = data.emplace(portion.GetPortion(), portion.CopyWithFilteredColumns({})).first; } else { - Y_ABORT_UNLESS(portion.GetGranule() == it->second.GetGranule() && portion.GetPortion() == it->second.GetPortion()); + Y_ABORT_UNLESS(portion.GetPathId() == it->second.GetPathId() && portion.GetPortion() == it->second.GetPortion()); } it->second.SetMinSnapshot(portion.GetMinSnapshot()); it->second.SetRemoveSnapshot(portion.GetRemoveSnapshot()); @@ -103,7 +103,7 @@ public: } void EraseColumn(ui32 index, const TPortionInfo& portion, const TColumnRecord& row) override { - auto& data = Indices[index].Columns[portion.GetGranule()]; + auto& data = Indices[index].Columns[portion.GetPathId()]; auto it = data.find(portion.GetPortion()); Y_ABORT_UNLESS(it != data.end()); auto& portionLocal = it->second; @@ -119,7 +119,7 @@ public: bool LoadColumns(ui32 index, const std::function<void(const TPortionInfo&, const TColumnChunkLoadContext&)>& callback) override { auto& columns = Indices[index].Columns; - for (auto& [granule, portions] : columns) { + for (auto& [pathId, portions] : columns) { for (auto& [portionId, portionLocal] : portions) { auto copy = portionLocal; copy.ResetMeta(); diff --git a/ydb/core/tx/columnshard/ut_rw/ut_columnshard_read_write.cpp b/ydb/core/tx/columnshard/ut_rw/ut_columnshard_read_write.cpp index 8fc3658afd..aa20d99089 100644 --- a/ydb/core/tx/columnshard/ut_rw/ut_columnshard_read_write.cpp +++ b/ydb/core/tx/columnshard/ut_rw/ut_columnshard_read_write.cpp @@ -2858,11 +2858,11 @@ Y_UNIT_TEST_SUITE(TColumnShardTestReadWrite) { Y_ABORT_UNLESS(compact->SwitchedPortions.size()); ++compactionsHappened; Cerr << "Compaction old portions:"; - ui64 srcGranule{0}; + ui64 srcPathId{0}; for (const auto& portionInfo : compact->SwitchedPortions) { - ui64 granule = portionInfo.GetGranule(); - UNIT_ASSERT(!srcGranule || srcGranule == granule); - srcGranule = granule; + const ui64 pathId = portionInfo.GetPathId(); + UNIT_ASSERT(!srcPathId || srcPathId == pathId); + srcPathId = pathId; oldPortions.insert(portionInfo.GetPortion()); } Cerr << Endl; |