@@ -84,48 +84,80 @@ namespace NKikimr::NTable::NPage {
84
84
static_assert (sizeof (TIsNullBitmap) == 1 , " Invalid TBtreeIndexNode TIsNullBitmap size" );
85
85
86
86
struct TShortChild {
87
- TPageId PageId;
88
- TRowId RowCount;
89
- ui64 DataSize;
87
+ TPageId PageId_;
88
+ TRowId RowCount_;
89
+ ui64 DataSize_;
90
+
91
+ inline TPageId GetPageId () const noexcept {
92
+ return PageId_;
93
+ }
94
+
95
+ inline TRowId GetRowCount () const noexcept {
96
+ return RowCount_;
97
+ }
98
+
99
+ inline ui64 GetDataSize () const noexcept {
100
+ return DataSize_;
101
+ }
90
102
91
103
auto operator <=>(const TShortChild&) const = default ;
92
104
} Y_PACKED;
93
105
94
106
static_assert (sizeof (TShortChild) == 20 , " Invalid TBtreeIndexNode TShortChild size" );
95
107
96
108
struct TChild {
97
- TPageId PageId ;
98
- TRowId RowCount ;
99
- ui64 DataSize ;
100
- ui64 GroupDataSize ;
101
- TRowId ErasedRowCount ;
109
+ TPageId PageId_ ;
110
+ TRowId RowCount_ ;
111
+ ui64 DataSize_ ;
112
+ ui64 GroupDataSize_ ;
113
+ TRowId ErasedRowCount_ ;
102
114
103
115
auto operator <=>(const TChild&) const = default ;
104
116
105
- TRowId GetNonErasedRowCount () const noexcept {
106
- return RowCount - ErasedRowCount;
117
+ inline TPageId GetPageId () const noexcept {
118
+ return PageId_;
119
+ }
120
+
121
+ inline TRowId GetRowCount () const noexcept {
122
+ return RowCount_;
123
+ }
124
+
125
+ inline ui64 GetDataSize () const noexcept {
126
+ return DataSize_;
127
+ }
128
+
129
+ inline ui64 GetGroupDataSize () const noexcept {
130
+ return GroupDataSize_;
131
+ }
132
+
133
+ inline TRowId GetErasedRowCount () const noexcept {
134
+ return ErasedRowCount_;
135
+ }
136
+
137
+ inline TRowId GetNonErasedRowCount () const noexcept {
138
+ return RowCount_ - ErasedRowCount_;
107
139
}
108
140
109
- ui64 GetTotalDataSize () const noexcept {
110
- return DataSize + GroupDataSize ;
141
+ inline ui64 GetTotalDataSize () const noexcept {
142
+ return DataSize_ + GroupDataSize_ ;
111
143
}
112
144
113
145
TString ToString () const noexcept {
114
146
TStringBuilder result;
115
- result << " PageId: " << PageId << " RowCount: " << RowCount << " DataSize: " << DataSize ;
116
- if (GroupDataSize ) {
117
- result << " GroupDataSize: " << GroupDataSize ;
147
+ result << " PageId: " << GetPageId () << " RowCount: " << GetRowCount () << " DataSize: " << GetDataSize () ;
148
+ if (GetGroupDataSize () ) {
149
+ result << " GroupDataSize: " << GetGroupDataSize () ;
118
150
}
119
- result << " ErasedRowCount: " << ErasedRowCount ;
151
+ result << " ErasedRowCount: " << GetErasedRowCount () ;
120
152
return result;
121
153
}
122
154
} Y_PACKED;
123
155
124
156
static_assert (sizeof (TChild) == 36 , " Invalid TBtreeIndexNode TChild size" );
125
157
126
- static_assert (offsetof(TChild, PageId ) == offsetof(TShortChild, PageId ));
127
- static_assert (offsetof(TChild, RowCount ) == offsetof(TShortChild, RowCount ));
128
- static_assert (offsetof(TChild, DataSize ) == offsetof(TShortChild, DataSize ));
158
+ static_assert (offsetof(TChild, PageId_ ) == offsetof(TShortChild, PageId_ ));
159
+ static_assert (offsetof(TChild, RowCount_ ) == offsetof(TShortChild, RowCount_ ));
160
+ static_assert (offsetof(TChild, DataSize_ ) == offsetof(TShortChild, DataSize_ ));
129
161
130
162
#pragma pack(pop)
131
163
@@ -357,19 +389,19 @@ namespace NKikimr::NTable::NPage {
357
389
358
390
auto range = xrange (0u , childrenCount);
359
391
const auto cmp = [this ](TRowId rowId, TPos pos) {
360
- return rowId < GetShortChild (pos).RowCount ;
392
+ return rowId < GetShortChild (pos).GetRowCount () ;
361
393
};
362
394
363
395
TRecIdx result;
364
396
if (!on) {
365
397
// Will do a full binary search on full range
366
- } else if (GetShortChild (*on).RowCount <= rowId) {
398
+ } else if (GetShortChild (*on).GetRowCount () <= rowId) {
367
399
// Try a short linear search first
368
400
result = *on;
369
401
for (int linear = 0 ; linear < 4 ; ++linear) {
370
402
result++;
371
403
Y_ABORT_UNLESS (result < childrenCount, " Should always seek some child" );
372
- if (GetShortChild (result).RowCount > rowId) {
404
+ if (GetShortChild (result).GetRowCount () > rowId) {
373
405
return result;
374
406
}
375
407
}
@@ -383,7 +415,7 @@ namespace NKikimr::NTable::NPage {
383
415
if (result == 0 ) {
384
416
return 0 ;
385
417
}
386
- if (GetShortChild (result - 1 ).RowCount <= rowId) {
418
+ if (GetShortChild (result - 1 ).GetRowCount () <= rowId) {
387
419
return result;
388
420
}
389
421
result--;
0 commit comments