You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2022/06/29 09:41:05 UTC

[GitHub] [flink] reswqa commented on a diff in pull request #19960: [FLINK-27907][runtime] implement disk read and write logic for hybrid shuffle

reswqa commented on code in PR #19960:
URL: https://github.com/apache/flink/pull/19960#discussion_r909422919


##########
flink-runtime/src/main/java/org/apache/flink/runtime/io/network/partition/BufferReaderWriterUtil.java:
##########
@@ -162,8 +162,19 @@ static Buffer readFileRegionFromByteChannel(FileChannel channel, ByteBuffer head
         return new FileRegionBuffer(channel, position, size, dataType, isCompressed);
     }
 
+    public static int setBufferWithHeader(
+            Buffer buffer, ByteBuffer[] bufferWithHeaders, int index) {
+        ByteBuffer header = BufferReaderWriterUtil.allocatedHeaderBuffer();
+        BufferReaderWriterUtil.setByteChannelBufferHeader(buffer, header);
+
+        bufferWithHeaders[index] = header;
+        bufferWithHeaders[index + 1] = buffer.getNioBufferReadable();
+
+        return header.remaining() + buffer.readableBytes();
+    }

Review Comment:
   Move this method to caller side and change return type to void.



-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org