Class DefaultVertexParallelismAndInputInfosDecider
- java.lang.Object
-
- org.apache.flink.runtime.scheduler.adaptivebatch.DefaultVertexParallelismAndInputInfosDecider
-
- All Implemented Interfaces:
VertexParallelismAndInputInfosDecider
public class DefaultVertexParallelismAndInputInfosDecider extends Object implements VertexParallelismAndInputInfosDecider
Default implementation ofVertexParallelismAndInputInfosDecider. This implementation will decide parallelism andJobVertexInputInfos as follows:1. For job vertices whose inputs are all ALL_TO_ALL edges, evenly distribute data to downstream subtasks, make different downstream subtasks consume roughly the same amount of data.
2. For other cases, evenly distribute subpartitions to downstream subtasks, make different downstream subtasks consume roughly the same number of subpartitions.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcomputeSourceParallelismUpperBound(JobVertexID jobVertexId, int maxParallelism)Compute source parallelism upper bound for the source vertex.ParallelismAndInputInfosdecideParallelismAndInputInfosForVertex(JobVertexID jobVertexId, List<BlockingResultInfo> consumedResults, int vertexInitialParallelism, int vertexMinParallelism, int vertexMaxParallelism)Decide the parallelism andJobVertexInputInfos for this job vertex.longgetDataVolumePerTask()Get the average size of data volume to expect each task instance to process.
-
-
-
Method Detail
-
decideParallelismAndInputInfosForVertex
public ParallelismAndInputInfos decideParallelismAndInputInfosForVertex(JobVertexID jobVertexId, List<BlockingResultInfo> consumedResults, int vertexInitialParallelism, int vertexMinParallelism, int vertexMaxParallelism)
Description copied from interface:VertexParallelismAndInputInfosDeciderDecide the parallelism andJobVertexInputInfos for this job vertex.- Specified by:
decideParallelismAndInputInfosForVertexin interfaceVertexParallelismAndInputInfosDecider- Parameters:
jobVertexId- The job vertex idconsumedResults- The information of consumed blocking resultsvertexInitialParallelism- The initial parallelism of the job vertex. If it's a positive number, it will be respected. If it's not set(equals toExecutionConfig.PARALLELISM_DEFAULT), a parallelism will be automatically decided for the vertex.vertexMinParallelism- The min parallelism of the job vertex.vertexMaxParallelism- The max parallelism of the job vertex.- Returns:
- the parallelism and vertex input infos.
-
computeSourceParallelismUpperBound
public int computeSourceParallelismUpperBound(JobVertexID jobVertexId, int maxParallelism)
Description copied from interface:VertexParallelismAndInputInfosDeciderCompute source parallelism upper bound for the source vertex.- Specified by:
computeSourceParallelismUpperBoundin interfaceVertexParallelismAndInputInfosDecider- Parameters:
jobVertexId- The job vertex idmaxParallelism- The max parallelism of the job vertex.- Returns:
- the upper bound parallelism for the source vertex.
-
getDataVolumePerTask
public long getDataVolumePerTask()
Description copied from interface:VertexParallelismAndInputInfosDeciderGet the average size of data volume to expect each task instance to process.- Specified by:
getDataVolumePerTaskin interfaceVertexParallelismAndInputInfosDecider- Returns:
- the data volume.
-
-