Github user StefanRRichter commented on a diff in the pull request:

    https://github.com/apache/flink/pull/5423#discussion_r167622468
  
    --- Diff: 
flink-runtime/src/main/java/org/apache/flink/runtime/io/network/partition/consumer/InputGate.java
 ---
    @@ -72,7 +73,19 @@
     
        void requestPartitions() throws IOException, InterruptedException;
     
    -   BufferOrEvent getNextBufferOrEvent() throws IOException, 
InterruptedException;
    +   /**
    +    * Blocking call waiting for next {@link BufferOrEvent}.
    +    *
    +    * @return {@code Optional.empty()} if {@link #isFinished()} returns 
true.
    +    */
    +   Optional<BufferOrEvent> getNextBufferOrEvent() throws IOException, 
InterruptedException;
    --- End diff --
    
    From the description and also to better contrast against 
`pollNextBufferOrEvent ()`, it almost feels like this method should always 
return a `BufferOrEvent` and rather throw an exception if `isFinished()`. This 
seems to be how the empty optional is translated anyways, see 
AbstractRecordReader which reacts with `IllegalStateException`.


---

Reply via email to