tillrohrmann 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_r334025401
########## 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: Hmm it looks a bit strange that we introduced `getNodeByteBufferAndOffset` which returns a `ByteBuffer` and its offset together just to unwrap it here and then passing it individually into `SkipListUtils.getLevel`. The same applies to the call into `getValuePointer`. ---------------------------------------------------------------- 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: us...@infra.apache.org With regards, Apache Git Services