Aitozi commented on a change in pull request #8467: [FLINK-12535][network] Make CheckpointBarrierHandler non-blocking URL: https://github.com/apache/flink/pull/8467#discussion_r287606004
########## File path: flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/io/BarrierBuffer.java ########## @@ -152,37 +155,37 @@ public BarrierBuffer(InputGate inputGate, BufferBlocker bufferBlocker, long maxB this.queuedBuffered = new ArrayDeque<BufferOrEventSequence>(); } + @Override + public CompletableFuture<?> isAvailable() { + if (currentBuffered == null) { + return inputGate.isAvailable(); + } + return AVAILABLE; + } + // ------------------------------------------------------------------------ // Buffer and barrier handling // ------------------------------------------------------------------------ @Override - public BufferOrEvent getNextNonBlocked() throws Exception { + public Optional<BufferOrEvent> pollNext() throws Exception { Review comment: A question here: why have to change from `BufferOrEvent` to `Optional<BufferOrEvent>`, to avoid null check? ---------------------------------------------------------------- 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: us...@infra.apache.org With regards, Apache Git Services