zhijiangW commented on a change in pull request #11507: [FLINK-16587] Add basic
CheckpointBarrierHandler for unaligned checkpoint
URL: https://github.com/apache/flink/pull/11507#discussion_r400645765
##########
File path:
flink-runtime/src/main/java/org/apache/flink/runtime/io/network/api/writer/RecordWriter.java
##########
@@ -153,13 +153,17 @@ protected boolean copyFromSerializerToTargetChannel(int
targetChannel) throws IO
return pruneTriggered;
}
- public void broadcastEvent(AbstractEvent event) throws IOException {
+ public void broadcastEvent(AbstractEvent event, boolean
isPriorityEvent) throws IOException {
try (BufferConsumer eventBufferConsumer =
EventSerializer.toBufferConsumer(event)) {
for (int targetChannel = 0; targetChannel <
numberOfChannels; targetChannel++) {
tryFinishCurrentBufferBuilder(targetChannel);
- // Retain the buffer so that it can be recycled
by each channel of targetPartition
-
targetPartition.addBufferConsumer(eventBufferConsumer.copy(), targetChannel);
+ if (isPriorityEvent) {
+ targetPartition.addPriorityEvent(event,
targetChannel, eventBufferConsumer);
Review comment:
I am a bit torn about passing both event and buffer in the interface method.
It seems not very clean on my side.
I guess we can make it happen to guarantee that `CheckpointBarrier` should
be inserted in head for unaligned option in any cases. Then it would make
things easy.
----------------------------------------------------------------
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