pnowojski commented on a change in pull request #8467: [FLINK-12535][network]
Make CheckpointBarrierHandler non-blocking
URL: https://github.com/apache/flink/pull/8467#discussion_r287723725
##########
File path:
flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/io/StreamInputProcessor.java
##########
@@ -206,27 +207,35 @@ public boolean processInput() throws Exception {
}
}
- final BufferOrEvent bufferOrEvent =
barrierHandler.getNextNonBlocked();
- if (bufferOrEvent != null) {
- if (bufferOrEvent.isBuffer()) {
- currentChannel =
bufferOrEvent.getChannelIndex();
- currentRecordDeserializer =
recordDeserializers[currentChannel];
-
currentRecordDeserializer.setNextBuffer(bufferOrEvent.getBuffer());
- }
- else {
- // Event received
- final AbstractEvent event =
bufferOrEvent.getEvent();
- if (event.getClass() !=
EndOfPartitionEvent.class) {
- throw new
IOException("Unexpected event: " + event);
+ final Optional<BufferOrEvent> bufferOrEvent =
barrierHandler.pollNext();
+ if (bufferOrEvent.isPresent()) {
+ processBufferOrEvent(bufferOrEvent.get());
+ } else {
+ if (!barrierHandler.isFinished()) {
+ barrierHandler.isAvailable().get();
Review comment:
@Aitozi at the moment yes. To make it work correctly with mailbox thread,
this change of non blocking `BarrierHandler` has to be integrated with pending
@StefanRRichter 's PR.
----------------------------------------------------------------
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