Skip to content

Commit

Permalink
correction
Browse files Browse the repository at this point in the history
  • Loading branch information
ivanmorozov333 committed May 30, 2024
1 parent 67c0ae8 commit 799abe4
Showing 1 changed file with 23 additions and 19 deletions.
42 changes: 23 additions & 19 deletions ydb/core/tx/columnshard/normalizer/granule/clean_granule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,21 +26,21 @@ namespace {
template <class TRowSet>
TChunkData(const TRowSet& rowset) {
using Schema = NColumnShard::Schema;
PlanStep = rowset.GetValue<Schema::IndexColumns::PlanStep>();
TxId = rowset.GetValue<Schema::IndexColumns::TxId>();
PortionId = rowset.GetValue<Schema::IndexColumns::Portion>();
GranuleId = rowset.GetValue<Schema::IndexColumns::Granule>();
Chunk = rowset.GetValue<Schema::IndexColumns::Chunk>();
Index = rowset.GetValue<Schema::IndexColumns::Index>();
ColumnIdx = rowset.GetValue<Schema::IndexColumns::ColumnIdx>();

XPlanStep = rowset.GetValue<Schema::IndexColumns::XPlanStep>();
XTxId = rowset.GetValue<Schema::IndexColumns::XTxId>();
Blob = rowset.GetValue<Schema::IndexColumns::Blob>();
Metadata = rowset.GetValue<Schema::IndexColumns::Metadata>();
Offset = rowset.GetValue<Schema::IndexColumns::Offset>();
Size = rowset.GetValue<Schema::IndexColumns::Size>();
PathId = rowset.GetValue<Schema::IndexColumns::PathId>();
PlanStep = rowset.template GetValue<Schema::IndexColumns::PlanStep>();
TxId = rowset.template GetValue<Schema::IndexColumns::TxId>();
PortionId = rowset.template GetValue<Schema::IndexColumns::Portion>();
GranuleId = rowset.template GetValue<Schema::IndexColumns::Granule>();
Chunk = rowset.template GetValue<Schema::IndexColumns::Chunk>();
Index = rowset.template GetValue<Schema::IndexColumns::Index>();
ColumnIdx = rowset.template GetValue<Schema::IndexColumns::ColumnIdx>();

XPlanStep = rowset.template GetValue<Schema::IndexColumns::XPlanStep>();
XTxId = rowset.template GetValue<Schema::IndexColumns::XTxId>();
Blob = rowset.template GetValue<Schema::IndexColumns::Blob>();
Metadata = rowset.template GetValue<Schema::IndexColumns::Metadata>();
Offset = rowset.template GetValue<Schema::IndexColumns::Offset>();
Size = rowset.template GetValue<Schema::IndexColumns::Size>();
PathId = rowset.template GetValue<Schema::IndexColumns::PathId>();
}
};
}
Expand Down Expand Up @@ -70,10 +70,10 @@ class TCleanGranuleIdNormalizer::TNormalizerResult : public INormalizerChanges {
NIceDb::TUpdate<Schema::IndexColumns::PathId>(key.PathId),
NIceDb::TUpdate<Schema::IndexColumns::Blob>(key.Blob),
NIceDb::TUpdate<Schema::IndexColumns::Metadata>(key.Metadata),
NIceDb::TUpdate<Schema::IndexColumns::Metadata>(key.Offset),
NIceDb::TUpdate<Schema::IndexColumns::Metadata>(key.Size),
NIceDb::TUpdate<Schema::IndexColumns::Metadata>(key.XPlanStep),
NIceDb::TUpdate<Schema::IndexColumns::Metadata>(key.XTxId)
NIceDb::TUpdate<Schema::IndexColumns::Offset>(key.Offset),
NIceDb::TUpdate<Schema::IndexColumns::Size>(key.Size),
NIceDb::TUpdate<Schema::IndexColumns::XPlanStep>(key.XPlanStep),
NIceDb::TUpdate<Schema::IndexColumns::XTxId>(key.XTxId)

);
}
Expand All @@ -96,6 +96,7 @@ class TCleanGranuleIdNormalizer::TNormalizerResult : public INormalizerChanges {

std::vector<INormalizerChanges::TPtr> tasks;
ui64 fullChunksCount = 0;
THashSet<ui64> portionIds;
{
auto rowset = db.Table<Schema::IndexColumns>().Select();
if (!rowset.IsReady()) {
Expand All @@ -106,6 +107,7 @@ class TCleanGranuleIdNormalizer::TNormalizerResult : public INormalizerChanges {

while (!rowset.EndOfSet()) {
if (rowset.GetValue<Schema::IndexColumns::Granule>() || rowset.GetValue<Schema::IndexColumns::Index>()) {
AFL_VERIFY(portionIds.emplace(rowset.GetValue<Schema::IndexColumns::Portion>()).second);
TChunkData key(rowset);

changes->AddChunk(std::move(key));
Expand All @@ -115,6 +117,7 @@ class TCleanGranuleIdNormalizer::TNormalizerResult : public INormalizerChanges {
if (chunksCount == 10000) {
tasks.emplace_back(changes);
changes.reset(new TNormalizerResult());
controller.GetCounters().CountObjects(chunksCount);
chunksCount = 0;
}
}
Expand All @@ -126,6 +129,7 @@ class TCleanGranuleIdNormalizer::TNormalizerResult : public INormalizerChanges {

if (chunksCount > 0) {
tasks.emplace_back(changes);
controller.GetCounters().CountObjects(chunksCount);
}
}
ACFL_INFO("normalizer", "TGranulesNormalizer")("message", TStringBuilder() << fullChunksCount << " chunks found");
Expand Down

0 comments on commit 799abe4

Please sign in to comment.