maedhroz commented on code in PR #2487:
URL: https://github.com/apache/cassandra/pull/2487#discussion_r1262969321


##########
src/java/org/apache/cassandra/index/sai/disk/v1/bbtree/BlockBalancedTreeWalker.java:
##########
@@ -170,60 +242,18 @@ final static class TraversalState
         @VisibleForTesting
         int maxLevel;
 
-        TraversalState(DataInput dataInput) throws IOException
+        private TraversalState()
         {
-            maxPointsInLeafNode = dataInput.readVInt();
-            bytesPerValue = dataInput.readVInt();
-
-            // Read index:
-            numLeaves = dataInput.readVInt();
-            assert numLeaves > 0;
-            treeDepth = dataInput.readVInt();
-            minPackedValue = new byte[bytesPerValue];
-            maxPackedValue = new byte[bytesPerValue];
-
-            dataInput.readBytes(minPackedValue, 0, bytesPerValue);
-            dataInput.readBytes(maxPackedValue, 0, bytesPerValue);
-
-            if (ByteArrayUtil.compareUnsigned(minPackedValue, 0, 
maxPackedValue, 0, bytesPerValue) > 0)
-            {
-                String message = String.format("Min packed value %s is > max 
packed value %s.",
-                                               new BytesRef(minPackedValue), 
new BytesRef(maxPackedValue));
-                throw new CorruptIndexException(message, dataInput);
-            }
-
-            valueCount = dataInput.readVLong();
-
-            int numBytes = dataInput.readVInt();
-            byte[] packedIndex = new byte[numBytes];
-            dataInput.readBytes(packedIndex, 0, numBytes);
-
             nodeID = 1;
             level = 0;
             leafBlockFPStack = new long[treeDepth];
             leftNodePositions = new int[treeDepth];
             rightNodePositions = new int[treeDepth];
             splitValuesStack = new byte[treeDepth][];
-
-            memoryUsage = ObjectSizes.sizeOfArray(packedIndex) +
-                          ObjectSizes.sizeOfArray(minPackedValue) +
-                          ObjectSizes.sizeOfArray(maxPackedValue) +
-                          ObjectSizes.sizeOfArray(leafBlockFPStack) +
-                          ObjectSizes.sizeOfArray(leftNodePositions) +
-                          ObjectSizes.sizeOfArray(rightNodePositions) +
-                          ObjectSizes.sizeOfArray(splitValuesStack) * 
bytesPerValue;

Review Comment:
   So we're no longer counting the `TraversalState` items in `memoryUsage` in 
the walker, but that's okay because the bits in state are transient/query-bound 
anyway?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to