curcur commented on a change in pull request #13614:
URL: https://github.com/apache/flink/pull/13614#discussion_r507059066



##########
File path: 
flink-runtime/src/main/java/org/apache/flink/runtime/io/network/partition/BufferWritingResultPartition.java
##########
@@ -211,46 +223,83 @@ protected void releaseInternal() {
                }
        }
 
-       private BufferBuilder getSubpartitionBufferBuilder(int 
targetSubpartition) throws IOException {
-               final BufferBuilder bufferBuilder = 
subpartitionBufferBuilders[targetSubpartition];
-               if (bufferBuilder != null) {
-                       return bufferBuilder;
+       private BufferBuilder appendDataToSubpartitionForNewRecord(
+                       ByteBuffer record, int targetSubpartition) throws 
IOException {
+               BufferBuilder buffer = 
subpartitionBufferBuilders[targetSubpartition];
+
+               if (buffer == null) {
+                       buffer = 
requestNewSubpartitionBufferBuilder(targetSubpartition);
+                       
subpartitions[targetSubpartition].add(buffer.createBufferConsumerFromBeginning(),
 0);

Review comment:
       Yes, it could be. In fact, in all existing cases, the consumer is 
created from the beginning. I was trying to remove `createBufferConsumer()` to 
use `createBufferConsumerFromBeginning()` in all places.
   
   But at a second thought, I am not happy with 
`createBufferConsumerFromBeginning()`, and that's why I am still keeping 
`createBufferConsumer()`.
   
   I think I probably have a way to get rid of 
`createBufferConsumerFromBeginning()`, with a bit more complicated clean-up 
logic. 
   




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