You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Computing the newParallelism. In general, newParallelism = currentParallelism * scaleFactor.
255
+
* But we limit newParallelism between parallelismLowerLimit and min(parallelismUpperLimit,
256
+
* maxParallelism).
257
+
*
258
+
* <p>Also, in order to ensure the data is evenly spread across subtasks, we try to adjust the
259
+
* parallelism for source and keyed vertex such that it divides the maxParallelism without a
260
+
* remainder.
261
+
*/
248
262
@VisibleForTesting
249
263
protectedstaticintscale(
250
-
intparallelism,
251
-
intnumKeyGroups,
264
+
intcurrentParallelism,
265
+
Collection<ShipStrategy> inputShipStrategies,
266
+
intmaxParallelism,
252
267
doublescaleFactor,
253
-
intminParallelism,
254
-
intmaxParallelism) {
268
+
intparallelismLowerLimit,
269
+
intparallelismUpperLimit) {
255
270
Preconditions.checkArgument(
256
-
minParallelism <= maxParallelism,
257
-
"The minimum parallelism must not be greater than the maximum parallelism.");
258
-
if (minParallelism > numKeyGroups) {
271
+
parallelismLowerLimit <= parallelismUpperLimit,
272
+
"The parallelism lower limitation must not be greater than the parallelism upper limitation.");
273
+
if (parallelismLowerLimit > maxParallelism) {
259
274
LOG.warn(
260
275
"Specified autoscaler minimum parallelism {} is greater than the operator max parallelism {}. The min parallelism will be set to the operator max parallelism.",
261
-
minParallelism,
262
-
numKeyGroups);
276
+
parallelismLowerLimit,
277
+
maxParallelism);
263
278
}
264
-
if (numKeyGroups < maxParallelism && maxParallelism != Integer.MAX_VALUE) {
279
+
if (maxParallelism < parallelismUpperLimit && parallelismUpperLimit != Integer.MAX_VALUE) {
265
280
LOG.debug(
266
281
"Specified autoscaler maximum parallelism {} is greater than the operator max parallelism {}. This means the operator max parallelism can never be reached.",
267
-
maxParallelism,
268
-
numKeyGroups);
282
+
parallelismUpperLimit,
283
+
maxParallelism);
269
284
}
270
285
271
286
intnewParallelism =
272
287
// Prevent integer overflow when converting from double to integer.
273
288
// We do not have to detect underflow because doubles cannot
0 commit comments