Skip to content

Commit 5ed887b

Browse files
committed
[FLINK-37440] Fix the bug that parallelism.default do not always adopts 1 as the default value.
1 parent a0f07fe commit 5ed887b

File tree

5 files changed

+22
-4
lines changed

5 files changed

+22
-4
lines changed

docs/content/docs/dev/datastream/execution/execution_configuration.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ The following configuration options are available: (the default is bold)
5151
With the closure cleaner disabled, it might happen that an anonymous user function is referencing the surrounding class, which is usually not Serializable. This will lead to exceptions by the serializer. The settings are:
5252
`NONE`: disable the closure cleaner completely, `TOP_LEVEL`: clean only the top-level class without recursing into fields, `RECURSIVE`: clean all the fields recursively.
5353

54-
- `getParallelism()` / `setParallelism(int parallelism)` Set the default parallelism for the job.
54+
- `getParallelism()` / `setParallelism(int parallelism)` Set the default parallelism for the job. There are two special cases. In the first case, when creating a LocalStreamEnvironment without specifying parallelism.default, the number of processors available to the Java virtual machine will be used. In the second case, when creating mini cluster without specifying parallelism.default, the total number of slots in mini cluster will be used.
5555

5656
- `getMaxParallelism()` / `setMaxParallelism(int parallelism)` Set the default maximum parallelism for the job. This setting determines the maximum degree of parallelism and specifies the upper limit for dynamic scaling.
5757

docs/layouts/shortcodes/generated/core_configuration.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@
7474
<td><h5>parallelism.default</h5></td>
7575
<td style="word-wrap: break-word;">1</td>
7676
<td>Integer</td>
77-
<td>Default parallelism for jobs.</td>
77+
<td>Default parallelism for jobs. There are two special cases. In the first case, when creating a LocalStreamEnvironment without specifying parallelism.default, the number of processors available to the Java virtual machine will be used. In the second case, when creating mini cluster without specifying parallelism.default, the total number of slots in mini cluster will be used.</td>
7878
</tr>
7979
</tbody>
8080
</table>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<table class="configuration table table-bordered">
2+
<thead>
3+
<tr>
4+
<th class="text-left" style="width: 20%">Key</th>
5+
<th class="text-left" style="width: 15%">Default</th>
6+
<th class="text-left" style="width: 10%">Type</th>
7+
<th class="text-left" style="width: 55%">Description</th>
8+
</tr>
9+
</thead>
10+
<tbody>
11+
<tr>
12+
<td><h5>sink.committer.retries</h5></td>
13+
<td style="word-wrap: break-word;">10</td>
14+
<td>Integer</td>
15+
<td>The number of retries a Flink application attempts for committable operations (such as transactions) on retriable errors, as specified by the sink connector, before Flink fails and potentially restarts.</td>
16+
</tr>
17+
</tbody>
18+
</table>

flink-clients/src/test/java/org/apache/flink/client/program/ClientTest.java

-1
Original file line numberDiff line numberDiff line change
@@ -495,7 +495,6 @@ public boolean isCompatibleWith(@Nonnull Configuration configuration) {
495495
@Override
496496
public PipelineExecutor getExecutor(@Nonnull Configuration configuration) {
497497
return (pipeline, config, classLoader) -> {
498-
final int parallelism = config.get(CoreOptions.DEFAULT_PARALLELISM);
499498
final JobGraph jobGraph = streamGraph.getJobGraph();
500499
// The job graphs from different cases are generated from the same stream
501500
// graph, resulting in the same job ID, which can lead to exceptions.

flink-core/src/main/java/org/apache/flink/configuration/CoreOptions.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -470,7 +470,8 @@ public static String[] mergeListsToArray(List<String> base, List<String> append)
470470
ConfigOptions.key("parallelism.default")
471471
.intType()
472472
.defaultValue(1)
473-
.withDescription("Default parallelism for jobs.");
473+
.withDescription(
474+
"Default parallelism for jobs. There are two special cases. In the first case, when creating a LocalStreamEnvironment without specifying parallelism.default, the number of processors available to the Java virtual machine will be used. In the second case, when creating mini cluster without specifying parallelism.default, the total number of slots in mini cluster will be used.");
474475

475476
// ------------------------------------------------------------------------
476477
// file systems

0 commit comments

Comments
 (0)