rkhachatryan commented on a change in pull request #10939:
[FLINK-15750][network] Moving output flushing to the mailbox
URL: https://github.com/apache/flink/pull/10939#discussion_r370711678
##########
File path:
flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/tasks/StreamTask.java
##########
@@ -1492,13 +1532,27 @@ private void
checkpointStreamOperator(StreamOperator<?> op) throws Exception {
RecordWriter<SerializationDelegate<StreamRecord<OUT>>> output =
new RecordWriterBuilder<SerializationDelegate<StreamRecord<OUT>>>()
.setChannelSelector(outputPartitioner)
- .setTimeout(bufferTimeout)
- .setTaskName(taskName)
+ .setFlushAlways(bufferTimeout == 0)
.build(bufferWriter);
output.setMetricGroup(environment.getMetricGroup().getIOMetricGroup());
+
+ if (bufferTimeout > 0) {
+
outputFlushers.addOutputFlusher(startOutputFlusher(output, taskName,
bufferTimeout, mailboxExecutor));
+ }
return output;
}
+ private static OutputFlusher startOutputFlusher(
+ RecordWriter<?> output,
+ String taskName,
+ long bufferTimeout,
+ MailboxExecutor mailboxExecutor) {
+ Preconditions.checkArgument(bufferTimeout >= -1);
Review comment:
This should be in `OutputFlusher` because it makes sense for any
`OutputFlusher`.
Also, values -1, 0 and maybe under 10 don't make sense.
----------------------------------------------------------------
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