diff options
author | Evgeniy Ivanov <eivanov89@yandex-team.ru> | 2022-03-15 13:38:09 +0300 |
---|---|---|
committer | Evgeniy Ivanov <eivanov89@yandex-team.ru> | 2022-03-15 13:38:09 +0300 |
commit | a00d7c212095f500fa8240810af56aea94e72394 (patch) | |
tree | d739483c13db7aac2cf4986c4d877dd3f72dd448 | |
parent | 270a241631fb2e385f55dfe0e0f40dae0dbb474c (diff) | |
download | ydb-a00d7c212095f500fa8240810af56aea94e72394.tar.gz |
PR from branch users/eivanov89/KIKIMR-5850-tablet-flat-minor-cleanup
KIKIMR-5850: cleanup row cooker
KIKIMR-5850: rename block to maxBlobSize
ref:6e000b02c4b6ff51864ed9368127ea346c6bc005
25 files changed, 216 insertions, 214 deletions
diff --git a/ydb/core/tablet_flat/flat_executor.cpp b/ydb/core/tablet_flat/flat_executor.cpp index 59afc462158..e38dda8373c 100644 --- a/ydb/core/tablet_flat/flat_executor.cpp +++ b/ydb/core/tablet_flat/flat_executor.cpp @@ -3979,7 +3979,7 @@ ui64 TExecutor::BeginCompaction(THolder<NTable::TCompactionParams> params) pageGroup.PageSize = policy->MinDataPageSize; writeGroup.Cache = Max(family->Cache, cache); - writeGroup.Block = NBlockIO::BlockSize; + writeGroup.MaxBlobSize = NBlockIO::BlockSize; writeGroup.Channel = room->Main; addChannel(room->Main); diff --git a/ydb/core/tablet_flat/flat_sausage_writer.h b/ydb/core/tablet_flat/flat_sausage_writer.h index c7cda9e2a47..43fda7ed8a8 100644 --- a/ydb/core/tablet_flat/flat_sausage_writer.h +++ b/ydb/core/tablet_flat/flat_sausage_writer.h @@ -9,8 +9,8 @@ namespace NPageCollection { class TWriter { public: - TWriter(TCookieAllocator &cookieAllocator, ui8 channel, ui32 block) - : Block(block) + TWriter(TCookieAllocator &cookieAllocator, ui8 channel, ui32 maxBlobSize) + : MaxBlobSize(maxBlobSize) , Channel(channel) , CookieAllocator(cookieAllocator) , Record(cookieAllocator.GroupBy(channel)) @@ -26,16 +26,16 @@ namespace NPageCollection { ui32 AddPage(const TArrayRef<const char> body, ui32 type) { for (size_t offset = 0; offset < body.size(); ) { - if (Buffer.capacity() == 0 && Block != Max<ui32>()) - Buffer.reserve(Min(Block, ui32(16 * 1024 * 1024))); + if (Buffer.capacity() == 0 && MaxBlobSize != Max<ui32>()) + Buffer.reserve(Min(MaxBlobSize, ui32(16 * 1024 * 1024))); - auto piece = Min(body.size() - offset, Block - Buffer.size()); + auto piece = Min(body.size() - offset, MaxBlobSize - Buffer.size()); auto chunk = body.Slice(offset, piece); Buffer.append(chunk.data(), chunk.size()); offset += piece; - if (Buffer.size() >= Block) Flush(); + if (Buffer.size() >= MaxBlobSize) Flush(); } return Record.Push(type, body); @@ -95,7 +95,7 @@ namespace NPageCollection { } public: - const ui32 Block = Max<ui32>(); + const ui32 MaxBlobSize = Max<ui32>(); const ui8 Channel = Max<ui8>(); private: TString Buffer; diff --git a/ydb/core/tablet_flat/flat_writer_blocks.h b/ydb/core/tablet_flat/flat_writer_blocks.h index b35da85e166..6f7bca85e43 100644 --- a/ydb/core/tablet_flat/flat_writer_blocks.h +++ b/ydb/core/tablet_flat/flat_writer_blocks.h @@ -98,7 +98,7 @@ namespace NWriter { NPageCollection::TLargeGlobId CutToChunks(TArrayRef<const char> body) { - return Cone->Put(0, Channel, body, Writer.Block); + return Cone->Put(0, Channel, body, Writer.MaxBlobSize); } private: diff --git a/ydb/core/tablet_flat/flat_writer_bundle.h b/ydb/core/tablet_flat/flat_writer_bundle.h index d489e51e9df..761d3243326 100644 --- a/ydb/core/tablet_flat/flat_writer_bundle.h +++ b/ydb/core/tablet_flat/flat_writer_bundle.h @@ -32,9 +32,10 @@ namespace NWriter { Blocks.resize(Groups.size() + 1); for (size_t group : xrange(Groups.size())) { - Blocks[group].Reset(new TBlocks(this, Groups[group].Channel, Groups[group].Cache, Groups[group].Block)); + Blocks[group].Reset( + new TBlocks(this, Groups[group].Channel, Groups[group].Cache, Groups[group].MaxBlobSize)); } - Blocks[Groups.size()].Reset(new TBlocks(this, conf.OuterChannel, none, Groups[0].Block)); + Blocks[Groups.size()].Reset(new TBlocks(this, conf.OuterChannel, none, Groups[0].MaxBlobSize)); Growth = new NTable::TScreen::TCook; } @@ -60,7 +61,7 @@ namespace NWriter { NPageCollection::TLargeGlobId WriteExtra(TArrayRef<const char> body) noexcept { - return Put(/* data cookieRange */ 1, ExtraChannel, body, Groups[0].Block); + return Put(/* data cookieRange */ 1, ExtraChannel, body, Groups[0].MaxBlobSize); } private: diff --git a/ydb/core/tablet_flat/flat_writer_conf.h b/ydb/core/tablet_flat/flat_writer_conf.h index 02dfdfdfda6..efeb9440c69 100644 --- a/ydb/core/tablet_flat/flat_writer_conf.h +++ b/ydb/core/tablet_flat/flat_writer_conf.h @@ -23,7 +23,7 @@ namespace NWriter { struct TGroup { ui8 Channel = 1; /* Data channel for page collection */ ECache Cache = ECache::None; /* Keep data pages in memory */ - ui32 Block = 8 * 1024 * 1024; /* Page collection max blob size */ + ui32 MaxBlobSize = 8 * 1024 * 1024; /* Page collection max blob size */ }; ui8 BlobsChannel = 1; /* Channel for external blobs */ diff --git a/ydb/core/tablet_flat/test/libs/rows/cook.h b/ydb/core/tablet_flat/test/libs/rows/cook.h index a6fb2b48084..94a2358bb97 100644 --- a/ydb/core/tablet_flat/test/libs/rows/cook.h +++ b/ydb/core/tablet_flat/test/libs/rows/cook.h @@ -18,10 +18,11 @@ namespace NTest { Y_VERIFY(!*row, "Cooked row hasn't been grabbed to TRow"); } - template<typename ...TArgs> - inline TCookRow& Do(NTable::TTag tag, TArgs&& ...args) + template<typename TVal> + inline TCookRow& Do(NTable::TTag tag, TVal&& val) { - return row.Do(tag, std::forward<TArgs>(args)...), *this; + row.Do(tag, std::move(val)); + return *this; } TRow operator *() noexcept @@ -33,9 +34,9 @@ namespace NTest { TRow row; }; - class TNatural { + class TSchemedCookRow { public: - TNatural(const TRowScheme &scheme, TPos skip = 0) + TSchemedCookRow(const TRowScheme &scheme, TPos skip = 0) : On(skip), Scheme(scheme) { } inline TRow operator*() noexcept @@ -43,18 +44,18 @@ namespace NTest { return std::move(Row); } - TNatural& To(TPos to) noexcept + TSchemedCookRow& To(TPos to) noexcept { - if(to < On || to >= Scheme.Cols.size()) { - - Y_FAIL("TNatural row builder skip position is out of range"); + if (to < On || to >= Scheme.Cols.size()) { + Y_FAIL("TSchemedCookRow row builder skip position is out of range"); } - return On = to, *this; + On = to; + return *this; } template<typename TVal, typename ...TArgs> - inline TNatural& Col(const TVal &val, TArgs&&...args) + inline TSchemedCookRow& Col(const TVal &val, TArgs&&...args) { if (On >= Scheme.Cols.size()) { Y_FAIL("NO more columns left in row scheme"); diff --git a/ydb/core/tablet_flat/test/libs/table/model/keys.h b/ydb/core/tablet_flat/test/libs/table/model/keys.h index 7dec47e39b6..56f7f711870 100644 --- a/ydb/core/tablet_flat/test/libs/table/model/keys.h +++ b/ydb/core/tablet_flat/test/libs/table/model/keys.h @@ -31,7 +31,7 @@ namespace NTest { TRow Make(ui64 seq, bool hole) noexcept override { - TNatural row(*Scheme); + TSchemedCookRow row(*Scheme); auto &bucket = Buckets[seq % Buckets.size()]; auto name = TStrGen(Rnd).Do(20 + Rnd.GenRand64() % 30); diff --git a/ydb/core/tablet_flat/test/libs/table/model/large.h b/ydb/core/tablet_flat/test/libs/table/model/large.h index 6dfb4d6af98..025d8adfbc9 100644 --- a/ydb/core/tablet_flat/test/libs/table/model/large.h +++ b/ydb/core/tablet_flat/test/libs/table/model/large.h @@ -25,7 +25,7 @@ namespace NTest { { const ui64 up = hole ? 0 : 1; - TNatural row(*Scheme); + TSchemedCookRow row(*Scheme); { Sub[0] += up, row.Col(Seq * 3 + 7, ui32(Seq + 10), Sub[0]); diff --git a/ydb/core/tablet_flat/test/libs/table/model/small.h b/ydb/core/tablet_flat/test/libs/table/model/small.h index d1b0cdfca25..32ef386cf18 100644 --- a/ydb/core/tablet_flat/test/libs/table/model/small.h +++ b/ydb/core/tablet_flat/test/libs/table/model/small.h @@ -23,7 +23,7 @@ namespace NTest { TRow Make(ui64 seq, bool hole) noexcept override { - TNatural row(*Scheme); + TSchemedCookRow row(*Scheme); row.Col(seq, (Saved += hole ? 0 : 1)); diff --git a/ydb/core/tablet_flat/test/libs/table/test_dbase.h b/ydb/core/tablet_flat/test/libs/table/test_dbase.h index fd931a54839..06bede14c9b 100644 --- a/ydb/core/tablet_flat/test/libs/table/test_dbase.h +++ b/ydb/core/tablet_flat/test/libs/table/test_dbase.h @@ -131,7 +131,7 @@ namespace NTest { return Base->TxSnapTable(table), *this; } - NTest::TNatural Natural(ui32 table) noexcept + NTest::TSchemedCookRow SchemedCookRow(ui32 table) noexcept { return { RowSchemeFor(table) }; } diff --git a/ydb/core/tablet_flat/test/libs/table/test_iter.h b/ydb/core/tablet_flat/test/libs/table/test_iter.h index f4010ab2b61..c2747256130 100644 --- a/ydb/core/tablet_flat/test/libs/table/test_iter.h +++ b/ydb/core/tablet_flat/test/libs/table/test_iter.h @@ -80,7 +80,7 @@ namespace NTest { template<typename ...TArgs> inline TChecker& IsOpN(ERowOp op, TArgs&&...args) { - auto row = *TNatural(Scheme).Col(std::forward<TArgs>(args)...); + auto row = *TSchemedCookRow(Scheme).Col(std::forward<TArgs>(args)...); return Is(row, true, op); } @@ -88,7 +88,7 @@ namespace NTest { template<typename ...TArgs> inline TChecker& HasN(TArgs&&...args) { - return Has(*TNatural(Scheme).Col(std::forward<TArgs>(args)...)); + return Has(*TSchemedCookRow(Scheme).Col(std::forward<TArgs>(args)...)); } template<typename ...TArgs> 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 5df2014cd64..704ba0c136e 100644 --- a/ydb/core/tablet_flat/test/libs/table/test_writer.h +++ b/ydb/core/tablet_flat/test/libs/table/test_writer.h @@ -285,7 +285,7 @@ namespace NTest { template<typename ...TArgs> inline TPartCook& AddOpN(ERowOp op, TArgs&&...args) { - auto row = *TNatural(*Scheme).Col(std::forward<TArgs>(args)...); + auto row = *TSchemedCookRow(*Scheme).Col(std::forward<TArgs>(args)...); return Add(std::move(row), op); } @@ -293,7 +293,7 @@ namespace NTest { template<typename ...TArgs> inline TPartCook& AddN(TArgs&&...args) { - auto row = *TNatural(*Scheme).Col(std::forward<TArgs>(args)...); + auto row = *TSchemedCookRow(*Scheme).Col(std::forward<TArgs>(args)...); return Add(std::move(row), ERowOp::Upsert); } diff --git a/ydb/core/tablet_flat/ut/ut_bloom.cpp b/ydb/core/tablet_flat/ut/ut_bloom.cpp index 0ba3f5b6629..aa4e2118568 100644 --- a/ydb/core/tablet_flat/ut/ut_bloom.cpp +++ b/ydb/core/tablet_flat/ut/ut_bloom.cpp @@ -159,18 +159,18 @@ Y_UNIT_TEST_SUITE(Bloom) { me.To(10).Begin().Apply(*MakeAlter()).Commit(); - const auto ru1 = *me.Natural(1).Col("ba0_huxu", 01234_u64); - const auto rw1 = *me.Natural(1).Col("ba2_d7mj", 12340_u64); - const auto ru2 = *me.Natural(1).Col("ba4_tfcr", 23401_u64); - const auto rw2 = *me.Natural(1).Col("ba6_fdy4", 34012_u64); - const auto rw3 = *me.Natural(1).Col("ba8_digr", 40123_u64); + const auto ru1 = *me.SchemedCookRow(1).Col("ba0_huxu", 01234_u64); + const auto rw1 = *me.SchemedCookRow(1).Col("ba2_d7mj", 12340_u64); + const auto ru2 = *me.SchemedCookRow(1).Col("ba4_tfcr", 23401_u64); + const auto rw2 = *me.SchemedCookRow(1).Col("ba6_fdy4", 34012_u64); + const auto rw3 = *me.SchemedCookRow(1).Col("ba8_digr", 40123_u64); /* These keys are fitted to be filtered in all parts with ByKey Bloom filter enabled, thus in Pw and Pz parts. */ - const auto no1 = *me.Natural(1).Col("ba1_p9lw", 53543_u64); - const auto no2 = *me.Natural(1).Col("ba3_g0ny", 53442_u64); - const auto no3 = *me.Natural(1).Col("ba5_3hpx", 50894_u64); + const auto no1 = *me.SchemedCookRow(1).Col("ba1_p9lw", 53543_u64); + const auto no2 = *me.SchemedCookRow(1).Col("ba3_g0ny", 53442_u64); + const auto no3 = *me.SchemedCookRow(1).Col("ba5_3hpx", 50894_u64); /*_ 10: Filter shouldn't be used when it is not enabled, Pu */ diff --git a/ydb/core/tablet_flat/ut/ut_charge.cpp b/ydb/core/tablet_flat/ut/ut_charge.cpp index fa063eb8e73..d9faf3262cf 100644 --- a/ydb/core/tablet_flat/ut/ut_charge.cpp +++ b/ydb/core/tablet_flat/ut/ut_charge.cpp @@ -189,9 +189,9 @@ Y_UNIT_TEST_SUITE(Charge) { .Col(0, 1, NScheme::NTypeIds::String) .Key({0, 1}); - const auto foo = *TNatural(*lay).Col(555_u32, "foo"); - const auto bar = *TNatural(*lay).Col(777_u32, "bar"); - const auto baz = *TNatural(*lay).Col(999_u32, "baz"); + const auto foo = *TSchemedCookRow(*lay).Col(555_u32, "foo"); + const auto bar = *TSchemedCookRow(*lay).Col(777_u32, "bar"); + const auto baz = *TSchemedCookRow(*lay).Col(999_u32, "baz"); NPage::TIndex me( TCooker(*lay) diff --git a/ydb/core/tablet_flat/ut/ut_comp_shard.cpp b/ydb/core/tablet_flat/ut/ut_comp_shard.cpp index c2dba25ab94..08fc181ba93 100644 --- a/ydb/core/tablet_flat/ut/ut_comp_shard.cpp +++ b/ydb/core/tablet_flat/ut/ut_comp_shard.cpp @@ -229,7 +229,7 @@ Y_UNIT_TEST_SUITE(TShardedCompaction) { TRowTool tool(*lay); TRowsHeap rows(64 * 1024); for (ui64 seq = 0; seq < 4*4; ++seq) { - rows.Put(*TNatural(*lay).Col(seq, 500_u32, 42_u32)); + rows.Put(*TSchemedCookRow(*lay).Col(seq, 500_u32, 42_u32)); } auto partView = CreatePart(lay, rows, 4); @@ -327,7 +327,7 @@ Y_UNIT_TEST_SUITE(TShardedCompaction) { TRowTool tool(*lay); TRowsHeap rows(64 * 1024); for (ui64 seq = 0; seq < 4*4+2; ++seq) { - rows.Put(*TNatural(*lay).Col(seq, 500_u32, 42_u32)); + rows.Put(*TSchemedCookRow(*lay).Col(seq, 500_u32, 42_u32)); } auto partView = CreatePart(lay, rows, 4); @@ -390,7 +390,7 @@ Y_UNIT_TEST_SUITE(TShardedCompaction) { TRowTool tool(*lay); TRowsHeap rows(64 * 1024); for (ui64 seq = 0; seq < 10*4+3; ++seq) { - rows.Put(*TNatural(*lay).Col(1000 + seq, 42_u32)); + rows.Put(*TSchemedCookRow(*lay).Col(1000 + seq, 42_u32)); } auto partView = CreatePart(lay, rows, 4); @@ -405,9 +405,9 @@ Y_UNIT_TEST_SUITE(TShardedCompaction) { TRowId splitRow = rows.Size() / 2; TVector<TSerializedCellVec> splitKeys; - splitKeys.emplace_back(TSerializedCellVec::Serialize(tool.KeyCells(*TNatural(*lay).Col(500_u64, 42_u32)))); + splitKeys.emplace_back(TSerializedCellVec::Serialize(tool.KeyCells(*TSchemedCookRow(*lay).Col(500_u64, 42_u32)))); splitKeys.emplace_back(TSerializedCellVec::Serialize(tool.KeyCells(rows[splitRow]))); - splitKeys.emplace_back(TSerializedCellVec::Serialize(tool.KeyCells(*TNatural(*lay).Col(5000_u64, 42_u32)))); + splitKeys.emplace_back(TSerializedCellVec::Serialize(tool.KeyCells(*TSchemedCookRow(*lay).Col(5000_u64, 42_u32)))); TTableInfo table; table.RowScheme = lay.RowScheme(); @@ -467,7 +467,7 @@ Y_UNIT_TEST_SUITE(TShardedCompaction) { TRowTool tool(*lay); TRowsHeap rows(64 * 1024); for (ui64 seq = 0; seq < rowsPerPage * pageCount; ++seq) { - rows.Put(*TNatural(*lay).Col(1000 + seq, 42_u32)); + rows.Put(*TSchemedCookRow(*lay).Col(1000 + seq, 42_u32)); } auto partView = CreatePart(lay, rows, rowsPerPage); @@ -529,17 +529,17 @@ Y_UNIT_TEST_SUITE(TShardedCompaction) { TRowsHeap rows1(64 * 1024); for (ui64 seq = 0; seq < 4 * pageCount; ++seq) { - rows1.Put(*TNatural(*lay).Col(1000 + seq, 42_u32)); + rows1.Put(*TSchemedCookRow(*lay).Col(1000 + seq, 42_u32)); } TRowsHeap rows2(64 * 1024); for (ui64 seq = 0; seq < 2 * pageCount; ++seq) { - rows2.Put(*TNatural(*lay).Col(1002 + seq * 2, 42_u32)); + rows2.Put(*TSchemedCookRow(*lay).Col(1002 + seq * 2, 42_u32)); } TRowsHeap rows3(64 * 1024); for (ui64 seq = 0; seq < 1 * pageCount; ++seq) { - rows3.Put(*TNatural(*lay).Col(1003 + seq * 4, 42_u32)); + rows3.Put(*TSchemedCookRow(*lay).Col(1003 + seq * 4, 42_u32)); } auto partView1 = CreatePart(lay, rows1, 4); @@ -601,12 +601,12 @@ Y_UNIT_TEST_SUITE(TShardedCompaction) { TRowsHeap rows1(64 * 1024); for (ui64 seq = 0; seq < 4 * pageCount; ++seq) { - rows1.Put(*TNatural(*lay).Col(1000 + seq, 42_u32)); + rows1.Put(*TSchemedCookRow(*lay).Col(1000 + seq, 42_u32)); } TRowsHeap rows2(64 * 1024); for (ui64 seq = 0; seq < 2 * pageCount; ++seq) { - rows2.Put(*TNatural(*lay).Col(1006 + seq * 2, 42_u32)); + rows2.Put(*TSchemedCookRow(*lay).Col(1006 + seq * 2, 42_u32)); } auto partView1 = CreatePart(lay, rows1, 4); @@ -668,12 +668,12 @@ Y_UNIT_TEST_SUITE(TShardedCompaction) { TRowsHeap rows1(64 * 1024); for (ui64 seq = 0; seq < 4 * pageCount; ++seq) { - rows1.Put(*TNatural(*lay).Col(1000 + seq, 42_u32)); + rows1.Put(*TSchemedCookRow(*lay).Col(1000 + seq, 42_u32)); } TRowsHeap rows2(64 * 1024); - rows2.Put(*TNatural(*lay).Col(1005_u64, 42_u32)); - rows2.Put(*TNatural(*lay).Col(1006_u64, 42_u32)); + rows2.Put(*TSchemedCookRow(*lay).Col(1005_u64, 42_u32)); + rows2.Put(*TSchemedCookRow(*lay).Col(1006_u64, 42_u32)); auto partView1 = CreatePart(lay, rows1, 4); auto partView2 = CreatePart(lay, rows2, 4); @@ -716,12 +716,12 @@ Y_UNIT_TEST_SUITE(TShardedCompaction) { TRowsHeap rows1(64 * 1024); for (ui64 seq = 0; seq < 4 * pageCount; ++seq) { - rows1.Put(*TNatural(*lay).Col(1000 + seq, 42_u32)); + rows1.Put(*TSchemedCookRow(*lay).Col(1000 + seq, 42_u32)); } TRowsHeap rows2(64 * 1024); for (ui64 seq = 0; seq < 5; ++seq) { - rows2.Put(*TNatural(*lay).Col(1009 + seq, 42_u32)); + rows2.Put(*TSchemedCookRow(*lay).Col(1009 + seq, 42_u32)); } auto partView1 = CreatePart(lay, rows1, 4); @@ -775,7 +775,7 @@ Y_UNIT_TEST_SUITE(TShardedCompaction) { TRowsHeap rows(64 * 1024); TPartCook cook(lay, { false, 4096 }); for (ui64 seq = 0; seq < rowsCount; ++seq) { - rows.Put(*TNatural(*lay).Col(1000 + seq, 42_u32)); + rows.Put(*TSchemedCookRow(*lay).Col(1000 + seq, 42_u32)); cook.AddOpN(ERowOp::Erase, 1000 + seq); } @@ -838,7 +838,7 @@ Y_UNIT_TEST_SUITE(TShardedCompaction) { TRowTool tool(*lay); TRowsHeap rows(64 * 1024); for (ui64 seq = 0; seq < 4 * pageCount; ++seq) { - rows.Put(*TNatural(*lay).Col(1000 + seq, 42_u32)); + rows.Put(*TSchemedCookRow(*lay).Col(1000 + seq, 42_u32)); } auto source = TPartCook(lay, CreateConf(4)) diff --git a/ydb/core/tablet_flat/ut/ut_compaction.cpp b/ydb/core/tablet_flat/ut/ut_compaction.cpp index ef0d9bbf152..f0fc2cea142 100644 --- a/ydb/core/tablet_flat/ut/ut_compaction.cpp +++ b/ydb/core/tablet_flat/ut/ut_compaction.cpp @@ -64,7 +64,7 @@ Y_UNIT_TEST_SUITE(TCompaction) { .Col(0, 8, NScheme::NTypeIds::Uint32, Cimple<ui32>(7)) .Key({ 0 }); - auto one = *TNatural(*lay).Col<ui64,ui32>(1, 3); + auto one = *TSchemedCookRow(*lay).Col<ui64,ui32>(1, 3); auto eggs = TPartCook(lay, { false, 4096 }) diff --git a/ydb/core/tablet_flat/ut/ut_compaction_multi.cpp b/ydb/core/tablet_flat/ut/ut_compaction_multi.cpp index 6687e80e4a7..beb115c5c02 100644 --- a/ydb/core/tablet_flat/ut/ut_compaction_multi.cpp +++ b/ydb/core/tablet_flat/ut/ut_compaction_multi.cpp @@ -185,7 +185,7 @@ Y_UNIT_TEST_SUITE(TCompactionMulti) { TRowsHeap rows(nrows); for (int i = 0; i < nrows; ++i) { - rows.Put(*TNatural(*lay).Col(ui64(i), ui64(i * 10))); + rows.Put(*TSchemedCookRow(*lay).Col(ui64(i), ui64(i * 10))); } auto initialConf = NPage::TConf{ false, 2044 }; @@ -211,9 +211,9 @@ Y_UNIT_TEST_SUITE(TCompactionMulti) { for (int i = 0; i < nrows; ++i) { if (i >= nrows-10) { // last 10 rows are strings offloaded to small blobs - rows.Put(*TNatural(*lay).Col(ui64(i), TString("Hello, world!"))); + rows.Put(*TSchemedCookRow(*lay).Col(ui64(i), TString("Hello, world!"))); } else { - rows.Put(*TNatural(*lay).Col(ui64(i), nullptr)); + rows.Put(*TSchemedCookRow(*lay).Col(ui64(i), nullptr)); } } @@ -241,9 +241,9 @@ Y_UNIT_TEST_SUITE(TCompactionMulti) { for (int i = 0; i < nrows; ++i) { if (i >= nrows-10) { // last 10 rows are strings offloaded to small blobs - rows.Put(*TNatural(*lay).Col(ui64(i), TString("Hello, world!"))); + rows.Put(*TSchemedCookRow(*lay).Col(ui64(i), TString("Hello, world!"))); } else { - rows.Put(*TNatural(*lay).Col(ui64(i), nullptr)); + rows.Put(*TSchemedCookRow(*lay).Col(ui64(i), nullptr)); } } diff --git a/ydb/core/tablet_flat/ut/ut_db_iface.cpp b/ydb/core/tablet_flat/ut/ut_db_iface.cpp index 9843e5a6033..8d508394cf8 100644 --- a/ydb/core/tablet_flat/ut/ut_db_iface.cpp +++ b/ydb/core/tablet_flat/ut/ut_db_iface.cpp @@ -31,13 +31,13 @@ Y_UNIT_TEST_SUITE(DBase) { me.To(10).Begin().Apply(*MakeAlter().Flush()).Commit(); - const auto nil = *me.Natural(1).Col(nullptr); - const auto foo = *me.Natural(1).Col("foo", 33_u64); - const auto bar = *me.Natural(1).Col("bar", 11_u64); - const auto ba1 = *me.Natural(1).Col("bar", ECellOp::Empty, "yo"); - const auto ba2 = *me.Natural(1).Col("bar", ECellOp::Reset, "me"); - const auto ba3 = *me.Natural(1).Col("bar", 99_u64, ECellOp::Reset); - const auto ba4 = *me.Natural(1).Col("bar", ECellOp::Null, "eh"); + const auto nil = *me.SchemedCookRow(1).Col(nullptr); + const auto foo = *me.SchemedCookRow(1).Col("foo", 33_u64); + const auto bar = *me.SchemedCookRow(1).Col("bar", 11_u64); + const auto ba1 = *me.SchemedCookRow(1).Col("bar", ECellOp::Empty, "yo"); + const auto ba2 = *me.SchemedCookRow(1).Col("bar", ECellOp::Reset, "me"); + const auto ba3 = *me.SchemedCookRow(1).Col("bar", 99_u64, ECellOp::Reset); + const auto ba4 = *me.SchemedCookRow(1).Col("bar", ECellOp::Null, "eh"); me.To(11).Iter(1).NoKey(foo).NoKey(bar); @@ -101,11 +101,11 @@ Y_UNIT_TEST_SUITE(DBase) { me.To(10).Begin().Apply(*MakeAlter().Flush()).Commit(); - const auto bar = *me.Natural(1).Col("bar", 11_u64); - const auto ba1 = *me.Natural(1).Col("bar", ECellOp::Empty, "yo"); - const auto ba2 = *me.Natural(1).Col("bar", ECellOp::Reset, "me"); - const auto ba3 = *me.Natural(1).Col("bar", 99_u64, ECellOp::Reset); - const auto ba4 = *me.Natural(1).Col("bar", ECellOp::Null, "eh"); + const auto bar = *me.SchemedCookRow(1).Col("bar", 11_u64); + const auto ba1 = *me.SchemedCookRow(1).Col("bar", ECellOp::Empty, "yo"); + const auto ba2 = *me.SchemedCookRow(1).Col("bar", ECellOp::Reset, "me"); + const auto ba3 = *me.SchemedCookRow(1).Col("bar", 99_u64, ECellOp::Reset); + const auto ba4 = *me.SchemedCookRow(1).Col("bar", ECellOp::Null, "eh"); me.To(11).Begin().Add(1, bar).Commit().Select(1).Has(bar); me.To(12).Snap(1).Compact(1, false).Select(1).Has(bar); @@ -138,7 +138,7 @@ Y_UNIT_TEST_SUITE(DBase) { me.To(10).Begin().Apply(*MakeAlter().Flush()); - const auto nuke = *me.Natural(1).Col(nullptr, 11_u64); + const auto nuke = *me.SchemedCookRow(1).Col(nullptr, 11_u64); me.To(11).Add(1, nuke).Commit().Iter(1).Has(nuke); @@ -151,11 +151,11 @@ Y_UNIT_TEST_SUITE(DBase) { .DropColumn(1, 5) .AddColumnToKey(1, 2)); - const auto foo = *me.Natural(1).Col("foo", nullptr, 33_u64); - const auto cap = *me.Natural(1).Col("cap", TOmit{ }, 33_u64); - const auto bar = *me.Natural(1).Col("bar", 11_u32, 33_u64, "me", "you"); - const auto ba8 = *me.Natural(1).Col("bar", 11_u32, 33_u64, ""); - const auto ba9 = *me.Natural(1).Col("bar", 11_u32, 33_u64, nullptr); + const auto foo = *me.SchemedCookRow(1).Col("foo", nullptr, 33_u64); + const auto cap = *me.SchemedCookRow(1).Col("cap", TOmit{ }, 33_u64); + const auto bar = *me.SchemedCookRow(1).Col("bar", 11_u32, 33_u64, "me", "you"); + const auto ba8 = *me.SchemedCookRow(1).Col("bar", 11_u32, 33_u64, ""); + const auto ba9 = *me.SchemedCookRow(1).Col("bar", 11_u32, 33_u64, nullptr); me.To(13).Put(1, foo, cap, bar).Commit(); me.Iter(1) @@ -180,10 +180,10 @@ Y_UNIT_TEST_SUITE(DBase) { me.To(10).Begin().Apply(*MakeAlter().Flush()).Commit(); - const auto ro1 = *me.Natural(1).Col("row1", 11_u64, "foo"); - const auto ro2 = *me.Natural(1).Col("row2", 22_u64, "bar"); - const auto ro3 = *me.Natural(1).Col("row3", 33_u64, "foo"); - const auto ro4 = *me.Natural(1).Col("row4", 44_u64, "bar"); + const auto ro1 = *me.SchemedCookRow(1).Col("row1", 11_u64, "foo"); + const auto ro2 = *me.SchemedCookRow(1).Col("row2", 22_u64, "bar"); + const auto ro3 = *me.SchemedCookRow(1).Col("row3", 33_u64, "foo"); + const auto ro4 = *me.SchemedCookRow(1).Col("row4", 44_u64, "bar"); me.Begin().Put(1, ro1, ro2).Commit().Snap(1).Compact(1, false); me.Begin().Put(1, ro3, ro4).Commit().Snap(1).Compact(1, false); @@ -223,10 +223,10 @@ Y_UNIT_TEST_SUITE(DBase) { me.To(10).Begin().Apply(*MakeAlter().Flush()).Commit(); - const auto ro1 = *me.Natural(1).Col("foo", 11_u64, "boo"); - const auto ro2 = *me.Natural(1).Col("foo", 22_u64); - const auto ro3 = *me.Natural(1).Col("foo"); - const auto ro4 = *me.Natural(1).Col("foo", 99_u64); + const auto ro1 = *me.SchemedCookRow(1).Col("foo", 11_u64, "boo"); + const auto ro2 = *me.SchemedCookRow(1).Col("foo", 22_u64); + const auto ro3 = *me.SchemedCookRow(1).Col("foo"); + const auto ro4 = *me.SchemedCookRow(1).Col("foo", 99_u64); /*_ 10: Cut columns from table updating reduced row each time */ @@ -287,7 +287,7 @@ Y_UNIT_TEST_SUITE(DBase) { me.To(10).Begin().Apply(*MakeAlter(2)).Commit(); - const auto row = *me.Natural(2).Col("foo", 11_u64, "bar"); + const auto row = *me.SchemedCookRow(2).Col("foo", 11_u64, "bar"); /*_ 10: Basic affects on one table modification */ @@ -364,12 +364,12 @@ Y_UNIT_TEST_SUITE(DBase) { const TString large42("0123456789abcdef0123456789abcdef0123456789"); const TString large44("0123456789abcdef0123456789abcdef0123456789ab"); - const auto foo = *me.Natural(1).Col("foo", 77_u64, "foo"); - const auto ro30 = *me.Natural(1).Col("l30", 30_u64, large30); - const auto ro35 = *me.Natural(1).Col("l35", 35_u64, large35); - const auto ro42 = *me.Natural(1).Col("l42", 42_u64, large42); - const auto ro44 = *me.Natural(1).Col("l44", 44_u64, large44); - const auto zap = *me.Natural(1).Col("zap", 55_u64, "zap"); + const auto foo = *me.SchemedCookRow(1).Col("foo", 77_u64, "foo"); + const auto ro30 = *me.SchemedCookRow(1).Col("l30", 30_u64, large30); + const auto ro35 = *me.SchemedCookRow(1).Col("l35", 35_u64, large35); + const auto ro42 = *me.SchemedCookRow(1).Col("l42", 42_u64, large42); + const auto ro44 = *me.SchemedCookRow(1).Col("l44", 44_u64, large44); + const auto zap = *me.SchemedCookRow(1).Col("zap", 55_u64, "zap"); /*_ 10: Regular write without producing annex to redo log */ @@ -450,9 +450,9 @@ Y_UNIT_TEST_SUITE(DBase) { const TString small17("0123456789abcdef0"); const TString small21("0123456789abcdef01234"); - const auto foo = *me.Natural(1).Col("foo", 77_u64, "foo"); - const auto ro17 = *me.Natural(1).Col("s17", 17_u64, small17); - const auto ro21 = *me.Natural(1).Col("s21", 21_u64, small21); + const auto foo = *me.SchemedCookRow(1).Col("foo", 77_u64, "foo"); + const auto ro17 = *me.SchemedCookRow(1).Col("s17", 17_u64, small17); + const auto ro21 = *me.SchemedCookRow(1).Col("s21", 21_u64, small21); /*_ 10: Prepare two parts with attached outer blobs */ @@ -494,13 +494,13 @@ Y_UNIT_TEST_SUITE(DBase) { me.To(10).Begin().Apply(*MakeAlter().Flush()).Commit(); - const auto nil = *me.Natural(1).Col(nullptr); - const auto foo = *me.Natural(1).Col("foo", 33_u64); - const auto bar = *me.Natural(1).Col("bar", 11_u64); - const auto ba1 = *me.Natural(1).Col("bar", ECellOp::Empty, "yo"); - const auto ba2 = *me.Natural(1).Col("bar", ECellOp::Reset, "me"); - const auto ba3 = *me.Natural(1).Col("bar", 99_u64, ECellOp::Reset); - const auto ba4 = *me.Natural(1).Col("bar", ECellOp::Null, "eh"); + const auto nil = *me.SchemedCookRow(1).Col(nullptr); + const auto foo = *me.SchemedCookRow(1).Col("foo", 33_u64); + const auto bar = *me.SchemedCookRow(1).Col("bar", 11_u64); + const auto ba1 = *me.SchemedCookRow(1).Col("bar", ECellOp::Empty, "yo"); + const auto ba2 = *me.SchemedCookRow(1).Col("bar", ECellOp::Reset, "me"); + const auto ba3 = *me.SchemedCookRow(1).Col("bar", 99_u64, ECellOp::Reset); + const auto ba4 = *me.SchemedCookRow(1).Col("bar", ECellOp::Null, "eh"); me.To(11).Iter(1).NoKey(foo).NoKey(bar); @@ -601,17 +601,17 @@ Y_UNIT_TEST_SUITE(DBase) { // Add a "null" key with a 0/40 version, for a better code coverage in // the version iteration cases, so compaction would actually try // descending below 1/50 and won't bail out. - me.To(15).Begin().WriteVer({0, 40}).Put(table, *me.Natural(table).Col(nullptr)).Commit(); + me.To(15).Begin().WriteVer({0, 40}).Put(table, *me.SchemedCookRow(table).Col(nullptr)).Commit(); // Create 1000 rows with 3 consecutive versions each, filling different columns me.To(20).Begin(); for (ui64 i = 1000; i < 2000; ++i) { // Version 1/50, keys added, but all columns are empty (default) - me.WriteVer({1, 50}).Put(table, *me.Natural(table).Col(i, ECellOp::Empty, ECellOp::Empty)); + me.WriteVer({1, 50}).Put(table, *me.SchemedCookRow(table).Col(i, ECellOp::Empty, ECellOp::Empty)); // Version 2/60, keys updated with arg1=i - me.WriteVer({2, 60}).Put(table, *me.Natural(table).Col(i, i, ECellOp::Empty)); + me.WriteVer({2, 60}).Put(table, *me.SchemedCookRow(table).Col(i, i, ECellOp::Empty)); // Version 3/70, keys updated with arg2=3000-i - me.WriteVer({3, 70}).Put(table, *me.Natural(table).Col(i, ECellOp::Empty, 3000-i)); + me.WriteVer({3, 70}).Put(table, *me.SchemedCookRow(table).Col(i, ECellOp::Empty, 3000-i)); } me.Commit().Snap(table); if (compactMemTables) { @@ -621,7 +621,7 @@ Y_UNIT_TEST_SUITE(DBase) { // Create 1000 more rows using different memtables me.To(22).Begin(); for (ui64 i = 2000; i < 3000; ++i) { - me.WriteVer({1, 50}).Put(table, *me.Natural(table).Col(i, ECellOp::Empty, ECellOp::Empty)); + me.WriteVer({1, 50}).Put(table, *me.SchemedCookRow(table).Col(i, ECellOp::Empty, ECellOp::Empty)); } me.Commit().Snap(table); if (compactMemTables) { @@ -630,7 +630,7 @@ Y_UNIT_TEST_SUITE(DBase) { me.To(23).Begin(); for (ui64 i = 2000; i < 3000; ++i) { - me.WriteVer({2, 60}).Put(table, *me.Natural(table).Col(i, i, ECellOp::Empty)); + me.WriteVer({2, 60}).Put(table, *me.SchemedCookRow(table).Col(i, i, ECellOp::Empty)); } me.Commit().Snap(table); if (compactMemTables) { @@ -639,7 +639,7 @@ Y_UNIT_TEST_SUITE(DBase) { me.To(24).Begin(); for (ui64 i = 2000; i < 3000; ++i) { - me.WriteVer({3, 70}).Put(table, *me.Natural(table).Col(i, ECellOp::Empty, 3000-i)); + me.WriteVer({3, 70}).Put(table, *me.SchemedCookRow(table).Col(i, ECellOp::Empty, 3000-i)); } me.Commit().Snap(table); if (compactMemTables) { @@ -655,8 +655,8 @@ Y_UNIT_TEST_SUITE(DBase) { me.To(30); for (ui64 i = 1000; i < 3000; ++i) { // No key before 1/50 - me.ReadVer({1, 49}).Select(table).NoKey(*me.Natural(table).Col(i)); - me.ReadVer({1, 49}).Iter(table).NoKey(*me.Natural(table).Col(i)); + me.ReadVer({1, 49}).Select(table).NoKey(*me.SchemedCookRow(table).Col(i)); + me.ReadVer({1, 49}).Iter(table).NoKey(*me.SchemedCookRow(table).Col(i)); // Key with default values until 2/60 me.ReadVer({2, 59}).Select(table).HasN(i, 10004_u64, 10005_u64); me.ReadVer({2, 59}).Iter(table).HasN(i, 10004_u64, 10005_u64); @@ -674,15 +674,15 @@ Y_UNIT_TEST_SUITE(DBase) { // Verify iteration before 1/50 me.To(32).ReadVer({1, 49}).Iter(table, false) - .Seek({ }, ESeek::Lower).Is(*me.Natural(table).Col(nullptr, 10004_u64, 10005_u64)) + .Seek({ }, ESeek::Lower).Is(*me.SchemedCookRow(table).Col(nullptr, 10004_u64, 10005_u64)) .Next().Is(EReady::Gone); // Verify iteration before 2/60 { auto checker = me.To(33).ReadVer({2, 59}).Iter(table, false) - .Seek({ }, ESeek::Lower).Is(*me.Natural(table).Col(nullptr, 10004_u64, 10005_u64)); + .Seek({ }, ESeek::Lower).Is(*me.SchemedCookRow(table).Col(nullptr, 10004_u64, 10005_u64)); for (ui64 i = 1000; i < 3000; ++i) { - checker.Next().Is(*me.Natural(table).Col(i, 10004_u64, 10005_u64)); + checker.Next().Is(*me.SchemedCookRow(table).Col(i, 10004_u64, 10005_u64)); } checker.Next().Is(EReady::Gone); } @@ -690,9 +690,9 @@ Y_UNIT_TEST_SUITE(DBase) { // Verify iteration before 3/70 { auto checker = me.To(34).ReadVer({3, 69}).Iter(table, false) - .Seek({ }, ESeek::Lower).Is(*me.Natural(table).Col(nullptr, 10004_u64, 10005_u64)); + .Seek({ }, ESeek::Lower).Is(*me.SchemedCookRow(table).Col(nullptr, 10004_u64, 10005_u64)); for (ui64 i = 1000; i < 3000; ++i) { - checker.Next().Is(*me.Natural(table).Col(i, i, 10005_u64)); + checker.Next().Is(*me.SchemedCookRow(table).Col(i, i, 10005_u64)); } checker.Next().Is(EReady::Gone); } @@ -700,9 +700,9 @@ Y_UNIT_TEST_SUITE(DBase) { // Verify iteration at 3/70 { auto checker = me.To(35).ReadVer({3, 70}).Iter(table, false) - .Seek({ }, ESeek::Lower).Is(*me.Natural(table).Col(nullptr, 10004_u64, 10005_u64)); + .Seek({ }, ESeek::Lower).Is(*me.SchemedCookRow(table).Col(nullptr, 10004_u64, 10005_u64)); for (ui64 i = 1000; i < 3000; ++i) { - checker.Next().Is(*me.Natural(table).Col(i, i, 3000-i)); + checker.Next().Is(*me.SchemedCookRow(table).Col(i, i, 3000-i)); } checker.Next().Is(EReady::Gone); } @@ -710,9 +710,9 @@ Y_UNIT_TEST_SUITE(DBase) { // Verify iteration at HEAD { auto checker = me.To(36).ReadVer(TRowVersion::Max()).Iter(table, false) - .Seek({ }, ESeek::Lower).Is(*me.Natural(table).Col(nullptr, 10004_u64, 10005_u64)); + .Seek({ }, ESeek::Lower).Is(*me.SchemedCookRow(table).Col(nullptr, 10004_u64, 10005_u64)); for (ui64 i = 1000; i < 3000; ++i) { - checker.Next().Is(*me.Natural(table).Col(i, i, 3000-i)); + checker.Next().Is(*me.SchemedCookRow(table).Col(i, i, 3000-i)); } checker.Next().Is(EReady::Gone); } diff --git a/ydb/core/tablet_flat/ut/ut_memtable.cpp b/ydb/core/tablet_flat/ut/ut_memtable.cpp index d5b6c328648..ed0e0bddccd 100644 --- a/ydb/core/tablet_flat/ut/ut_memtable.cpp +++ b/ydb/core/tablet_flat/ut/ut_memtable.cpp @@ -40,14 +40,14 @@ Y_UNIT_TEST_SUITE(Memtable) /* Test copied from TPart::Basics with except of iteration */ - const auto foo = *TNatural(*lay).Col(555_u32, "foo", 3.14, nullptr); - const auto bar = *TNatural(*lay).Col(777_u32, "bar", 2.72, true); + const auto foo = *TSchemedCookRow(*lay).Col(555_u32, "foo", 3.14, nullptr); + const auto bar = *TSchemedCookRow(*lay).Col(777_u32, "bar", 2.72, true); TCheckIt wrap(TCooker(lay).Add(foo).Add(bar).Unwrap(), { }); wrap.To(10).Has(foo).Has(bar); - wrap.To(11).NoVal(*TNatural(*lay).Col(555_u32, "foo", 10.)); - wrap.To(12).NoKey(*TNatural(*lay).Col(888_u32, "foo", 3.14)); + wrap.To(11).NoVal(*TSchemedCookRow(*lay).Col(555_u32, "foo", 10.)); + wrap.To(12).NoKey(*TSchemedCookRow(*lay).Col(888_u32, "foo", 3.14)); /*_ Basic lower and upper bounds lookup semantic */ @@ -64,8 +64,8 @@ Y_UNIT_TEST_SUITE(Memtable) /* ... but incomplete keys are padded with +inf instead of nulls on lookup. Check that it really happens for Seek()'s */ - wrap.To(33).Seek(*TNatural(*lay).Col(555_u32), ESeek::Lower).Is(bar); - wrap.To(34).Seek(*TNatural(*lay).Col(555_u32), ESeek::Upper).Is(bar); + wrap.To(33).Seek(*TSchemedCookRow(*lay).Col(555_u32), ESeek::Lower).Is(bar); + wrap.To(34).Seek(*TSchemedCookRow(*lay).Col(555_u32), ESeek::Upper).Is(bar); /*_ Basic iteration over two rows in tables */ @@ -79,14 +79,14 @@ Y_UNIT_TEST_SUITE(Memtable) /* Test copied from TPart::Basics with except of iteration */ - const auto foo = *TNatural(*lay).Col(555_u32, "foo", 3.14, nullptr); - const auto bar = *TNatural(*lay).Col(777_u32, "bar", 2.72, true); + const auto foo = *TSchemedCookRow(*lay).Col(555_u32, "foo", 3.14, nullptr); + const auto bar = *TSchemedCookRow(*lay).Col(777_u32, "bar", 2.72, true); TCheckReverseIt wrap(TCooker(lay).Add(foo).Add(bar).Unwrap(), { }); wrap.To(10).Has(foo).Has(bar); - wrap.To(11).NoVal(*TNatural(*lay).Col(555_u32, "foo", 10.)); - wrap.To(12).NoKey(*TNatural(*lay).Col(888_u32, "foo", 3.14)); + wrap.To(11).NoVal(*TSchemedCookRow(*lay).Col(555_u32, "foo", 10.)); + wrap.To(12).NoKey(*TSchemedCookRow(*lay).Col(888_u32, "foo", 3.14)); /*_ Basic lower and upper bounds lookup semantic */ @@ -104,8 +104,8 @@ Y_UNIT_TEST_SUITE(Memtable) /* ... but incomplete keys are padded with +inf instead of nulls on lookup. Check that it really happens for Seek()'s */ - wrap.To(33).Seek(*TNatural(*lay).Col(555_u32), ESeek::Lower).Is(foo); - wrap.To(34).Seek(*TNatural(*lay).Col(555_u32), ESeek::Upper).Is(foo); + wrap.To(33).Seek(*TSchemedCookRow(*lay).Col(555_u32), ESeek::Lower).Is(foo); + wrap.To(34).Seek(*TSchemedCookRow(*lay).Col(555_u32), ESeek::Upper).Is(foo); /*_ Basic iteration over two rows in tables */ @@ -117,8 +117,8 @@ Y_UNIT_TEST_SUITE(Memtable) { const auto lay = BasicRowLayout(); - auto reset = *TNatural(*lay).Col(555_u32, "foo", ECellOp::Reset); - auto null = *TNatural(*lay).Col(556_u32, "foo", ECellOp::Null); + auto reset = *TSchemedCookRow(*lay).Col(555_u32, "foo", ECellOp::Reset); + auto null = *TSchemedCookRow(*lay).Col(556_u32, "foo", ECellOp::Null); TCooker cooker(lay); @@ -130,13 +130,13 @@ Y_UNIT_TEST_SUITE(Memtable) { const auto lay = BasicRowLayout(); - auto r0W = *TNatural(*lay).Col(555_u32, "foo", 3.14, nullptr); - auto r1W = *TNatural(*lay).Col(555_u32, "foo", nullptr, false); - auto r2W = *TNatural(*lay).Col(555_u32, "foo", 2.72); - auto r2R = *TNatural(*lay).Col(555_u32, "foo", 2.72, false); - auto r3W = *TNatural(*lay).Col(555_u32, "foo", nullptr, true); - auto r4W = *TNatural(*lay).Col(555_u32, "foo", ECellOp::Reset); - auto r4R = *TNatural(*lay).Col(555_u32, "foo", 3.14, true); + auto r0W = *TSchemedCookRow(*lay).Col(555_u32, "foo", 3.14, nullptr); + auto r1W = *TSchemedCookRow(*lay).Col(555_u32, "foo", nullptr, false); + auto r2W = *TSchemedCookRow(*lay).Col(555_u32, "foo", 2.72); + auto r2R = *TSchemedCookRow(*lay).Col(555_u32, "foo", 2.72, false); + auto r3W = *TSchemedCookRow(*lay).Col(555_u32, "foo", nullptr, true); + auto r4W = *TSchemedCookRow(*lay).Col(555_u32, "foo", ECellOp::Reset); + auto r4R = *TSchemedCookRow(*lay).Col(555_u32, "foo", 3.14, true); TCooker cooker(lay); diff --git a/ydb/core/tablet_flat/ut/ut_other.cpp b/ydb/core/tablet_flat/ut/ut_other.cpp index ea1c287283e..9cb6ca02c54 100644 --- a/ydb/core/tablet_flat/ut/ut_other.cpp +++ b/ydb/core/tablet_flat/ut/ut_other.cpp @@ -14,7 +14,7 @@ Y_UNIT_TEST_SUITE(NOther) { { NWriter::TConf conf; - conf.Groups[0].Block = 128; /* Page collection blob size */ + conf.Groups[0].MaxBlobSize = 128; /* Page collection blob size */ conf.Slots = { { 1, 11 }, { 3, 13 }, { 5, 17 } }; conf.Groups[0].Channel = 3; /* Put data to channel 3 grp 13 */ conf.BlobsChannel = 5; /* Put blobs to channel 5 grp 17 */ diff --git a/ydb/core/tablet_flat/ut/ut_pages.cpp b/ydb/core/tablet_flat/ut/ut_pages.cpp index abe9e719057..4328c0ea9fd 100644 --- a/ydb/core/tablet_flat/ut/ut_pages.cpp +++ b/ydb/core/tablet_flat/ut/ut_pages.cpp @@ -35,8 +35,8 @@ Y_UNIT_TEST_SUITE(NPage) { .Col(0, 1, NScheme::NTypeIds::String) .Key({ 0 }); - const auto foo = *TNatural(*lay).Col(555_u32, "foo"); - const auto bar = *TNatural(*lay).Col(777_u32, "bar"); + const TRow foo = *TSchemedCookRow(*lay).Col(555_u32, "foo"); + const TRow bar = *TSchemedCookRow(*lay).Col(777_u32, "bar"); NPage::TConf conf{ true, 2 * 1024 }; diff --git a/ydb/core/tablet_flat/ut/ut_part.cpp b/ydb/core/tablet_flat/ut/ut_part.cpp index e046b861d26..e9cdf756b58 100644 --- a/ydb/core/tablet_flat/ut/ut_part.cpp +++ b/ydb/core/tablet_flat/ut/ut_part.cpp @@ -101,14 +101,14 @@ Y_UNIT_TEST_SUITE(TPart) { .Col(0, 3, NScheme::NTypeIds::Bool) .Key({0, 1}); - const auto foo = *TNatural(*lay).Col(555_u32, "foo", 3.14, nullptr); - const auto bar = *TNatural(*lay).Col(777_u32, "bar", 2.72, true); + const auto foo = *TSchemedCookRow(*lay).Col(555_u32, "foo", 3.14, nullptr); + const auto bar = *TSchemedCookRow(*lay).Col(777_u32, "bar", 2.72, true); TCheckIt wrap(TPartCook(lay, { }).Add(foo).Add(bar).Finish(), { }); wrap.To(10).Has(foo).Has(bar); - wrap.To(11).NoVal(*TNatural(*lay).Col(555_u32, "foo", 10.)); - wrap.To(12).NoKey(*TNatural(*lay).Col(888_u32, "foo", 3.14)); + wrap.To(11).NoVal(*TSchemedCookRow(*lay).Col(555_u32, "foo", 10.)); + wrap.To(12).NoKey(*TSchemedCookRow(*lay).Col(888_u32, "foo", 3.14)); /*_ Basic lower and upper bounds lookup semantic */ @@ -125,8 +125,8 @@ Y_UNIT_TEST_SUITE(TPart) { /* ... but incomplete keys are padded with +inf instead of nulls on lookup. Check that it really happens for Seek()'s */ - wrap.To(33).Seek(*TNatural(*lay).Col(555_u32), ESeek::Lower).Is(bar); - wrap.To(34).Seek(*TNatural(*lay).Col(555_u32), ESeek::Upper).Is(bar); + wrap.To(33).Seek(*TSchemedCookRow(*lay).Col(555_u32), ESeek::Lower).Is(bar); + wrap.To(34).Seek(*TSchemedCookRow(*lay).Col(555_u32), ESeek::Upper).Is(bar); /* Verify part has correct first and last key in the index */ @@ -152,8 +152,8 @@ Y_UNIT_TEST_SUITE(TPart) { .Col(2, 3, NScheme::NTypeIds::Bool) .Key({ 0 }); - const auto foo = *TNatural(*lay).Col(555_u32, "foo", 3.14, nullptr); - const auto bar = *TNatural(*lay).Col(777_u32, "bar", 2.72, true); + const auto foo = *TSchemedCookRow(*lay).Col(555_u32, "foo", 3.14, nullptr); + const auto bar = *TSchemedCookRow(*lay).Col(777_u32, "bar", 2.72, true); auto eggs = TPartCook(lay, PageConf(/* groups = */ 3)).Add(foo).Add(bar).Finish(); auto part = eggs.Lone(); @@ -193,14 +193,14 @@ Y_UNIT_TEST_SUITE(TPart) { TCheckIt wrap(std::move(eggs), { }); - auto trA = *TNatural(*fake).Col(10_u64, 3_u32, 7_u32, 77_u32); - auto trB = *TNatural(*fake).Col(12_u64, 3_u32, 7_u32, 44_u32); - auto trC = *TNatural(*fake).Col(17_u64, 3_u32, 7_u32, nullptr); - auto trD = *TNatural(*fake).Col(19_u64, 3_u32, 7_u32, 99_u32); + auto trA = *TSchemedCookRow(*fake).Col(10_u64, 3_u32, 7_u32, 77_u32); + auto trB = *TSchemedCookRow(*fake).Col(12_u64, 3_u32, 7_u32, 44_u32); + auto trC = *TSchemedCookRow(*fake).Col(17_u64, 3_u32, 7_u32, nullptr); + auto trD = *TSchemedCookRow(*fake).Col(19_u64, 3_u32, 7_u32, 99_u32); - auto low = *TNatural(*fake).Col(10_u64, 2_u32, 2_u32); - auto mid = *TNatural(*fake).Col(10_u64, 3_u32, 5_u32); - auto upp = *TNatural(*fake).Col(10_u64, 3_u32, 8_u32); + auto low = *TSchemedCookRow(*fake).Col(10_u64, 2_u32, 2_u32); + auto mid = *TSchemedCookRow(*fake).Col(10_u64, 3_u32, 5_u32); + auto upp = *TSchemedCookRow(*fake).Col(10_u64, 3_u32, 8_u32); wrap.To(10).Has(trA); /* default values in key */ wrap.To(11).Has(trB); /* default values in key */ @@ -224,7 +224,7 @@ Y_UNIT_TEST_SUITE(TPart) { lay.Col(0, 0, ETypes::Uint32).Col(0, 1, ETypes::String).Key({ 0 }); - const auto foo = *TNatural(*lay).Col(7_u32, TString(128, 'x')); + const auto foo = *TSchemedCookRow(*lay).Col(7_u32, TString(128, 'x')); TCheckIt wrap(TPartCook(lay, { true, 99, 32 }).Add(foo).Finish(), { }); @@ -262,7 +262,7 @@ Y_UNIT_TEST_SUITE(TPart) { { /*_ Check marker of absent external blob in TCell */ wrap.Displace<IPages>(new TNoEnv{ true, ELargeObjNeed::No }); - auto marked = *TNatural(*lay).Col(7_u32, glob); + auto marked = *TSchemedCookRow(*lay).Col(7_u32, glob); wrap.To(16).Seek(foo, ESeek::Exact).Is(marked); } @@ -279,7 +279,7 @@ Y_UNIT_TEST_SUITE(TPart) { TPartCook cook(lay, { }); const auto glob = cook.PutBlob(TString(128, 'x'), 0); - const auto foo = *TNatural(*lay).Col(7_u32, glob); + const auto foo = *TSchemedCookRow(*lay).Col(7_u32, glob); TCheckIt wrap(cook.Add(foo).Finish(), { }); @@ -307,8 +307,8 @@ Y_UNIT_TEST_SUITE(TPart) { TPartCook cook(lay, PageConf()); - const auto foo = *TNatural(*lay).Col(7_u32, TString(24, 'x')); - const auto bar = *TNatural(*lay).Col(8_u32, TString(10, 'x')); + const auto foo = *TSchemedCookRow(*lay).Col(7_u32, TString(24, 'x')); + const auto bar = *TSchemedCookRow(*lay).Col(8_u32, TString(10, 'x')); TCheckIt wrap(cook.Add(foo).Add(bar).Finish(), { }); @@ -432,13 +432,13 @@ Y_UNIT_TEST_SUITE(TPart) { .Col(2, 3, NScheme::NTypeIds::Bool) .Key({ 0 }); - const auto hey = *TNatural(*lay).Col(333_u32, "hey", 0.25, true); - const auto foo = *TNatural(*lay).Col(555_u32); - const auto foo1 = *TNatural(*lay).Col(555_u32, "foo1", 3.14, nullptr); - const auto foo2 = *TNatural(*lay).Col(555_u32, "foo2", 4.25, false); - const auto foo3 = *TNatural(*lay).Col(555_u32, "foo3", 7.75, true); - const auto bar = *TNatural(*lay).Col(777_u32, "bar", 2.72, true); - const auto baz = *TNatural(*lay).Col(999_u32, "baz", 0.0, false); + const auto hey = *TSchemedCookRow(*lay).Col(333_u32, "hey", 0.25, true); + const auto foo = *TSchemedCookRow(*lay).Col(555_u32); + const auto foo1 = *TSchemedCookRow(*lay).Col(555_u32, "foo1", 3.14, nullptr); + const auto foo2 = *TSchemedCookRow(*lay).Col(555_u32, "foo2", 4.25, false); + const auto foo3 = *TSchemedCookRow(*lay).Col(555_u32, "foo3", 7.75, true); + const auto bar = *TSchemedCookRow(*lay).Col(777_u32, "bar", 2.72, true); + const auto baz = *TSchemedCookRow(*lay).Col(999_u32, "baz", 0.0, false); auto conf = PageConf(/* groups = */ 3); conf.MinRowVersion = TRowVersion(0, 50); @@ -516,8 +516,8 @@ Y_UNIT_TEST_SUITE(TPart) { .Col(2, 3, NScheme::NTypeIds::Bool) .Key({ 0 }); - const auto foo = *TNatural(*lay).Col(555_u32); - const auto bar = *TNatural(*lay).Col(777_u32); + const auto foo = *TSchemedCookRow(*lay).Col(555_u32); + const auto bar = *TSchemedCookRow(*lay).Col(777_u32); auto conf = PageConf(/* groups = */ 3); auto cook = TPartCook(lay, conf); @@ -527,7 +527,7 @@ Y_UNIT_TEST_SUITE(TPart) { for (int i = 0; i <= 1000; ++i) { TString s = TStringBuilder() << "foo_xxxxxxxxxxxxxxxx" << i; foov.emplace_back(1, 1000-i); - foos.emplace_back(*TNatural(*lay).Col(555_u32, s.c_str(), i * 0.1, nullptr)); + foos.emplace_back(*TSchemedCookRow(*lay).Col(555_u32, s.c_str(), i * 0.1, nullptr)); cook.Ver(foov.back()).Add(foos.back()); } @@ -536,12 +536,12 @@ Y_UNIT_TEST_SUITE(TPart) { for (int i = 0; i <= 1000; ++i) { TString s = TStringBuilder() << "bar_xxxxxxxxxxxxxxxx" << i; barv.emplace_back(2, 1000-i); - bars.emplace_back(*TNatural(*lay).Col(777_u32, s.c_str(), i * 0.2, i % 2 == 0)); + bars.emplace_back(*TSchemedCookRow(*lay).Col(777_u32, s.c_str(), i * 0.2, i % 2 == 0)); cook.Ver(barv.back()).Add(bars.back()); } // This row lowers min version, so we can trigger necessary search paths - const auto baz = *TNatural(*lay).Col(999_u32, "baz", 0.42, true); + const auto baz = *TSchemedCookRow(*lay).Col(999_u32, "baz", 0.42, true); cook.Ver({0, 42}).Add(baz); auto eggs = cook.Finish(); @@ -583,8 +583,8 @@ Y_UNIT_TEST_SUITE(TPart) { auto conf = PageConf(); auto cook = TPartCook(lay, conf); - const auto foo = *TNatural(*lay).Col(555_u32); - const auto bar = *TNatural(*lay).Col(777_u32); + const auto foo = *TSchemedCookRow(*lay).Col(555_u32); + const auto bar = *TSchemedCookRow(*lay).Col(777_u32); for (int i = 1; i <= 1000; ++i) { TTag tag = 1 + (i - 1) % 3; diff --git a/ydb/core/tablet_flat/ut/ut_part_multi.cpp b/ydb/core/tablet_flat/ut/ut_part_multi.cpp index cdc6714a55f..9167ed5b04a 100644 --- a/ydb/core/tablet_flat/ut/ut_part_multi.cpp +++ b/ydb/core/tablet_flat/ut/ut_part_multi.cpp @@ -26,10 +26,10 @@ Y_UNIT_TEST_SUITE(TPartMulti) { .Col(0, 3, NScheme::NTypeIds::Bool) .Key({0, 1}); - const auto foo = *TNatural(*lay).Col(555_u32, "foo", 3.14, nullptr); - const auto bar = *TNatural(*lay).Col(777_u32, "bar", 2.72, true); - const auto baz = *TNatural(*lay).Col(888_u32, "baz", 5.42, false); - const auto zzz = *TNatural(*lay).Col(999_u32, "zzz", 4.11, false); + const auto foo = *TSchemedCookRow(*lay).Col(555_u32, "foo", 3.14, nullptr); + const auto bar = *TSchemedCookRow(*lay).Col(777_u32, "bar", 2.72, true); + const auto baz = *TSchemedCookRow(*lay).Col(888_u32, "baz", 5.42, false); + const auto zzz = *TSchemedCookRow(*lay).Col(999_u32, "zzz", 4.11, false); NTest::TPartEggs eggs = { nullptr, @@ -43,8 +43,8 @@ Y_UNIT_TEST_SUITE(TPartMulti) { TCheckIt wrap(eggs, { }); wrap.To(10).Has(foo).Has(bar); - wrap.To(11).NoVal(*TNatural(*lay).Col(555_u32, "foo", 10.)); - wrap.To(12).NoKey(*TNatural(*lay).Col(888_u32, "foo", 3.14)); + wrap.To(11).NoVal(*TSchemedCookRow(*lay).Col(555_u32, "foo", 10.)); + wrap.To(12).NoKey(*TSchemedCookRow(*lay).Col(888_u32, "foo", 3.14)); /*_ Basic lower and upper bounds lookup semantic */ @@ -66,21 +66,21 @@ Y_UNIT_TEST_SUITE(TPartMulti) { /* ... but incomplete keys are padded with +inf instead of nulls on lookup. Check that it really happens for Seek()'s */ - wrap.To(33).Seek(*TNatural(*lay).Col(555_u32), ESeek::Lower).Is(bar); - wrap.To(34).Seek(*TNatural(*lay).Col(555_u32), ESeek::Upper).Is(bar); - wrap.To(35).Seek(*TNatural(*lay).Col(777_u32), ESeek::Lower).Is(baz); - wrap.To(36).Seek(*TNatural(*lay).Col(777_u32), ESeek::Upper).Is(baz); + wrap.To(33).Seek(*TSchemedCookRow(*lay).Col(555_u32), ESeek::Lower).Is(bar); + wrap.To(34).Seek(*TSchemedCookRow(*lay).Col(555_u32), ESeek::Upper).Is(bar); + wrap.To(35).Seek(*TSchemedCookRow(*lay).Col(777_u32), ESeek::Lower).Is(baz); + wrap.To(36).Seek(*TSchemedCookRow(*lay).Col(777_u32), ESeek::Upper).Is(baz); /*_ Next should move to the next part correctly */ - wrap.To(40).Seek(*TNatural(*lay).Col(777_u32, "aaa"), ESeek::Lower).Is(bar) + wrap.To(40).Seek(*TSchemedCookRow(*lay).Col(777_u32, "aaa"), ESeek::Lower).Is(bar) .To(41).Next().Is(baz) .To(42).Next().Is(zzz) .To(43).Next().Is(EReady::Gone); /*_ Next must not be confused by a failed exact seek */ - wrap.To(50).Seek(*TNatural(*lay).Col(777_u32, "aaa"), ESeek::Exact).Is(EReady::Gone) + wrap.To(50).Seek(*TSchemedCookRow(*lay).Col(777_u32, "aaa"), ESeek::Exact).Is(EReady::Gone) .To(51).Next().Is(EReady::Gone); } @@ -95,10 +95,10 @@ Y_UNIT_TEST_SUITE(TPartMulti) { .Col(0, 3, NScheme::NTypeIds::Bool) .Key({0, 1}); - const auto foo = *TNatural(*lay).Col(555_u32, "foo", 3.14, nullptr); - const auto bar = *TNatural(*lay).Col(777_u32, "bar", 2.72, true); - const auto baz = *TNatural(*lay).Col(888_u32, "baz", 5.42, false); - const auto zzz = *TNatural(*lay).Col(999_u32, "zzz", 4.11, false); + const auto foo = *TSchemedCookRow(*lay).Col(555_u32, "foo", 3.14, nullptr); + const auto bar = *TSchemedCookRow(*lay).Col(777_u32, "bar", 2.72, true); + const auto baz = *TSchemedCookRow(*lay).Col(888_u32, "baz", 5.42, false); + const auto zzz = *TSchemedCookRow(*lay).Col(999_u32, "zzz", 4.11, false); NTest::TPartEggs eggs = { nullptr, @@ -112,8 +112,8 @@ Y_UNIT_TEST_SUITE(TPartMulti) { TCheckReverseIt wrap(eggs, { }); wrap.To(10).Has(foo).Has(bar); - wrap.To(11).NoVal(*TNatural(*lay).Col(555_u32, "foo", 10.)); - wrap.To(12).NoKey(*TNatural(*lay).Col(888_u32, "foo", 3.14)); + wrap.To(11).NoVal(*TSchemedCookRow(*lay).Col(555_u32, "foo", 10.)); + wrap.To(12).NoKey(*TSchemedCookRow(*lay).Col(888_u32, "foo", 3.14)); /*_ Basic lower and upper bounds lookup semantic */ @@ -135,21 +135,21 @@ Y_UNIT_TEST_SUITE(TPartMulti) { /* ... but incomplete keys are padded with +inf instead of nulls on lookup. Check that it really happens for Seek()'s */ - wrap.To(33).Seek(*TNatural(*lay).Col(555_u32), ESeek::Lower).Is(foo); - wrap.To(34).Seek(*TNatural(*lay).Col(555_u32), ESeek::Upper).Is(foo); - wrap.To(35).Seek(*TNatural(*lay).Col(777_u32), ESeek::Lower).Is(bar); - wrap.To(36).Seek(*TNatural(*lay).Col(777_u32), ESeek::Upper).Is(bar); + wrap.To(33).Seek(*TSchemedCookRow(*lay).Col(555_u32), ESeek::Lower).Is(foo); + wrap.To(34).Seek(*TSchemedCookRow(*lay).Col(555_u32), ESeek::Upper).Is(foo); + wrap.To(35).Seek(*TSchemedCookRow(*lay).Col(777_u32), ESeek::Lower).Is(bar); + wrap.To(36).Seek(*TSchemedCookRow(*lay).Col(777_u32), ESeek::Upper).Is(bar); /*_ Prev should move to the previous part correctly */ - wrap.To(40).Seek(*TNatural(*lay).Col(999_u32, "aaa"), ESeek::Lower).Is(baz) + wrap.To(40).Seek(*TSchemedCookRow(*lay).Col(999_u32, "aaa"), ESeek::Lower).Is(baz) .To(41).Next().Is(bar) .To(42).Next().Is(foo) .To(43).Next().Is(EReady::Gone); /*_ Prev must not be confused by a failed exact seek */ - wrap.To(50).Seek(*TNatural(*lay).Col(777_u32, "aaa"), ESeek::Exact).Is(EReady::Gone) + wrap.To(50).Seek(*TSchemedCookRow(*lay).Col(777_u32, "aaa"), ESeek::Exact).Is(EReady::Gone) .To(51).Next().Is(EReady::Gone); } } diff --git a/ydb/core/tablet_flat/ut/ut_redo.cpp b/ydb/core/tablet_flat/ut/ut_redo.cpp index 73271b44036..95523535f04 100644 --- a/ydb/core/tablet_flat/ut/ut_redo.cpp +++ b/ydb/core/tablet_flat/ut/ut_redo.cpp @@ -26,8 +26,8 @@ Y_UNIT_TEST_SUITE(Redo) { .Col(0, 5, ETypes::String) .Key({ 1 }); - const auto foo = *TNatural(*lay).Col("foo", 33_u64); - const auto bar = *TNatural(*lay).Col("bar", 11_u64); + const auto foo = *TSchemedCookRow(*lay).Col("foo", 33_u64); + const auto bar = *TSchemedCookRow(*lay).Col("bar", 11_u64); const auto raw = NResource::Find("abi/008_basics_db.redo"); diff --git a/ydb/core/tablet_flat/ut/ut_self.cpp b/ydb/core/tablet_flat/ut/ut_self.cpp index 5cf8efb163c..116cec7796b 100644 --- a/ydb/core/tablet_flat/ut/ut_self.cpp +++ b/ydb/core/tablet_flat/ut/ut_self.cpp @@ -24,8 +24,8 @@ Y_UNIT_TEST_SUITE(Self) { .Key({0, 1}); auto put = *TPut().Do(0, "foo").Do<double>(2, 3.14).Do<ui32>(1, 42); - auto natTail = *TNatural(*lay).Col("foo", 42_u32, 3.14); - auto natNull = *TNatural(*lay).Col("foo", 42_u32, 3.14, nullptr); + auto natTail = *TSchemedCookRow(*lay).Col("foo", 42_u32, 3.14); + auto natNull = *TSchemedCookRow(*lay).Col("foo", 42_u32, 3.14, nullptr); /*_ Different binary rows representations should have the same textual output. Along with check that test rows wrappers |