Skip to content

Commit b623877

Browse files
committed
cr: fix grammar
1 parent 5be885a commit b623877

13 files changed

+81
-81
lines changed

ydb/core/tablet_flat/benchmark/b_part_index.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ namespace {
7070

7171
Cerr << "DataBytes = " << part->Stat.Bytes << " DataPages = " << IndexTools::CountMainPages(*part) << Endl;
7272
Cerr << "FlatIndexBytes = " << part->GetPageSize(part->IndexPages.Groups[groups ? 1 : 0], {}) << " BTreeIndexBytes = " << part->IndexPages.BTreeGroups[groups ? 1 : 0].IndexSize << Endl;
73-
Cerr << "Levels = " << part->IndexPages.BTreeGroups[groups ? 1 : 0].LevelsCount << Endl;
73+
Cerr << "Levels = " << part->IndexPages.BTreeGroups[groups ? 1 : 0].LevelCount << Endl;
7474

7575
// 100 MB
7676
UNIT_ASSERT_GE(part->Stat.Bytes, 100ull*1024*1024);

ydb/core/tablet_flat/flat_page_btree_index.h

+12-12
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ namespace NKikimr::NTable::NPage {
8585

8686
struct TShortChild {
8787
TPageId PageId;
88-
TRowId RowsCount;
88+
TRowId RowCount;
8989
ui64 DataSize;
9090

9191
auto operator<=>(const TShortChild&) const = default;
@@ -95,22 +95,22 @@ namespace NKikimr::NTable::NPage {
9595

9696
struct TChild {
9797
TPageId PageId;
98-
TRowId RowsCount;
98+
TRowId RowCount;
9999
ui64 DataSize;
100-
TRowId ErasedRowsCount;
100+
TRowId ErasedRowCount;
101101

102102
auto operator<=>(const TChild&) const = default;
103103

104104
TString ToString() const noexcept
105105
{
106-
return TStringBuilder() << "PageId: " << PageId << " RowsCount: " << RowsCount << " DataSize: " << DataSize << " ErasedRowsCount: " << ErasedRowsCount;
106+
return TStringBuilder() << "PageId: " << PageId << " RowCount: " << RowCount << " DataSize: " << DataSize << " ErasedRowCount: " << ErasedRowCount;
107107
}
108108
} Y_PACKED;
109109

110110
static_assert(sizeof(TChild) == 28, "Invalid TBtreeIndexNode TChild size");
111111

112112
static_assert(offsetof(TChild, PageId) == offsetof(TShortChild, PageId));
113-
static_assert(offsetof(TChild, RowsCount) == offsetof(TShortChild, RowsCount));
113+
static_assert(offsetof(TChild, RowCount) == offsetof(TShortChild, RowCount));
114114
static_assert(offsetof(TChild, DataSize) == offsetof(TShortChild, DataSize));
115115

116116
#pragma pack(pop)
@@ -306,7 +306,7 @@ namespace NKikimr::NTable::NPage {
306306
{
307307
if (Header->IsShortChildFormat) {
308308
const TShortChild* const shortChild = TDeref<const TShortChild>::At(Children, pos * sizeof(TShortChild));
309-
return { shortChild->PageId, shortChild->RowsCount, shortChild->DataSize, 0 };
309+
return { shortChild->PageId, shortChild->RowCount, shortChild->DataSize, 0 };
310310
} else {
311311
return *TDeref<const TChild>::At(Children, pos * sizeof(TChild));
312312
}
@@ -326,19 +326,19 @@ namespace NKikimr::NTable::NPage {
326326

327327
auto range = xrange(0u, childrenCount);
328328
const auto cmp = [this](TRowId rowId, TPos pos) {
329-
return rowId < GetShortChild(pos).RowsCount;
329+
return rowId < GetShortChild(pos).RowCount;
330330
};
331331

332332
TRecIdx result;
333333
if (!on) {
334334
// Will do a full binary search on full range
335-
} else if (GetShortChild(*on).RowsCount <= rowId) {
335+
} else if (GetShortChild(*on).RowCount <= rowId) {
336336
// Try a short linear search first
337337
result = *on;
338338
for (int linear = 0; linear < 4; ++linear) {
339339
result++;
340340
Y_ABORT_UNLESS(result < childrenCount, "Should always seek some child");
341-
if (GetShortChild(result).RowsCount > rowId) {
341+
if (GetShortChild(result).RowCount > rowId) {
342342
return result;
343343
}
344344
}
@@ -352,7 +352,7 @@ namespace NKikimr::NTable::NPage {
352352
if (result == 0) {
353353
return 0;
354354
}
355-
if (GetShortChild(result - 1).RowsCount <= rowId) {
355+
if (GetShortChild(result - 1).RowCount <= rowId) {
356356
return result;
357357
}
358358
result--;
@@ -464,14 +464,14 @@ namespace NKikimr::NTable::NPage {
464464
};
465465

466466
struct TBtreeIndexMeta : public TBtreeIndexNode::TChild {
467-
ui32 LevelsCount;
467+
ui32 LevelCount;
468468
ui64 IndexSize;
469469

470470
auto operator<=>(const TBtreeIndexMeta&) const = default;
471471

472472
TString ToString() const noexcept
473473
{
474-
return TStringBuilder() << TBtreeIndexNode::TChild::ToString() << " LevelsCount: " << LevelsCount << " IndexSize: " << IndexSize;
474+
return TStringBuilder() << TBtreeIndexNode::TChild::ToString() << " LevelCount: " << LevelCount << " IndexSize: " << IndexSize;
475475
}
476476
};
477477
}

ydb/core/tablet_flat/flat_page_btree_index_writer.h

+13-13
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ namespace NKikimr::NTable::NPage {
5050
}
5151

5252
void AddChild(TChild child) {
53-
Y_ABORT_UNLESS(child.ErasedRowsCount == 0 || !IsShortChildFormat(), "Short format can't have ErasedRowsCount");
53+
Y_ABORT_UNLESS(child.ErasedRowCount == 0 || !IsShortChildFormat(), "Short format can't have ErasedRowCount");
5454
Children.push_back(child);
5555
}
5656

@@ -249,7 +249,7 @@ namespace NKikimr::NTable::NPage {
249249
void PlaceChild(const TChild& child) noexcept
250250
{
251251
if (IsShortChildFormat()) {
252-
Place<TShortChild>() = TShortChild{child.PageId, child.RowsCount, child.DataSize};
252+
Place<TShortChild>() = TShortChild{child.PageId, child.RowCount, child.DataSize};
253253
} else {
254254
Place<TChild>() = child;
255255
}
@@ -375,14 +375,14 @@ namespace NKikimr::NTable::NPage {
375375
}
376376

377377
void AddShortChild(TShortChild child) {
378-
AddChild(TChild{child.PageId, child.RowsCount, child.DataSize, 0});
378+
AddChild(TChild{child.PageId, child.RowCount, child.DataSize, 0});
379379
}
380380

381381
void AddChild(TChild child) {
382382
// aggregate in order to perform search by row id from any leaf node
383-
child.RowsCount = (ChildrenRowsCount += child.RowsCount);
384-
child.DataSize = (ChildrenSize += child.DataSize);
385-
child.ErasedRowsCount = (ChildrenErasedRowsCount += child.ErasedRowsCount);
383+
child.RowCount = (ChildRowCount += child.RowCount);
384+
child.DataSize = (ChildSize += child.DataSize);
385+
child.ErasedRowCount = (ChildErasedRowCount += child.ErasedRowCount);
386386

387387
Levels[0].PushChild(child);
388388
}
@@ -409,9 +409,9 @@ namespace NKikimr::NTable::NPage {
409409
IndexSize = 0;
410410
Writer.Reset();
411411
Levels = { TLevel() };
412-
ChildrenRowsCount = 0;
413-
ChildrenErasedRowsCount = 0;
414-
ChildrenSize = 0;
412+
ChildRowCount = 0;
413+
ChildErasedRowCount = 0;
414+
ChildSize = 0;
415415
}
416416

417417
private:
@@ -463,7 +463,7 @@ namespace NKikimr::NTable::NPage {
463463
if (levelIndex + 1 == Levels.size()) {
464464
Levels.emplace_back();
465465
}
466-
Levels[levelIndex + 1].PushChild(TChild{pageId, lastChild.RowsCount, lastChild.DataSize, lastChild.ErasedRowsCount});
466+
Levels[levelIndex + 1].PushChild(TChild{pageId, lastChild.RowCount, lastChild.DataSize, lastChild.ErasedRowCount});
467467
if (!last) {
468468
Levels[levelIndex + 1].PushKey(Levels[levelIndex].PopKey());
469469
}
@@ -498,9 +498,9 @@ namespace NKikimr::NTable::NPage {
498498
const ui32 NodeKeysMin;
499499
const ui32 NodeKeysMax;
500500

501-
TRowId ChildrenRowsCount = 0;
502-
TRowId ChildrenErasedRowsCount = 0;
503-
ui64 ChildrenSize = 0;
501+
TRowId ChildRowCount = 0;
502+
TRowId ChildErasedRowCount = 0;
503+
ui64 ChildSize = 0;
504504
};
505505

506506
}

ydb/core/tablet_flat/flat_part_btree_index_iter.h

+10-10
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ class TPartBtreeIndexIt : public IIndexIter {
115115
, GroupId(groupId)
116116
, GroupInfo(part->Scheme->GetLayout(groupId))
117117
, Meta(groupId.IsHistoric() ? part->IndexPages.BTreeHistoric[groupId.Index] : part->IndexPages.BTreeGroups[groupId.Index])
118-
, State(Reserve(Meta.LevelsCount + 1))
118+
, State(Reserve(Meta.LevelCount + 1))
119119
{
120120
const static TCellsIterable EmptyKey(static_cast<const char*>(nullptr), TColumns());
121121
State.emplace_back(Meta, 0, GetEndRowId(), EmptyKey, EmptyKey);
@@ -180,7 +180,7 @@ class TPartBtreeIndexIt : public IIndexIter {
180180
EReady Next() override {
181181
Y_ABORT_UNLESS(!IsExhausted());
182182

183-
if (Meta.LevelsCount == 0) {
183+
if (Meta.LevelCount == 0) {
184184
return Exhaust();
185185
}
186186

@@ -194,7 +194,7 @@ class TPartBtreeIndexIt : public IIndexIter {
194194
PushNextState(*State.back().Pos + 1);
195195
}
196196

197-
for (ui32 level : xrange<ui32>(State.size() - 1, Meta.LevelsCount)) {
197+
for (ui32 level : xrange<ui32>(State.size() - 1, Meta.LevelCount)) {
198198
if (!TryLoad(State[level])) {
199199
// exiting with an intermediate state
200200
Y_DEBUG_ABORT_UNLESS(!IsLeaf() && !IsExhausted());
@@ -211,7 +211,7 @@ class TPartBtreeIndexIt : public IIndexIter {
211211
EReady Prev() override {
212212
Y_ABORT_UNLESS(!IsExhausted());
213213

214-
if (Meta.LevelsCount == 0) {
214+
if (Meta.LevelCount == 0) {
215215
return Exhaust();
216216
}
217217

@@ -225,7 +225,7 @@ class TPartBtreeIndexIt : public IIndexIter {
225225
PushNextState(*State.back().Pos - 1);
226226
}
227227

228-
for (ui32 level : xrange<ui32>(State.size() - 1, Meta.LevelsCount)) {
228+
for (ui32 level : xrange<ui32>(State.size() - 1, Meta.LevelCount)) {
229229
if (!TryLoad(State[level])) {
230230
// exiting with an intermediate state
231231
Y_DEBUG_ABORT_UNLESS(!IsLeaf() && !IsExhausted());
@@ -246,7 +246,7 @@ class TPartBtreeIndexIt : public IIndexIter {
246246
}
247247

248248
TRowId GetEndRowId() const override {
249-
return Meta.RowsCount;
249+
return Meta.RowCount;
250250
}
251251

252252
TPageId GetPageId() const override {
@@ -286,7 +286,7 @@ class TPartBtreeIndexIt : public IIndexIter {
286286
State[0].Pos = { };
287287
}
288288

289-
for (ui32 level : xrange<ui32>(State.size() - 1, Meta.LevelsCount)) {
289+
for (ui32 level : xrange<ui32>(State.size() - 1, Meta.LevelCount)) {
290290
auto &state = State[level];
291291
Y_DEBUG_ABORT_UNLESS(seek.BelongsTo(state));
292292
if (!TryLoad(state)) {
@@ -316,7 +316,7 @@ class TPartBtreeIndexIt : public IIndexIter {
316316
bool IsLeaf() const noexcept {
317317
// Note: it is possible to have 0 levels in B-Tree
318318
// so we may have exhausted state with leaf (data) node
319-
return State.size() == Meta.LevelsCount + 1 && !IsExhausted();
319+
return State.size() == Meta.LevelCount + 1 && !IsExhausted();
320320
}
321321

322322
EReady Exhaust() {
@@ -334,8 +334,8 @@ class TPartBtreeIndexIt : public IIndexIter {
334334

335335
auto child = current.Node->GetChild(pos);
336336

337-
TRowId beginRowId = pos ? current.Node->GetChild(pos - 1).RowsCount : current.BeginRowId;
338-
TRowId endRowId = child.RowsCount;
337+
TRowId beginRowId = pos ? current.Node->GetChild(pos - 1).RowCount : current.BeginRowId;
338+
TRowId endRowId = child.RowCount;
339339

340340
TCellsIterable beginKey = pos ? current.Node->GetKeyCellsIterable(pos - 1, GroupInfo.ColsKeyIdx) : current.BeginKey;
341341
TCellsIterable endKey = pos < current.Node->GetKeysCount() ? current.Node->GetKeyCellsIterable(pos, GroupInfo.ColsKeyIdx) : current.EndKey;

ydb/core/tablet_flat/flat_part_charge_btree_index.h

+13-13
Original file line numberDiff line numberDiff line change
@@ -35,24 +35,24 @@ class TChargeBTreeIndex : public ICharge {
3535

3636
const auto& meta = Part->IndexPages.BTreeGroups[0];
3737

38-
if (Y_UNLIKELY(row1 >= meta.RowsCount)) {
38+
if (Y_UNLIKELY(row1 >= meta.RowCount)) {
3939
return { true, true }; // already out of bounds, nothing to precharge
4040
}
4141
if (Y_UNLIKELY(row1 > row2)) {
4242
row2 = row1; // will not go further than row1
4343
}
4444

4545
TVector<TBtreeIndexNode> level, nextLevel(Reserve(2));
46-
for (ui32 high = 0; high < meta.LevelsCount && ready; high++) {
47-
if (high == 0) {
46+
for (ui32 height = 0; height < meta.LevelCount && ready; height++) {
47+
if (height == 0) {
4848
ready &= TryLoadNode(meta.PageId, nextLevel);
4949
} else {
5050
for (ui32 i : xrange<ui32>(level.size())) {
5151
TRecIdx from = 0, to = level[i].GetKeysCount();
5252
if (i == 0) {
5353
from = level[i].Seek(row1);
5454
}
55-
if (i + 1 == level.size() && row2 < meta.RowsCount) {
55+
if (i + 1 == level.size() && row2 < meta.RowCount) {
5656
to = level[i].Seek(row2);
5757
}
5858
for (TRecIdx j : xrange(from, to + 1)) {
@@ -70,15 +70,15 @@ class TChargeBTreeIndex : public ICharge {
7070
return {false, false};
7171
}
7272

73-
if (meta.LevelsCount == 0) {
73+
if (meta.LevelCount == 0) {
7474
ready &= HasDataPage(meta.PageId, { });
7575
} else {
7676
for (ui32 i : xrange<ui32>(level.size())) {
7777
TRecIdx from = 0, to = level[i].GetKeysCount();
7878
if (i == 0) {
7979
from = level[i].Seek(row1);
8080
}
81-
if (i + 1 == level.size() && row2 < meta.RowsCount) {
81+
if (i + 1 == level.size() && row2 < meta.RowCount) {
8282
to = level[i].Seek(row2);
8383
}
8484
for (TRecIdx j : xrange(from, to + 1)) {
@@ -103,25 +103,25 @@ class TChargeBTreeIndex : public ICharge {
103103

104104
const auto& meta = Part->IndexPages.BTreeGroups[0];
105105

106-
if (Y_UNLIKELY(row1 >= meta.RowsCount)) {
107-
row1 = meta.RowsCount - 1; // start from the last row
106+
if (Y_UNLIKELY(row1 >= meta.RowCount)) {
107+
row1 = meta.RowCount - 1; // start from the last row
108108
}
109109
if (Y_UNLIKELY(row1 < row2)) {
110110
row2 = row1; // will not go further than row1
111111
}
112112

113113
// level contains nodes in reverse order
114114
TVector<TBtreeIndexNode> level, nextLevel(Reserve(2));
115-
for (ui32 high = 0; high < meta.LevelsCount && ready; high++) {
116-
if (high == 0) {
115+
for (ui32 height = 0; height < meta.LevelCount && ready; height++) {
116+
if (height == 0) {
117117
ready &= TryLoadNode(meta.PageId, nextLevel);
118118
} else {
119119
for (ui32 i : xrange<ui32>(level.size())) {
120120
TRecIdx from = level[i].GetKeysCount(), to = 0;
121121
if (i == 0) {
122122
from = level[i].Seek(row1);
123123
}
124-
if (i + 1 == level.size() && row2 < meta.RowsCount) {
124+
if (i + 1 == level.size() && row2 < meta.RowCount) {
125125
to = level[i].Seek(row2);
126126
}
127127
for (TRecIdx j = from + 1; j > to; j--) {
@@ -139,15 +139,15 @@ class TChargeBTreeIndex : public ICharge {
139139
return {false, false};
140140
}
141141

142-
if (meta.LevelsCount == 0) {
142+
if (meta.LevelCount == 0) {
143143
ready &= HasDataPage(meta.PageId, { });
144144
} else {
145145
for (ui32 i : xrange<ui32>(level.size())) {
146146
TRecIdx from = level[i].GetKeysCount(), to = 0;
147147
if (i == 0) {
148148
from = level[i].Seek(row1);
149149
}
150-
if (i + 1 == level.size() && row2 < meta.RowsCount) {
150+
if (i + 1 == level.size() && row2 < meta.RowCount) {
151151
to = level[i].Seek(row2);
152152
}
153153
for (TRecIdx j = from + 1; j > to; j--) {

ydb/core/tablet_flat/flat_part_dump.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ namespace {
168168
{
169169
if (part.IndexPages.BTreeGroups) {
170170
auto meta = part.IndexPages.BTreeGroups.front();
171-
if (meta.LevelsCount) {
171+
if (meta.LevelCount) {
172172
BTreeIndexNode(part, meta);
173173
} else {
174174
Out

ydb/core/tablet_flat/flat_part_loader.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,10 @@ void TLoader::StageParseMeta() noexcept
8383
for (const auto &meta : history ? layout.GetBTreeHistoricIndexes() : layout.GetBTreeGroupIndexes()) {
8484
NPage::TBtreeIndexMeta converted{{
8585
meta.GetRootPageId(),
86-
meta.GetRowsCount(),
86+
meta.GetRowCount(),
8787
meta.GetDataSize(),
88-
meta.GetErasedRowsCount()},
89-
meta.GetLevelsCount(),
88+
meta.GetErasedRowCount()},
89+
meta.GetLevelCount(),
9090
meta.GetIndexSize()};
9191
(history ? BTreeHistoricIndexes : BTreeGroupIndexes).push_back(converted);
9292
}

ydb/core/tablet_flat/flat_part_writer.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -666,11 +666,11 @@ namespace NTable {
666666
for (auto meta : history ? Current.BTreeHistoricIndexes : Current.BTreeGroupIndexes) {
667667
auto m = history ? lay->AddBTreeHistoricIndexes() : lay->AddBTreeGroupIndexes();
668668
m->SetRootPageId(meta.PageId);
669-
m->SetLevelsCount(meta.LevelsCount);
669+
m->SetLevelCount(meta.LevelCount);
670670
m->SetIndexSize(meta.IndexSize);
671671
m->SetDataSize(meta.DataSize);
672-
m->SetRowsCount(meta.RowsCount);
673-
m->SetErasedRowsCount(meta.ErasedRowsCount);
672+
m->SetRowCount(meta.RowCount);
673+
m->SetErasedRowCount(meta.ErasedRowCount);
674674
}
675675
}
676676

0 commit comments

Comments
 (0)