diff options
| author | Evgeniy Ivanov <[email protected]> | 2022-03-21 16:00:22 +0300 |
|---|---|---|
| committer | Evgeniy Ivanov <[email protected]> | 2022-03-21 16:00:22 +0300 |
| commit | 76bed47c1037bd23396c06e6f935bbdd4edf8ee3 (patch) | |
| tree | 1cb2a19761daec52cbab1907a449ca3840b1db6c | |
| parent | 25b364b94b314b1c99032c78de18154f9301dbd2 (diff) | |
PR from branch users/eivanov89/KIKIMR-5850-tablet-flat-cleanup
KIKIMR-5850: remove wrong and confusing defaults
KIKIMR-5850: rename TWritten to TWriteStats
ref:e5681321d894e7e25bfa42369f83d4647d9c65cc
| -rw-r--r-- | ydb/core/tablet_flat/flat_ops_compact.h | 12 | ||||
| -rw-r--r-- | ydb/core/tablet_flat/flat_page_writer.h | 4 | ||||
| -rw-r--r-- | ydb/core/tablet_flat/flat_part_laid.h | 7 | ||||
| -rw-r--r-- | ydb/core/tablet_flat/flat_part_writer.h | 22 | ||||
| -rw-r--r-- | ydb/core/tablet_flat/test/libs/table/test_part.h | 2 | ||||
| -rw-r--r-- | ydb/core/tablet_flat/test/libs/table/test_writer.h | 6 | ||||
| -rw-r--r-- | ydb/core/tablet_flat/ut/ut_part.cpp | 2 |
7 files changed, 25 insertions, 30 deletions
diff --git a/ydb/core/tablet_flat/flat_ops_compact.h b/ydb/core/tablet_flat/flat_ops_compact.h index c71b7fe479a..3e00fbc393d 100644 --- a/ydb/core/tablet_flat/flat_ops_compact.h +++ b/ydb/core/tablet_flat/flat_ops_compact.h @@ -128,9 +128,9 @@ namespace NTabletFlatExecutor { } else if (seq == 1) /* after the end(), stop compaction */ { if (!Finished) { - Stat = Writer->Finish(); + WriteStats = Writer->Finish(); Results = Bundle->Results(); - Y_VERIFY(Stat.Parts == Results.size()); + Y_VERIFY(WriteStats.Parts == Results.size()); WriteTxStatus(); Finished = true; } @@ -327,11 +327,11 @@ namespace NTabletFlatExecutor { prod->TxStatus = std::move(TxStatus); if (auto logl = Logger->Log(fail ? ELnLev::Error : ELnLev::Info)) { - auto raito = Stat.Bytes ? (Stat.Coded + 0.) / Stat.Bytes : 0.; + auto raito = WriteStats.Bytes ? (WriteStats.Coded + 0.) / WriteStats.Bytes : 0.; logl << NFmt::Do(*this) << " end=" << ui32(abort) - << ", " << Blobs << "blobs " << Stat.Rows << "r" + << ", " << Blobs << "blobs " << WriteStats.Rows << "r" << " (max " << Conf->Layout.MaxRows << ")" << ", put " << NFmt::If(Spent.Get()); @@ -362,7 +362,7 @@ namespace NTabletFlatExecutor { if (fail) { prod->Results.clear(); /* shouldn't sent w/o fixation in bs */ - } else if (bool(prod->Results) != bool(Stat.Rows > 0)) { + } else if (bool(prod->Results) != bool(WriteStats.Rows > 0)) { Y_FAIL("Unexpexced rows production result after compaction"); } else if ((bool(prod->Results) || bool(prod->TxStatus)) != bool(Blobs > 0)) { Y_FAIL("Unexpexced blobs production result after compaction"); @@ -518,7 +518,7 @@ namespace NTabletFlatExecutor { TIntrusiveConstPtr<TScheme> Scheme; TAutoPtr<TBundle> Bundle; TAutoPtr<TWriter> Writer; - NTable::TWritten Stat; + NTable::TWriteStats WriteStats; TVector<TBundle::TResult> Results; TVector<TIntrusiveConstPtr<NTable::TTxStatusPart>> TxStatus; const NScheme::TTypeRegistry * Registry = nullptr; diff --git a/ydb/core/tablet_flat/flat_page_writer.h b/ydb/core/tablet_flat/flat_page_writer.h index 8c931c12be7..1213524581d 100644 --- a/ydb/core/tablet_flat/flat_page_writer.h +++ b/ydb/core/tablet_flat/flat_page_writer.h @@ -537,7 +537,7 @@ namespace NPage { const TIntrusiveConstPtr<TPartScheme> Scheme; private: - const TPgSize PageSize = 8 * 1024; + const TPgSize PageSize; const ui32 PageRows = Max<ui32>(); const TPgSize SmallEdge; const TPgSize LargeEdge; @@ -632,7 +632,7 @@ namespace NPage { const TIntrusiveConstPtr<TPartScheme> Scheme; private: - const TPgSize MinSize = 8 * 1024; + const TPgSize MinSize; const TGroupId GroupId; const TPartScheme::TGroupInfo& GroupInfo; TDataPageBuilder DataPageBuilder; diff --git a/ydb/core/tablet_flat/flat_part_laid.h b/ydb/core/tablet_flat/flat_part_laid.h index 50aec4bcb12..766cf87ab6a 100644 --- a/ydb/core/tablet_flat/flat_part_laid.h +++ b/ydb/core/tablet_flat/flat_part_laid.h @@ -52,12 +52,7 @@ namespace NTable { TIntrusiveConstPtr<TSlices> Slices; }; - struct TWritten { - explicit operator bool() const noexcept - { - return Rows > 0; - } - + struct TWriteStats { /*_ Some writer stats collection */ ui64 Rows = 0; diff --git a/ydb/core/tablet_flat/flat_part_writer.h b/ydb/core/tablet_flat/flat_part_writer.h index 41682c4b931..ac300cc4393 100644 --- a/ydb/core/tablet_flat/flat_part_writer.h +++ b/ydb/core/tablet_flat/flat_part_writer.h @@ -157,11 +157,11 @@ namespace NTable { return row.GetRowState(); } - TWritten Finish() noexcept + TWriteStats Finish() noexcept { Flush(true); - return std::move(Result); + return std::move(WriteStats); } private: @@ -478,12 +478,12 @@ namespace NTable { if (Current.Rows > 0) { Y_VERIFY(Phase == 2, "Missed the last Save call"); - Result.Rows += Current.Rows; - Result.Drops += Current.Drops; - Result.Bytes += Current.Bytes; - Result.Coded += Current.Coded; - Result.HiddenRows += Current.HiddenRows; - Result.HiddenDrops += Current.HiddenDrops; + WriteStats.Rows += Current.Rows; + WriteStats.Drops += Current.Drops; + WriteStats.Bytes += Current.Bytes; + WriteStats.Coded += Current.Coded; + WriteStats.HiddenRows += Current.HiddenRows; + WriteStats.HiddenDrops += Current.HiddenDrops; if (Current.HistoryWritten > 0) { Current.HistoricIndexes.clear(); @@ -524,7 +524,7 @@ namespace NTable { Y_VERIFY(Slices && *Slices, "Flushing bundle without a run"); Pager.Finish(TOverlay{ nullptr, std::move(Slices) }.Encode()); - ++Result.Parts; + ++WriteStats.Parts; } if (!last) { @@ -572,7 +572,7 @@ namespace NTable { if (Current.Small != Max<TPageId>()) head = Max(head, ui32(15) /* ELargeObj:Outer packed blobs */); - if (!last || Result.Parts > 0) + if (!last || WriteStats.Parts > 0) head = Max(head, ui32(20) /* Multiple part outputs */); if (!Current.GroupIndexes.empty()) @@ -891,7 +891,7 @@ namespace NTable { NPage::TFrameWriter FrameS; /* Packed blobs invertedi index */ NPage::TExtBlobsWriter Globs; THolder<NBloom::IWriter> ByKey; - TWritten Result; + TWriteStats WriteStats; TStackVec<TCell, 16> Key; ui32 Phase = 0; diff --git a/ydb/core/tablet_flat/test/libs/table/test_part.h b/ydb/core/tablet_flat/test/libs/table/test_part.h index eb8842ed64c..064f17d3772 100644 --- a/ydb/core/tablet_flat/test/libs/table/test_part.h +++ b/ydb/core/tablet_flat/test/libs/table/test_part.h @@ -119,7 +119,7 @@ namespace NTest { return { Lone(), nullptr, Lone()->Slices }; } - TAutoPtr<TWritten> Written; + TAutoPtr<TWriteStats> Written; TIntrusiveConstPtr<TRowScheme> Scheme; TVector<TIntrusiveConstPtr<TPartStore>> Parts; }; diff --git a/ydb/core/tablet_flat/test/libs/table/test_writer.h b/ydb/core/tablet_flat/test/libs/table/test_writer.h index 704ba0c136e..6f366496366 100644 --- a/ydb/core/tablet_flat/test/libs/table/test_writer.h +++ b/ydb/core/tablet_flat/test/libs/table/test_writer.h @@ -151,13 +151,13 @@ namespace NTest { } - TPartEggs Flush(TIntrusiveConstPtr<TRowScheme> scheme, const TWritten &written) + TPartEggs Flush(TIntrusiveConstPtr<TRowScheme> scheme, const TWriteStats &written) { Y_VERIFY(!Store, "Writer has not been flushed"); Y_VERIFY(written.Parts == Parts.size()); return - { new TWritten(written), std::move(scheme), std::move(Parts) }; + { new TWriteStats(written), std::move(scheme), std::move(Parts) }; } private: @@ -260,7 +260,7 @@ namespace NTest { if (const auto *written = eggs.Written.Get()) { mass.Model->Check({ &written->Rows, 1 }); } else { - Y_FAIL("Got part eggs without TWritten result"); + Y_FAIL("Got part eggs without TWriteStats result"); } return eggs; diff --git a/ydb/core/tablet_flat/ut/ut_part.cpp b/ydb/core/tablet_flat/ut/ut_part.cpp index e9cdf756b58..248e0fd6b57 100644 --- a/ydb/core/tablet_flat/ut/ut_part.cpp +++ b/ydb/core/tablet_flat/ut/ut_part.cpp @@ -83,7 +83,7 @@ Y_UNIT_TEST_SUITE(TPart) { auto eggs = TPartCook(lay, { true, 4096 }).Finish(); if (eggs.Written->Rows > 0) { - ythrow yexception() << "Unexpected trivial TWritten result"; + ythrow yexception() << "Unexpected trivial TWriteStats result"; } else if (eggs.Parts) { ythrow yexception() << "Writer produced parts with trival data"; } |
