From a74b3d69f61f8f1f735a39725c26b5b8eea5f5b7 Mon Sep 17 00:00:00 2001 From: Jake Smith Date: Fri, 8 Dec 2023 14:45:58 +0000 Subject: [PATCH] review changes Signed-off-by: Jake Smith --- system/jhtree/jhtree.cpp | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/system/jhtree/jhtree.cpp b/system/jhtree/jhtree.cpp index 1d0613defed..922bc8eb588 100644 --- a/system/jhtree/jhtree.cpp +++ b/system/jhtree/jhtree.cpp @@ -351,7 +351,7 @@ class jhtree_decl CKeyLevelManager : implements IKeyManager, public CInterface { protected: IContextLogger *ctx = nullptr; - IContextLogger *conditionalCtx = nullptr; + IContextLogger *activeCtx = nullptr; Owned filter; IKeyCursor *keyCursor; ConstPointerArray activeBlobs; @@ -408,7 +408,7 @@ class jhtree_decl CKeyLevelManager : implements IKeyManager, public CInterface indexParts = ki->numPartitions(); // If TLK don't collect context information - conditionalCtx = ki->isTopLevelKey() ? nullptr : ctx; + activeCtx = ki->isTopLevelKey() ? nullptr : ctx; } } @@ -497,26 +497,26 @@ class jhtree_decl CKeyLevelManager : implements IKeyManager, public CInterface virtual bool lookup(bool exact) { if (keyCursor) - return keyCursor->lookup(exact, conditionalCtx); + return keyCursor->lookup(exact, activeCtx); else return false; } virtual bool lookupSkip(const void *seek, size32_t seekOffset, size32_t seeklen) { - return keyCursor ? keyCursor->lookupSkip(seek, seekOffset, seeklen, conditionalCtx) : false; + return keyCursor ? keyCursor->lookupSkip(seek, seekOffset, seeklen, activeCtx) : false; } unsigned __int64 getCount() { assertex(keyCursor); - return keyCursor->getCount(conditionalCtx); + return keyCursor->getCount(activeCtx); } unsigned __int64 getCurrentRangeCount(unsigned groupSegCount) { assertex(keyCursor); - return keyCursor->getCurrentRangeCount(groupSegCount, conditionalCtx); + return keyCursor->getCurrentRangeCount(groupSegCount, activeCtx); } bool nextRange(unsigned groupSegCount) @@ -528,7 +528,7 @@ class jhtree_decl CKeyLevelManager : implements IKeyManager, public CInterface unsigned __int64 checkCount(unsigned __int64 max) { assertex(keyCursor); - return keyCursor->checkCount(max, conditionalCtx); + return keyCursor->checkCount(max, activeCtx); } virtual void serializeCursorPos(MemoryBuffer &mb) @@ -538,7 +538,7 @@ class jhtree_decl CKeyLevelManager : implements IKeyManager, public CInterface virtual void deserializeCursorPos(MemoryBuffer &mb) { - keyCursor->deserializeCursorPos(mb, conditionalCtx); + keyCursor->deserializeCursorPos(mb, activeCtx); } virtual const byte *loadBlob(unsigned __int64 blobid, size32_t &blobsize, IContextLogger *ctx) @@ -1038,7 +1038,7 @@ void CKeyStore::clearCacheEntry(const IFileIO *io) // -static void noteCLSeeks(IContextLogger *ctx, unsigned lseeks, unsigned lscans, unsigned lwildseeks) +static void noteSeeks(IContextLogger *ctx, unsigned lseeks, unsigned lscans, unsigned lwildseeks) { if (ctx) { @@ -1048,7 +1048,7 @@ static void noteCLSeeks(IContextLogger *ctx, unsigned lseeks, unsigned lscans, u } } -static void noteCLSkips(IContextLogger *ctx, unsigned lskips, unsigned lnullSkips) +static void noteSkips(IContextLogger *ctx, unsigned lskips, unsigned lnullSkips) { if (ctx) { @@ -1556,7 +1556,7 @@ const CJHSearchNode *CKeyIndex::locateFirstLeafNode(IContextLogger *ctx) const const CJHSearchNode *CKeyIndex::locateLastLeafNode(IContextLogger *ctx) const { keySeeks++; - noteCLSeeks(ctx, 1, 0, 0); + noteSeeks(ctx, 1, 0, 0); //Unusual - an index with no elements if (keyHdr->getNumRecords() == 0) @@ -1958,16 +1958,16 @@ bool CKeyCursor::_lookup(bool exact, unsigned lastSeg, bool unfiltered, IContext } if (logExcessiveSeeks && lwildseeks > 1000 && ret) reportExcessiveSeeks(lwildseeks, lastSeg, ctx); - noteCLSeeks(ctx, lseeks, lscans, lwildseeks); + noteSeeks(ctx, lseeks, lscans, lwildseeks); return ret; } bool CKeyCursor::lookupSkip(const void *seek, size32_t seekOffset, size32_t seeklen, IContextLogger *ctx) { if (skipTo(seek, seekOffset, seeklen)) - noteCLSkips(ctx, 1, 0); + noteSkips(ctx, 1, 0); else - noteCLSkips(ctx, 0, 1); + noteSkips(ctx, 0, 1); bool ret = lookup(true, ctx); #ifdef _DEBUG if (doTrace(traceSmartStepping, TraceFlags::Max)) @@ -2033,7 +2033,7 @@ unsigned __int64 CKeyCursor::checkCount(unsigned __int64 max, IContextLogger *ct bool unfiltered = filter->isUnfiltered(); if (lastFullSeg == (unsigned) -1) { - noteCLSeeks(ctx, 1, 0, 0); + noteSeeks(ctx, 1, 0, 0); if (_last(ctx)) return getSequence()+1; else @@ -2063,7 +2063,7 @@ unsigned __int64 CKeyCursor::getCurrentRangeCount(unsigned groupSegCount, IConte unsigned __int64 locount = getSequence(); endRange(groupSegCount); _ltEqual(ctx); - noteCLSeeks(ctx, 1, 0, 0); + noteSeeks(ctx, 1, 0, 0); return getSequence()-locount+1; } @@ -3031,7 +3031,7 @@ class CKeyMerger : public CKeyLevelManager if (!found || !seek || memcmp(cursor->queryKeyedBuffer() + seekOffset, seek, seeklen) >= 0) break; } - noteCLSkips(ctx, lskips, lnullSkips); + noteSkips(ctx, lskips, lnullSkips); if (found) { IKeyCursor *mergeCursor;