Skip to content

Commit 99a63ea

Browse files
committed
YQL-20086 minikql
commit_hash:c35c972d6708fb1b3f34fa34a42cdae1ddf11cdc
1 parent a731af3 commit 99a63ea

File tree

123 files changed

+4766
-4750
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

123 files changed

+4766
-4750
lines changed

yql/essentials/minikql/aligned_page_pool.cpp

Lines changed: 127 additions & 127 deletions
Large diffs are not rendered by default.

yql/essentials/minikql/aligned_page_pool.h

Lines changed: 82 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,11 @@ class TAlignedPagePoolImpl {
7070

7171
explicit TAlignedPagePoolImpl(const TSourceLocation& location,
7272
const TAlignedPagePoolCounters& counters = TAlignedPagePoolCounters())
73-
: Counters(counters)
74-
, DebugInfo(location)
73+
: Counters_(counters)
74+
, DebugInfo_(location)
7575
{
76-
if (Counters.PoolsCntr) {
77-
++(*Counters.PoolsCntr);
76+
if (Counters_.PoolsCntr) {
77+
++(*Counters_.PoolsCntr);
7878
}
7979
}
8080

@@ -87,15 +87,15 @@ class TAlignedPagePoolImpl {
8787
~TAlignedPagePoolImpl();
8888

8989
inline size_t GetAllocated() const noexcept {
90-
return TotalAllocated;
90+
return TotalAllocated_;
9191
}
9292

9393
inline size_t GetUsed() const noexcept {
94-
return TotalAllocated - GetFreePageCount() * POOL_PAGE_SIZE;
94+
return TotalAllocated_ - GetFreePageCount() * POOL_PAGE_SIZE;
9595
}
9696

9797
inline size_t GetFreePageCount() const noexcept {
98-
return FreePages.size();
98+
return FreePages_.size();
9999
}
100100

101101
static inline const void* GetPageStart(const void* addr) noexcept {
@@ -111,71 +111,71 @@ class TAlignedPagePoolImpl {
111111
void ReturnPage(void* addr) noexcept;
112112

113113
void Swap(TAlignedPagePoolImpl& other) {
114-
DoSwap(FreePages, other.FreePages);
115-
DoSwap(AllPages, other.AllPages);
116-
DoSwap(ActiveBlocks, other.ActiveBlocks);
117-
DoSwap(TotalAllocated, other.TotalAllocated);
118-
DoSwap(PeakAllocated, other.PeakAllocated);
119-
DoSwap(PeakUsed, other.PeakUsed);
120-
DoSwap(Limit, other.Limit);
121-
DoSwap(AllocCount, other.AllocCount);
122-
DoSwap(PageAllocCount, other.PageAllocCount);
123-
DoSwap(PageHitCount, other.PageHitCount);
124-
DoSwap(PageGlobalHitCount, other.PageGlobalHitCount);
125-
DoSwap(PageMissCount, other.PageMissCount);
126-
DoSwap(OffloadedAllocCount, other.OffloadedAllocCount);
127-
DoSwap(OffloadedBytes, other.OffloadedBytes);
128-
DoSwap(OffloadedActiveBytes, other.OffloadedActiveBytes);
129-
DoSwap(Counters, other.Counters);
130-
DoSwap(CheckLostMem, other.CheckLostMem);
131-
DoSwap(AllocNotifyCallback, other.AllocNotifyCallback);
132-
DoSwap(IncreaseMemoryLimitCallback, other.IncreaseMemoryLimitCallback);
114+
DoSwap(FreePages_, other.FreePages_);
115+
DoSwap(AllPages_, other.AllPages_);
116+
DoSwap(ActiveBlocks_, other.ActiveBlocks_);
117+
DoSwap(TotalAllocated_, other.TotalAllocated_);
118+
DoSwap(PeakAllocated_, other.PeakAllocated_);
119+
DoSwap(PeakUsed_, other.PeakUsed_);
120+
DoSwap(Limit_, other.Limit_);
121+
DoSwap(AllocCount_, other.AllocCount_);
122+
DoSwap(PageAllocCount_, other.PageAllocCount_);
123+
DoSwap(PageHitCount_, other.PageHitCount_);
124+
DoSwap(PageGlobalHitCount_, other.PageGlobalHitCount_);
125+
DoSwap(PageMissCount_, other.PageMissCount_);
126+
DoSwap(OffloadedAllocCount_, other.OffloadedAllocCount_);
127+
DoSwap(OffloadedBytes_, other.OffloadedBytes_);
128+
DoSwap(OffloadedActiveBytes_, other.OffloadedActiveBytes_);
129+
DoSwap(Counters_, other.Counters_);
130+
DoSwap(CheckLostMem_, other.CheckLostMem_);
131+
DoSwap(AllocNotifyCallback_, other.AllocNotifyCallback_);
132+
DoSwap(IncreaseMemoryLimitCallback_, other.IncreaseMemoryLimitCallback_);
133133
}
134134

135135
void PrintStat(size_t usedPages, IOutputStream& out) const;
136136

137137
TString GetDebugInfo() const {
138-
return ToString(DebugInfo);
138+
return ToString(DebugInfo_);
139139
}
140140

141141
void* GetBlock(size_t size);
142142

143143
void ReturnBlock(void* ptr, size_t size) noexcept;
144144

145145
size_t GetPeakAllocated() const noexcept {
146-
return PeakAllocated;
146+
return PeakAllocated_;
147147
}
148148

149149
size_t GetPeakUsed() const noexcept {
150-
return PeakUsed;
150+
return PeakUsed_;
151151
}
152152

153153
ui64 GetAllocCount() const noexcept {
154-
return AllocCount;
154+
return AllocCount_;
155155
}
156156

157157
ui64 GetPageAllocCount() const noexcept {
158-
return PageAllocCount;
158+
return PageAllocCount_;
159159
}
160160

161161
ui64 GetPageHitCount() const noexcept {
162-
return PageHitCount;
162+
return PageHitCount_;
163163
}
164164

165165
ui64 GetPageGlobalHitCount() const noexcept {
166-
return PageGlobalHitCount;
166+
return PageGlobalHitCount_;
167167
}
168168

169169
ui64 GetPageMissCount() const noexcept {
170-
return PageMissCount;
170+
return PageMissCount_;
171171
}
172172

173173
ui64 GetOffloadedAllocCount() const noexcept {
174-
return OffloadedAllocCount;
174+
return OffloadedAllocCount_;
175175
}
176176

177177
ui64 GetOffloadedBytes() const noexcept {
178-
return OffloadedBytes;
178+
return OffloadedBytes_;
179179
}
180180

181181
void OffloadAlloc(ui64 size);
@@ -186,49 +186,49 @@ class TAlignedPagePoolImpl {
186186
static ui64 GetGlobalPagePoolSize();
187187

188188
ui64 GetLimit() const noexcept {
189-
return Limit;
189+
return Limit_;
190190
}
191191

192192
void SetLimit(size_t limit) noexcept {
193-
Limit = limit;
193+
Limit_ = limit;
194194
}
195195

196196
void ReleaseFreePages();
197197

198198
void DisableStrictAllocationCheck() noexcept {
199-
CheckLostMem = false;
199+
CheckLostMem_ = false;
200200
}
201201

202202
using TAllocNotifyCallback = std::function<void()>;
203203
void SetAllocNotifyCallback(TAllocNotifyCallback&& callback, ui64 notifyBytes = 0) {
204-
AllocNotifyCallback = std::move(callback);
205-
AllocNotifyBytes = notifyBytes;
206-
AllocNotifyCurrentBytes = 0;
204+
AllocNotifyCallback_ = std::move(callback);
205+
AllocNotifyBytes_ = notifyBytes;
206+
AllocNotifyCurrentBytes_ = 0;
207207
}
208208

209209
using TIncreaseMemoryLimitCallback = std::function<void(ui64 currentLimit, ui64 required)>;
210210

211211
void SetIncreaseMemoryLimitCallback(TIncreaseMemoryLimitCallback&& callback) {
212-
IncreaseMemoryLimitCallback = std::move(callback);
212+
IncreaseMemoryLimitCallback_ = std::move(callback);
213213
}
214214

215215
static void ResetGlobalsUT();
216216

217217
void SetMaximumLimitValueReached(bool isReached) noexcept {
218-
IsMaximumLimitValueReached = isReached;
218+
IsMaximumLimitValueReached_ = isReached;
219219
}
220220

221221
bool GetMaximumLimitValueReached() const noexcept {
222-
return IsMaximumLimitValueReached;
222+
return IsMaximumLimitValueReached_;
223223
}
224224

225225
bool IsMemoryYellowZoneEnabled() const noexcept {
226-
return IsMemoryYellowZoneReached;
226+
return IsMemoryYellowZoneReached_;
227227
}
228228

229229
void ForcefullySetMemoryYellowZone(bool isEnabled) noexcept {
230-
IsMemoryYellowZoneReached = isEnabled;
231-
IsMemoryYellowZoneForcefullyChanged = true;
230+
IsMemoryYellowZoneReached_ = isEnabled;
231+
IsMemoryYellowZoneForcefullyChanged_ = true;
232232
}
233233

234234
#if defined(ALLOW_DEFAULT_ALLOCATOR)
@@ -244,8 +244,8 @@ class TAlignedPagePoolImpl {
244244
void Free(void* ptr, size_t size) noexcept;
245245

246246
void UpdatePeaks() {
247-
PeakAllocated = Max(PeakAllocated, GetAllocated());
248-
PeakUsed = Max(PeakUsed, GetUsed());
247+
PeakAllocated_ = Max(PeakAllocated_, GetAllocated());
248+
PeakUsed_ = Max(PeakUsed_, GetUsed());
249249

250250
UpdateMemoryYellowZone();
251251
}
@@ -258,49 +258,49 @@ class TAlignedPagePoolImpl {
258258

259259
void* GetPageImpl();
260260
protected:
261-
std::stack<void*, std::vector<void*>> FreePages;
262-
std::unordered_set<void*> AllPages;
263-
std::unordered_map<void*, size_t> ActiveBlocks;
264-
size_t TotalAllocated = 0;
265-
size_t PeakAllocated = 0;
266-
size_t PeakUsed = 0;
267-
size_t Limit = 0;
268-
269-
ui64 AllocCount = 0;
270-
ui64 PageAllocCount = 0;
271-
ui64 PageHitCount = 0;
272-
ui64 PageGlobalHitCount = 0;
273-
ui64 PageMissCount = 0;
274-
275-
ui64 OffloadedAllocCount = 0;
276-
ui64 OffloadedBytes = 0;
277-
ui64 OffloadedActiveBytes = 0;
278-
279-
TAlignedPagePoolCounters Counters;
280-
bool CheckLostMem = true;
281-
282-
TAllocNotifyCallback AllocNotifyCallback;
283-
ui64 AllocNotifyBytes = 0;
284-
ui64 AllocNotifyCurrentBytes = 0;
285-
286-
TIncreaseMemoryLimitCallback IncreaseMemoryLimitCallback;
287-
const TSourceLocation DebugInfo;
261+
std::stack<void*, std::vector<void*>> FreePages_;
262+
std::unordered_set<void*> AllPages_;
263+
std::unordered_map<void*, size_t> ActiveBlocks_;
264+
size_t TotalAllocated_ = 0;
265+
size_t PeakAllocated_ = 0;
266+
size_t PeakUsed_ = 0;
267+
size_t Limit_ = 0;
268+
269+
ui64 AllocCount_ = 0;
270+
ui64 PageAllocCount_ = 0;
271+
ui64 PageHitCount_ = 0;
272+
ui64 PageGlobalHitCount_ = 0;
273+
ui64 PageMissCount_ = 0;
274+
275+
ui64 OffloadedAllocCount_ = 0;
276+
ui64 OffloadedBytes_ = 0;
277+
ui64 OffloadedActiveBytes_ = 0;
278+
279+
TAlignedPagePoolCounters Counters_;
280+
bool CheckLostMem_ = true;
281+
282+
TAllocNotifyCallback AllocNotifyCallback_;
283+
ui64 AllocNotifyBytes_ = 0;
284+
ui64 AllocNotifyCurrentBytes_ = 0;
285+
286+
TIncreaseMemoryLimitCallback IncreaseMemoryLimitCallback_;
287+
const TSourceLocation DebugInfo_;
288288

289289
// Indicates when memory limit is almost reached.
290-
bool IsMemoryYellowZoneReached = false;
290+
bool IsMemoryYellowZoneReached_ = false;
291291
// Indicates that memory yellow zone was enabled or disabled forcefully.
292292
// If the value of this variable is true, then the limits specified below will not be applied and
293293
// changing the value can only be done manually.
294-
bool IsMemoryYellowZoneForcefullyChanged = false;
294+
bool IsMemoryYellowZoneForcefullyChanged_ = false;
295295
// This theshold is used to determine is memory limit is almost reached.
296296
// If TIncreaseMemoryLimitCallback is set this thresholds should be ignored.
297297
// The yellow zone turns on when memory consumption reaches 80% and turns off when consumption drops below 50%.
298-
const ui8 EnableMemoryYellowZoneThreshold = 80;
299-
const ui8 DisableMemoryYellowZoneThreshold = 50;
298+
const ui8 EnableMemoryYellowZoneThreshold_ = 80;
299+
const ui8 DisableMemoryYellowZoneThreshold_ = 50;
300300

301301
// This flag indicates that value of memory limit reached it's maximum.
302302
// Next TryIncreaseLimit call most likely will return false.
303-
bool IsMaximumLimitValueReached = false;
303+
bool IsMaximumLimitValueReached_ = false;
304304
};
305305

306306
using TAlignedPagePool = TAlignedPagePoolImpl<>;

yql/essentials/minikql/arrow/arrow_util.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ namespace arrow {
225225

226226
template <>
227227
struct TypeTraits<typename NKikimr::NMiniKQL::TPrimitiveDataType<NYql::NDecimal::TInt128>::TResult> {
228-
static inline std::shared_ptr<DataType> type_singleton() {
228+
static inline std::shared_ptr<DataType> type_singleton() { // NOLINT(readability-identifier-naming)
229229
return arrow::fixed_size_binary(16);
230230
}
231231
};

yql/essentials/minikql/comp_nodes/mkql_addmember.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ class TAddMemberWrapper : public TMutableCodegeneratorFallbackNode<TAddMemberWra
6666
const auto idxType = Type::getInt32Ty(context);
6767
const auto type = ArrayType::get(valType, newSize);
6868
const auto itmsType = PointerType::getUnqual(type);
69-
const auto itms = *Stateless || ctx.AlwaysInline ?
69+
const auto itms = *Stateless_ || ctx.AlwaysInline ?
7070
new AllocaInst(itmsType, 0U, "itms", &ctx.Func->getEntryBlock().back()):
7171
new AllocaInst(itmsType, 0U, "itms", block);
7272
const auto result = Cache_.GenNewArray(newSize, itms, ctx, block);

yql/essentials/minikql/comp_nodes/mkql_aggrcount.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ class TAggrCountInitWrapper : public TDecoratorCodegeneratorNode<TAggrCountInitW
2424
Value* DoGenerateGetValue(const TCodegenContext& ctx, Value* value, BasicBlock*& block) const {
2525
auto& context = ctx.Codegen.GetContext();
2626
const auto check = IsExists(value, block, context);
27-
if (Node->IsTemporaryValue())
28-
ValueCleanup(Node->GetRepresentation(), value, ctx, block);
27+
if (Node_->IsTemporaryValue())
28+
ValueCleanup(Node_->GetRepresentation(), value, ctx, block);
2929
return MakeBoolean(check, context, block);
3030
}
3131
#endif

yql/essentials/minikql/comp_nodes/mkql_apply.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ class TApplyWrapper: public TMutableCodegeneratorPtrNode<TApplyWrapper> {
100100
, Position(pos)
101101
, CallableType(callableType)
102102
{
103-
Stateless = false;
103+
Stateless_ = false;
104104
}
105105

106106
std::unique_ptr<IArrowKernelComputationNode> PrepareArrowKernelComputationNode(TComputationContext& ctx) const final {
@@ -150,7 +150,7 @@ class TApplyWrapper: public TMutableCodegeneratorPtrNode<TApplyWrapper> {
150150
const auto idxType = Type::getInt32Ty(context);
151151
const auto valType = Type::getInt128Ty(context);
152152
const auto arrayType = ArrayType::get(valType, ArgNodes.size());
153-
const auto args = *Stateless || ctx.AlwaysInline ?
153+
const auto args = *Stateless_ || ctx.AlwaysInline ?
154154
new AllocaInst(arrayType, 0U, "args", &ctx.Func->getEntryBlock().back()):
155155
new AllocaInst(arrayType, 0U, "args", block);
156156

yql/essentials/minikql/comp_nodes/mkql_block_agg.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1198,7 +1198,7 @@ struct THashedWrapperBaseState : public TBlockState {
11981198
, Builders_(keys.size())
11991199
, Arena_(TlsAllocState)
12001200
{
1201-
Pointer_ = Values_.data();
1201+
Pointer = Values_.data();
12021202
for (size_t i = 0; i < Keys_.size(); ++i) {
12031203
auto itemType = AS_TYPE(TBlockType, Keys_[i].Type)->GetItemType();
12041204
Readers_[i] = NYql::NUdf::MakeBlockReader(TTypeInfoHelper(), itemType);

0 commit comments

Comments
 (0)