carp84 commented on a change in pull request #9501: [FLINK-12697] [State 
Backends] Support on-disk state storage for spill-able heap backend
URL: https://github.com/apache/flink/pull/9501#discussion_r334193967
 
 

 ##########
 File path: 
flink-state-backends/flink-statebackend-heap-spillable/src/main/java/org/apache/flink/runtime/state/heap/CopyOnWriteSkipListStateMap.java
 ##########
 @@ -590,10 +542,9 @@ private int compareByteBufferAndNode(ByteBuffer 
keyByteBuffer, int keyOffset, in
         * equal to, or greater than the second.
         */
        private int compareNamespaceAndNode(ByteBuffer namespaceByteBuffer, int 
namespaceOffset, int namespaceLen, long targetNode) {
-               Chunk chunk = 
spaceAllocator.getChunkById(SpaceUtils.getChunkIdByAddress(targetNode));
-               int offsetInChunk = 
SpaceUtils.getChunkOffsetByAddress(targetNode);
-               ByteBuffer targetKeyByteBuffer = 
chunk.getByteBuffer(offsetInChunk);
-               int offsetInByteBuffer = 
chunk.getOffsetInByteBuffer(offsetInChunk);
+               Tuple2<ByteBuffer, Integer> tuple2 = 
getNodeByteBufferAndOffset(targetNode);
+               ByteBuffer targetKeyByteBuffer = tuple2.f0;
+               int offsetInByteBuffer = tuple2.f1;
 
 Review comment:
   I think the class is just for improving the readability and I really don't 
want to pass the object everywhere and keep it alive for so long.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to