pnowojski commented on a change in pull request #7713: [FLINK-10995][runtime] 
Copy intermediate serialization results only once for broadcast mode
URL: https://github.com/apache/flink/pull/7713#discussion_r328119758
 
 

 ##########
 File path: 
flink-runtime/src/main/java/org/apache/flink/runtime/io/network/api/writer/BroadcastRecordWriter.java
 ##########
 @@ -18,30 +18,163 @@
 
 package org.apache.flink.runtime.io.network.api.writer;
 
+import org.apache.flink.annotation.VisibleForTesting;
 import org.apache.flink.core.io.IOReadableWritable;
+import org.apache.flink.runtime.io.network.buffer.BufferBuilder;
+import org.apache.flink.runtime.io.network.buffer.BufferConsumer;
 
 import java.io.IOException;
+import java.util.Optional;
+
+import static org.apache.flink.util.Preconditions.checkState;
 
 /**
  * A special record-oriented runtime result writer only for broadcast mode.
  *
- * <p>The BroadcastRecordWriter extends the {@link RecordWriter} and handles 
{@link #emit(IOReadableWritable)}
- * operation via {@link #broadcastEmit(IOReadableWritable)} directly in a more 
efficient way.
+ * <p>The BroadcastRecordWriter extends the {@link RecordWriter} and maintain 
a single {@link BufferBuilder}
+ * for all the channels. Then the serialization results need be copied only 
once to this buffer which would be
+ * shared for all the channels in a more efficient way.
  *
  * @param <T> the type of the record that can be emitted with this record 
writer
  */
 public class BroadcastRecordWriter<T extends IOReadableWritable> extends 
RecordWriter<T> {
 
 Review comment:
   (final has no effect on optimizations by itself)

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


With regards,
Apache Git Services

Reply via email to