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_r334028005
 
 

 ##########
 File path: 
flink-state-backends/flink-statebackend-heap-spillable/src/main/java/org/apache/flink/runtime/state/heap/CopyOnWriteSkipListStateMap.java
 ##########
 @@ -1136,10 +1088,9 @@ S helpGetState(long valuePointer, 
SkipListValueSerializer<S> serializer) {
                        return null;
                }
 
-               Chunk chunk = 
spaceAllocator.getChunkById(SpaceUtils.getChunkIdByAddress(valuePointer));
-               int offsetInChunk = 
SpaceUtils.getChunkOffsetByAddress(valuePointer);
-               ByteBuffer bb = chunk.getByteBuffer(offsetInChunk);
-               int offsetInByteBuffer = 
chunk.getOffsetInByteBuffer(offsetInChunk);
+               Tuple2<ByteBuffer, Integer> tuple2 = 
getNodeByteBufferAndOffset(valuePointer);
+               ByteBuffer bb = tuple2.f0;
+               int offsetInByteBuffer = tuple2.f1;
 
 Review comment:
   if the `ByteBuffer` and the offset are needed by all methods to perform an 
operation on it, then one could directly pass the combined value object instead 
of unwrapping the individual fields and passing them individually to the 
modifying method.

----------------------------------------------------------------
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

Reply via email to