Skip to content

Commit 30ee971

Browse files
update ms.work.unit.parallelism.max to enable unlimited number of work units (#72)
* update ms.work.unit.parallelism.max to enable unlimited number of work units * add comments
1 parent 41f4c78 commit 30ee971

File tree

2 files changed

+16
-5
lines changed

2 files changed

+16
-5
lines changed

cdi-core/src/main/java/com/linkedin/cdi/configuration/PropertyCollection.java

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -247,12 +247,19 @@ public Long getMillis(State state) {
247247
}
248248
};
249249

250-
// default: 100, minimum: 0, maximum: 1000, 0 = default value
251-
IntegerProperties MSTAGE_WORK_UNIT_PARALLELISM_MAX = new IntegerProperties("ms.work.unit.parallelism.max", 500, 5000, 0) {
250+
// default: 100, minimum: -1, maximum: 1000, 0 = default value, -1 = max int
251+
IntegerProperties MSTAGE_WORK_UNIT_PARALLELISM_MAX = new IntegerProperties("ms.work.unit.parallelism.max", 500, 5000, -1) {
252252
@Override
253253
protected Integer getValidNonblankWithDefault(State state) {
254254
int value = super.getValidNonblankWithDefault(state);
255-
return value == 0 ? getDefaultValue() : value;
255+
switch (value) {
256+
case 0:
257+
return getDefaultValue();
258+
case -1:
259+
return Integer.MAX_VALUE;
260+
default:
261+
return value;
262+
}
256263
}
257264
};
258265

docs/parameters/ms.work.unit.parallelism.max.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,13 @@ will be processed in 1 job execution. In such case, the task executors will
5757
recursively process work units the same way based on thread pool size.
5858

5959
Therefore, unless there are 100s or more work units for a job, it is not necessary
60-
to set `ms.work.unit.parallelism.max`, or it can be set to 0 (default), which means no limit.
60+
to set `ms.work.unit.parallelism.max`, or it can be set to 0 (default), which means the default value mentioned above.
6161

62-
If ms.work.unit.parallelism.max is set to any value greater than 0, and there are
62+
If you don't want to impose a limit on the maximum number of work units, please set `ms.work.unit.parallelism.max`
63+
to -1. In this case, the limit will be set to 2147483647 (i.e., Integer.MAX_VALUE). Please note that this value is to be
64+
used by advanced users only as there is a chance of JVM going out of memory while creating the work units.
65+
66+
If ms.work.unit.parallelism.max is set to any value greater than or equal to 0, and there are
6367
more work units than ms.work.unit.parallelism.max, then the Gobblin job need to
6468
be executed repeatedly until all work units are processed.
6569

0 commit comments

Comments
 (0)