ericxiao251 commented on code in PR #22438:
URL: https://github.com/apache/flink/pull/22438#discussion_r1177975477
##########
flink-streaming-java/src/test/java/org/apache/flink/streaming/api/graph/StreamingJobGraphGeneratorTest.java:
##########
@@ -283,6 +283,25 @@ public void testTransformationSetParallelism() {
assertThat(vertices.get(2).isParallelismConfigured()).isTrue();
}
+ @Test
+ public void testTransformationSetMaxParallelism() {
+ StreamExecutionEnvironment env =
StreamExecutionEnvironment.getExecutionEnvironment();
+ /* The max parallelism of the environment (that is inherited by the
source)
+ and the parallelism of the map operator needs to be different for this
test */
+ env.setMaxParallelism(4);
+ env.fromSequence(1L, 3L).map(i ->
i).setMaxParallelism(10).print().setMaxParallelism(20);
Review Comment:
Oh interesting, DataStreamSink doesn't have `getId()` as well. I will use
`sink.getTransformation().getId()` like how we do it in `DataStreamTest`:
https://github.com/apache/flink/blob/master/flink-streaming-java/src/test/java/org/apache/flink/streaming/api/DataStreamTest.java#L820
##########
flink-streaming-java/src/test/java/org/apache/flink/streaming/api/graph/StreamingJobGraphGeneratorTest.java:
##########
@@ -283,6 +283,25 @@ public void testTransformationSetParallelism() {
assertThat(vertices.get(2).isParallelismConfigured()).isTrue();
}
+ @Test
+ public void testTransformationSetMaxParallelism() {
+ StreamExecutionEnvironment env =
StreamExecutionEnvironment.getExecutionEnvironment();
+ /* The max parallelism of the environment (that is inherited by the
source)
+ and the parallelism of the map operator needs to be different for this
test */
+ env.setMaxParallelism(4);
+ env.fromSequence(1L, 3L).map(i ->
i).setMaxParallelism(10).print().setMaxParallelism(20);
Review Comment:
Oh interesting, DataStreamSink doesn't have `getId()`. I will use
`sink.getTransformation().getId()` like how we do it in `DataStreamTest`:
https://github.com/apache/flink/blob/master/flink-streaming-java/src/test/java/org/apache/flink/streaming/api/DataStreamTest.java#L820
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]