aljoscha commented on a change in pull request #13944:
URL: https://github.com/apache/flink/pull/13944#discussion_r518658225



##########
File path: 
flink-streaming-java/src/main/java/org/apache/flink/streaming/api/environment/LocalStreamEnvironment.java
##########
@@ -66,6 +66,9 @@ private static Configuration 
validateAndGetConfiguration(final Configuration con
                final Configuration effectiveConfiguration = new 
Configuration(checkNotNull(configuration));
                effectiveConfiguration.set(DeploymentOptions.TARGET, "local");
                effectiveConfiguration.set(DeploymentOptions.ATTACHED, true);
+               if 
(!configuration.getOptional(CoreOptions.DEFAULT_PARALLELISM).isPresent()) {

Review comment:
       Why is this needed?

##########
File path: 
flink-streaming-java/src/main/java/org/apache/flink/streaming/api/environment/StreamExecutionEnvironment.java
##########
@@ -2043,9 +2044,23 @@ public void addOperator(Transformation<?> 
transformation) {
         * executed.
         */
        public static StreamExecutionEnvironment getExecutionEnvironment() {
+               return getExecutionEnvironment(new Configuration());
+       }
+
+       /**
+        * Creates an execution environment that represents the context in 
which the
+        * program is currently executed. If the program is invoked standalone, 
this
+        * method returns a local execution environment, as returned by
+        * {@link #createLocalEnvironment(Configuration)}.

Review comment:
       We should mention that the `Configuration` is (potentially) "layered" on 
top of a base configuration or merged with it.

##########
File path: 
flink-tests/src/test/java/org/apache/flink/api/datastream/DataStreamBatchExecutionITCase.java
##########
@@ -127,17 +130,17 @@ public void batchSumSingleResultPerKey() throws Exception 
{
        }
 
        private StreamExecutionEnvironment getExecutionEnvironment() {
-               final StreamExecutionEnvironment env = 
StreamExecutionEnvironment.getExecutionEnvironment();
 
                Configuration config = new Configuration();
                config.set(ExecutionOptions.RUNTIME_MODE, 
RuntimeExecutionMode.BATCH);
-               env.configure(config, 
DataStreamBatchExecutionITCase.class.getClassLoader());
+               config.set(CoreOptions.DEFAULT_PARALLELISM, 1);

Review comment:
       So you prefer `config.set(CoreOptions.DEFAULT_PARALLELISM, 1);` to 
`env.setParallelism(1)`? 😅




----------------------------------------------------------------
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]


Reply via email to