Search in sources :

Example 1 with NoOpIntMap

use of org.apache.flink.test.streaming.runtime.util.NoOpIntMap in project flink by apache.

the class PartitionerITCase method testForwardFailsHightToLowParallelism.

@Test(expected = UnsupportedOperationException.class)
public void testForwardFailsHightToLowParallelism() throws Exception {
    StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();
    // this does a rebalance that works
    DataStream<Integer> src = env.fromElements(1, 2, 3).map(new NoOpIntMap());
    // this doesn't work because it goes from 3 to 1
    src.forward().map(new NoOpIntMap()).setParallelism(1);
    env.execute();
}
Also used : NoOpIntMap(org.apache.flink.test.streaming.runtime.util.NoOpIntMap) StreamExecutionEnvironment(org.apache.flink.streaming.api.environment.StreamExecutionEnvironment) Test(org.junit.Test)

Example 2 with NoOpIntMap

use of org.apache.flink.test.streaming.runtime.util.NoOpIntMap in project flink by apache.

the class PartitionerITCase method testForwardFailsLowToHighParallelism.

@Test(expected = UnsupportedOperationException.class)
public void testForwardFailsLowToHighParallelism() throws Exception {
    StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();
    DataStream<Integer> src = env.fromElements(1, 2, 3);
    // this doesn't work because it goes from 1 to 3
    src.forward().map(new NoOpIntMap());
    env.execute();
}
Also used : NoOpIntMap(org.apache.flink.test.streaming.runtime.util.NoOpIntMap) StreamExecutionEnvironment(org.apache.flink.streaming.api.environment.StreamExecutionEnvironment) Test(org.junit.Test)

Aggregations

StreamExecutionEnvironment (org.apache.flink.streaming.api.environment.StreamExecutionEnvironment)2 NoOpIntMap (org.apache.flink.test.streaming.runtime.util.NoOpIntMap)2 Test (org.junit.Test)2