|
24 | 24 | import org.apache.flink.api.common.operators.ProcessingTimeService.ProcessingTimeCallback; |
25 | 25 | import org.apache.flink.api.common.state.CheckpointListener; |
26 | 26 | import org.apache.flink.api.common.typeinfo.BasicTypeInfo; |
27 | | -import org.apache.flink.api.common.typeinfo.IntegerTypeInfo; |
28 | 27 | import org.apache.flink.api.common.typeutils.TypeSerializer; |
29 | 28 | import org.apache.flink.configuration.Configuration; |
30 | 29 | import org.apache.flink.configuration.ReadableConfig; |
|
58 | 57 | import org.apache.flink.runtime.io.network.api.writer.RecordWriterDelegate; |
59 | 58 | import org.apache.flink.runtime.io.network.api.writer.ResultPartitionWriter; |
60 | 59 | import org.apache.flink.runtime.io.network.api.writer.SingleRecordWriter; |
61 | | -import org.apache.flink.runtime.io.network.partition.ResultPartitionType; |
| 60 | +import org.apache.flink.runtime.io.network.partition.MockResultPartitionWriter; |
62 | 61 | import org.apache.flink.runtime.io.network.partition.consumer.IndexedInputGate; |
63 | 62 | import org.apache.flink.runtime.io.network.partition.consumer.InputGate; |
64 | 63 | import org.apache.flink.runtime.io.network.partition.consumer.TestInputChannel; |
65 | | -import org.apache.flink.runtime.jobgraph.IntermediateDataSetID; |
66 | 64 | import org.apache.flink.runtime.jobgraph.OperatorID; |
67 | 65 | import org.apache.flink.runtime.jobgraph.tasks.TaskInvokable; |
68 | 66 | import org.apache.flink.runtime.metrics.TimerGauge; |
|
117 | 115 | import org.apache.flink.streaming.api.checkpoint.CheckpointedFunction; |
118 | 116 | import org.apache.flink.streaming.api.functions.source.RichParallelSourceFunction; |
119 | 117 | import org.apache.flink.streaming.api.functions.source.SourceFunction; |
120 | | -import org.apache.flink.streaming.api.graph.NonChainedOutput; |
121 | 118 | import org.apache.flink.streaming.api.graph.StreamConfig; |
122 | 119 | import org.apache.flink.streaming.api.operators.AbstractStreamOperator; |
123 | 120 | import org.apache.flink.streaming.api.operators.InternalTimeServiceManager; |
|
143 | 140 | import org.apache.flink.util.ExceptionUtils; |
144 | 141 | import org.apache.flink.util.FatalExitExceptionHandler; |
145 | 142 | import org.apache.flink.util.FlinkRuntimeException; |
146 | | -import org.apache.flink.util.OutputTag; |
147 | 143 | import org.apache.flink.util.TestLogger; |
148 | 144 | import org.apache.flink.util.clock.SystemClock; |
149 | 145 | import org.apache.flink.util.concurrent.FutureUtils; |
@@ -1835,24 +1831,16 @@ public void testForwardPartitionerIsConvertedToRebalanceOnParallelismChanges() |
1835 | 1831 | .getChannelSelector() |
1836 | 1832 | instanceof ForwardPartitioner); |
1837 | 1833 |
|
1838 | | - // Change consumer parallelism |
1839 | | - harness.streamTask.configuration.setVertexNonChainedOutputs( |
1840 | | - Arrays.asList( |
1841 | | - new NonChainedOutput( |
1842 | | - false, |
1843 | | - 0, |
1844 | | - // Set a different consumer parallelism to force trigger |
1845 | | - // replacing the ForwardPartitioner |
1846 | | - 42, |
1847 | | - 100, |
1848 | | - 1000, |
1849 | | - false, |
1850 | | - new IntermediateDataSetID(), |
1851 | | - new OutputTag<>("output", IntegerTypeInfo.INT_TYPE_INFO), |
1852 | | - // Use forward partitioner |
1853 | | - new ForwardPartitioner<>(), |
1854 | | - ResultPartitionType.PIPELINED))); |
1855 | | - harness.streamTask.configuration.serializeAllConfigs(); |
| 1834 | + // Simulate changed downstream task parallelism (1->2) |
| 1835 | + List<ResultPartitionWriter> newOutputs = new ArrayList<>(); |
| 1836 | + newOutputs.add( |
| 1837 | + new MockResultPartitionWriter() { |
| 1838 | + @Override |
| 1839 | + public int getNumberOfSubpartitions() { |
| 1840 | + return 2; |
| 1841 | + } |
| 1842 | + }); |
| 1843 | + harness.streamMockEnvironment.setOutputs(newOutputs); |
1856 | 1844 |
|
1857 | 1845 | // Re-create outputs |
1858 | 1846 | recordWriterDelegate = |
|
0 commit comments