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_r400639370
##########
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:
`eventBufferConsumer` -> `eventBufferConsumer.copy()`, to keep the
consistency with below action, and also avoid calling `copy` multiple times in
`ResultSubpartition#priorityEvent`.
----------------------------------------------------------------
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