[
https://issues.apache.org/jira/browse/FLINK-6058?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15932591#comment-15932591
]
ASF GitHub Bot commented on FLINK-6058:
---------------------------------------
Github user aljoscha commented on the issue:
https://github.com/apache/flink/pull/3561
Thanks for reminding, @uce 😃 Already had this on my list.
The only code that reads the DEFAULT_PARALLELISM from the config should be
in this piece of code in `CliFrontend`:
https://github.com/apache/flink/blob/master/flink-clients/src/main/java/org/apache/flink/client/CliFrontend.java#L250.
Here, we should check whether the user directly specified a parallelism and if
not read the one from the config. From there the parameter is already passed to
`ClusterClient.run()` where a a `ContextEnvironmentFactory` is being created.
In `ContextEnvironmentFactory.createExecutionEnvironment()` we would thus have
this parallelism.
The question now is whether to keep the
`lastEnvCreated.setParallelism(defaultParallelism)` or pass the default
parallelism to the `ContextEnvironment` so that the
`StreamExecutionEnvironment` can pick it up from there in the constructor. The
problem with calling `env.setParallelism()` is that the default parallelism
will be "forgotten" if the user calls `env.setParallelism(PARALLELISM_DEFAULT)`
where `ExecutionConfig.PARALLELISM_DEFAULT == -1`. If we manually store the
default parallelism in an extra field we would keep it. This seems to be the
nicer solution.
> Don't read DEFAULT_PARALLELISM from GlobalConfiguration
> -------------------------------------------------------
>
> Key: FLINK-6058
> URL: https://issues.apache.org/jira/browse/FLINK-6058
> Project: Flink
> Issue Type: Improvement
> Components: DataStream API
> Reporter: Aljoscha Krettek
> Priority: Blocker
> Fix For: 1.3.0
>
>
> In the constructor of {{StreamContextEnvironment}} we read the
> {{DEFAULT_PARALLELISM}} from the {{GlobalConfiguration}}. This assumes that
> the environment variables are correctly set and can lead to problems. We
> should read the default parallelism in the client and set it in the
> {{ContextEnvironment}} that it creates. This can then be read by the
> {{StreamContextEnvironment}}.
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)