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 andJobVertexInputInfo
s as follows:1. We will first attempt to: evenly distribute data to downstream subtasks, make different downstream subtasks consume roughly the same amount of data.
2. If step 1 fails or is not applicable, we will proceed to: 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 int
computeSourceParallelismUpperBound(JobVertexID jobVertexId, int maxParallelism)
Compute source parallelism upper bound for the source vertex.ParallelismAndInputInfos
decideParallelismAndInputInfosForVertex(JobVertexID jobVertexId, List<BlockingInputInfo> consumedResults, int vertexInitialParallelism, int vertexMinParallelism, int vertexMaxParallelism)
Decide the parallelism andJobVertexInputInfo
s for this job vertex.long
getDataVolumePerTask()
Get the average size of data volume to expect each task instance to process.
-
-
-
Method Detail
-
decideParallelismAndInputInfosForVertex
public ParallelismAndInputInfos decideParallelismAndInputInfosForVertex(JobVertexID jobVertexId, List<BlockingInputInfo> consumedResults, int vertexInitialParallelism, int vertexMinParallelism, int vertexMaxParallelism)
Description copied from interface:VertexParallelismAndInputInfosDecider
Decide the parallelism andJobVertexInputInfo
s for this job vertex.- Specified by:
decideParallelismAndInputInfosForVertex
in 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:VertexParallelismAndInputInfosDecider
Compute source parallelism upper bound for the source vertex.- Specified by:
computeSourceParallelismUpperBound
in 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:VertexParallelismAndInputInfosDecider
Get the average size of data volume to expect each task instance to process.- Specified by:
getDataVolumePerTask
in interfaceVertexParallelismAndInputInfosDecider
- Returns:
- the data volume.
-
-