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_r293748963
##########
File path:
flink-streaming-java/src/test/java/org/apache/flink/streaming/runtime/tasks/TwoInputStreamTaskTest.java
##########
@@ -596,6 +602,66 @@ public TaskMetricGroup getMetricGroup() {
testHarness.waitForTaskCompletion();
}
+ @Test
+ public void testHandlingEndOfInput() throws Exception {
+ final TwoInputStreamTaskTestHarness<String, String, String>
testHarness = new TwoInputStreamTaskTestHarness<>(
+ isInputSelectable ? TwoInputSelectableStreamTask::new :
TwoInputStreamTask::new,
+ 3, 2, new int[] {1, 2, 2},
+ BasicTypeInfo.STRING_TYPE_INFO,
BasicTypeInfo.STRING_TYPE_INFO, BasicTypeInfo.STRING_TYPE_INFO);
+
+ testHarness
+ .setupOperatorChain(
+ new OperatorID(),
+ isInputSelectable ? new
TestBoundedAndSelectableTwoInputOperator("Operator0") : new
TestBoundedTwoInputOperator("Operator0"))
+ .chain(
+ new OperatorID(),
+ new
OneInputStreamTaskTest.TestBoundedOneInputOperator("Operator1"),
+
BasicTypeInfo.STRING_TYPE_INFO.createSerializer(new ExecutionConfig()))
+ .finish();
+
+ ConcurrentLinkedQueue<Object> expectedOutput = new
ConcurrentLinkedQueue<Object>();
+
+ testHarness.invoke();
+ testHarness.waitForTaskRunning();
+
+ TestBoundedTwoInputOperator headOperator =
(TestBoundedTwoInputOperator) testHarness.getTask().headOperator;
+
+ testHarness.processElement(new StreamRecord<>("Hello-1"), 0, 0);
Review comment:
`StreamTwoInputProcessor` has not been changed to use
`StreamTaskNetworkInput`, whether the inputs are finished is judged by two
added BitSet members, so `inputGate` and `channel` parameters need to be
passed to verify the correctness of this logic.
----------------------------------------------------------------
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