rightParentParams);
// lower bound
final int minParallelism = estimateMinParallelism(leftParentParams, rightParentParams);
if (minParallelism > parallelism)
throw new ImproperParallelismException("Component " + currentCompName
+ " cannot have parallelism LESS than " + minParallelism);
// upper bound
final int maxParallelism = estimateDistinctHashes(leftParentParams, rightParentParams);
if (parallelism > maxParallelism)
if (leftParallelism == 1 && rightParallelism == 1)
// if parallelism of both parents is 1, then we should not raise
// an exception
// exception serves to force smaller parallelism at sources
parallelism = maxParallelism;
else
throw new ImproperParallelismException("Component " + currentCompName
+ " cannot have parallelism MORE than " + maxParallelism);
// setting
params.setParallelism(parallelism);