AHeise commented on a change in pull request #12353:
URL: https://github.com/apache/flink/pull/12353#discussion_r439244176



##########
File path: 
flink-runtime/src/main/java/org/apache/flink/runtime/io/network/buffer/BufferConsumer.java
##########
@@ -118,6 +118,16 @@ public BufferConsumer copy() {
                return new BufferConsumer(buffer.retainBuffer(), 
writerPosition.positionMarker, currentReaderPosition);
        }
 
+       /**
+        * Returns a retained copy with separate indexes and syncs it with the 
current position of the given {@link BufferBuilder}.
+        * This allows to read from the same {@link MemorySegment} twice 
starting from the position of the builder.
+        *
+        * @return a retained copy of self with separate indexes
+        */
+       public BufferConsumer copyAndSync(BufferBuilder builder) {

Review comment:
       I like it as it gives more flexibility, I just need to update the writer 
position publicly, but imho that is a good change anyway (needed that we 
debugging in various places).




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


Reply via email to