Search in sources :

Example 1 with TestAnyModeReadingStreamOperator

use of org.apache.flink.streaming.util.TestAnyModeReadingStreamOperator in project flink by apache.

the class StreamTaskSelectiveReadingTest method testAnyOrderedReading.

@Test
public void testAnyOrderedReading() throws Exception {
    ConcurrentLinkedQueue<Object> expectedOutput = new ConcurrentLinkedQueue<>();
    expectedOutput.add(new StreamRecord<>("[Operator0-1]: Hello-1"));
    expectedOutput.add(new StreamRecord<>("[Operator0-2]: 1"));
    expectedOutput.add(new StreamRecord<>("[Operator0-1]: Hello-2"));
    expectedOutput.add(new StreamRecord<>("[Operator0-2]: 2"));
    expectedOutput.add(new StreamRecord<>("[Operator0-1]: Hello-3"));
    expectedOutput.add(new StreamRecord<>("[Operator0-2]: 3"));
    expectedOutput.add(new StreamRecord<>("[Operator0-2]: 4"));
    testBase(new TestAnyModeReadingStreamOperator("Operator0"), true, expectedOutput, true);
}
Also used : TestAnyModeReadingStreamOperator(org.apache.flink.streaming.util.TestAnyModeReadingStreamOperator) ConcurrentLinkedQueue(java.util.concurrent.ConcurrentLinkedQueue) Test(org.junit.Test)

Example 2 with TestAnyModeReadingStreamOperator

use of org.apache.flink.streaming.util.TestAnyModeReadingStreamOperator in project flink by apache.

the class StreamTaskSelectiveReadingTest method testAnyUnorderedReading.

@Test
public void testAnyUnorderedReading() throws Exception {
    ConcurrentLinkedQueue<Object> expectedOutput = new ConcurrentLinkedQueue<>();
    expectedOutput.add(new StreamRecord<>("[Operator0-1]: Hello-1"));
    expectedOutput.add(new StreamRecord<>("[Operator0-2]: 1"));
    expectedOutput.add(new StreamRecord<>("[Operator0-1]: Hello-2"));
    expectedOutput.add(new StreamRecord<>("[Operator0-2]: 2"));
    expectedOutput.add(new StreamRecord<>("[Operator0-1]: Hello-3"));
    expectedOutput.add(new StreamRecord<>("[Operator0-2]: 3"));
    expectedOutput.add(new StreamRecord<>("[Operator0-2]: 4"));
    testBase(new TestAnyModeReadingStreamOperator("Operator0"), false, expectedOutput, false);
}
Also used : TestAnyModeReadingStreamOperator(org.apache.flink.streaming.util.TestAnyModeReadingStreamOperator) ConcurrentLinkedQueue(java.util.concurrent.ConcurrentLinkedQueue) Test(org.junit.Test)

Example 3 with TestAnyModeReadingStreamOperator

use of org.apache.flink.streaming.util.TestAnyModeReadingStreamOperator in project flink by apache.

the class StreamingJobGraphGeneratorTest method testNotSupportInputSelectableOperatorIfCheckpointing.

@Test(expected = UnsupportedOperationException.class)
public void testNotSupportInputSelectableOperatorIfCheckpointing() {
    StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();
    env.enableCheckpointing(60_000L);
    DataStreamSource<String> source1 = env.fromElements("1");
    DataStreamSource<Integer> source2 = env.fromElements(1);
    source1.connect(source2).transform("test", BasicTypeInfo.STRING_TYPE_INFO, new TestAnyModeReadingStreamOperator("test operator")).print();
    StreamingJobGraphGenerator.createJobGraph(env.getStreamGraph());
}
Also used : TestAnyModeReadingStreamOperator(org.apache.flink.streaming.util.TestAnyModeReadingStreamOperator) StreamExecutionEnvironment(org.apache.flink.streaming.api.environment.StreamExecutionEnvironment) Test(org.junit.Test)

Aggregations

TestAnyModeReadingStreamOperator (org.apache.flink.streaming.util.TestAnyModeReadingStreamOperator)3 Test (org.junit.Test)3 ConcurrentLinkedQueue (java.util.concurrent.ConcurrentLinkedQueue)2 StreamExecutionEnvironment (org.apache.flink.streaming.api.environment.StreamExecutionEnvironment)1