/** * Sets the parallelism for the task. * * @param parallelism The parallelism for the task. */ public void setParallelism(int parallelism) { if (parallelism < 1) { throw new IllegalArgumentException("The parallelism must be at least one."); } this.parallelism = parallelism; // Clear the consumer execution vertices cache for related edges for (JobEdge edge : getInputs()) { edge.clearConsumerExecutionVerticesCache(); } for (IntermediateDataSet dataSet : getProducedDataSets()) { for (JobEdge edge :dataSet.getConsumers()) { edge.clearConsumerExecutionVerticesCache(); } } }