sunhaibotb commented on a change in pull request #8731: [FLINK-11878][runtime] 
Implement the runtime handling of BoundedOneInput and BoundedMultiInput
URL: https://github.com/apache/flink/pull/8731#discussion_r293793699
 
 

 ##########
 File path: 
flink-streaming-java/src/test/java/org/apache/flink/streaming/runtime/tasks/OneInputStreamTaskTest.java
 ##########
 @@ -1011,5 +1065,70 @@ protected void handleWatermark(Watermark mark) {
                        output.emitWatermark(mark);
                }
        }
+
+       /**
+        * Uses to test handling the EndOfInput notification.
+        */
+       static class TestBoundedOneInputOperator extends 
AbstractStreamOperator<String>
+               implements OneInputStreamOperator<String, String>, 
BoundedOneInput {
+
+               private static final long serialVersionUID = 1L;
+
+               private final String name;
+
+               private volatile int outputRecords;
+
+               private static final CompletableFuture<Void> success = 
CompletableFuture.completedFuture(null);
+               private static final CompletableFuture<Void> failure = 
FutureUtils.completedExceptionally(
+                       new Exception("Not in line with expectation."));
+
+               public TestBoundedOneInputOperator(String name) {
+                       this.name = name;
+               }
+
+               @Override
+               public void processElement(StreamRecord<String> element) {
+                       output.collect(element);
+                       outputRecords++;
+
+                       synchronized (this) {
+                               this.notifyAll();
+                       }
+               }
+
+               @Override
+               public void endInput() {
+                       output.collect(new StreamRecord<>("[" + name + "]: 
Bye"));
+                       outputRecords++;
+
+                       synchronized (this) {
+                               this.notifyAll();
+                       }
+               }
+
+               public void waitOutputRecords(int expectedRecords) throws 
Exception {
 
 Review comment:
   This test was written a long time ago, when it was needed. Now not needed, 
and I will remove it. 

----------------------------------------------------------------
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

Reply via email to