gaoyunhaii commented on a change in pull request #15192:
URL: https://github.com/apache/flink/pull/15192#discussion_r594192707



##########
File path: 
flink-runtime/src/main/java/org/apache/flink/runtime/io/network/partition/BufferReaderWriterUtil.java
##########
@@ -142,31 +137,12 @@ static long writeToByteChannelIfBelowSize(
         return -1L;
     }
 
-    static long writeToByteChannel(
-            FileChannel channel,
-            Buffer buffer,
-            ByteBuffer writeDataCache,
-            ByteBuffer[] arrayWithHeaderBuffer)
-            throws IOException {
-
-        final long bytesToWrite = HEADER_LENGTH + buffer.readableBytes();
-        if (bytesToWrite > writeDataCache.remaining()) {
-            writeDataCache.flip();
-            writeBuffer(channel, writeDataCache);
-            writeDataCache.clear();
-        }
-
-        if (bytesToWrite > writeDataCache.remaining()) {
-            return writeToByteChannel(channel, buffer, arrayWithHeaderBuffer);
-        }
-
-        writeDataCache.putShort(buffer.isBuffer() ? HEADER_VALUE_IS_BUFFER : 
HEADER_VALUE_IS_EVENT);
-        writeDataCache.putShort(
-                buffer.isCompressed() ? BUFFER_IS_COMPRESSED : 
BUFFER_IS_NOT_COMPRESSED);
-        writeDataCache.putInt(buffer.getSize());
-        writeDataCache.put(buffer.getNioBufferReadable());
-
-        return bytesToWrite;
+    static void getByteChannelBufferHeader(Buffer buffer, ByteBuffer header) {

Review comment:
       Might change to `setByteChannelBufferHeader` ?




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