public class JobVertex extends Object implements Serializable
| 限定符和类型 | 类和说明 |
|---|---|
static interface |
JobVertex.InitializeOnMasterContext |
| 限定符和类型 | 字段和说明 |
|---|---|
static int |
MAX_PARALLELISM_DEFAULT |
| 构造器和说明 |
|---|
JobVertex(String name)
Constructs a new job vertex and assigns it with the given name.
|
JobVertex(String name,
JobVertexID id)
Constructs a new job vertex and assigns it with the given name.
|
JobVertex(String name,
JobVertexID primaryId,
List<OperatorIDPair> operatorIDPairs)
Constructs a new job vertex and assigns it with the given name.
|
| 限定符和类型 | 方法和说明 |
|---|---|
void |
addIntermediateDataSetIdToConsume(IntermediateDataSetID intermediateDataSetId) |
void |
addOperatorCoordinator(org.apache.flink.util.SerializedValue<OperatorCoordinator.Provider> serializedCoordinatorProvider) |
JobEdge |
connectNewDataSetAsInput(JobVertex input,
DistributionPattern distPattern,
ResultPartitionType partitionType) |
JobEdge |
connectNewDataSetAsInput(JobVertex input,
DistributionPattern distPattern,
ResultPartitionType partitionType,
boolean isBroadcast) |
JobEdge |
connectNewDataSetAsInput(JobVertex input,
DistributionPattern distPattern,
ResultPartitionType partitionType,
IntermediateDataSetID intermediateDataSetId,
boolean isBroadcast) |
boolean |
containsSinks() |
boolean |
containsSources() |
void |
finalizeOnMaster(JobVertex.InitializeOnMasterContext context)
A hook that can be overwritten by sub classes to implement logic that is called by the master
after the job completed.
|
CoLocationGroup |
getCoLocationGroup() |
org.apache.flink.configuration.Configuration |
getConfiguration()
Returns the vertex's configuration object which can be used to pass custom settings to the
task at runtime.
|
JobVertexID |
getID()
Returns the ID of this job vertex.
|
List<JobEdge> |
getInputs() |
org.apache.flink.core.io.InputSplitSource<?> |
getInputSplitSource() |
List<IntermediateDataSetID> |
getIntermediateDataSetIdsToConsume() |
Class<? extends TaskInvokable> |
getInvokableClass(ClassLoader cl)
Returns the invokable class which represents the task of this vertex.
|
String |
getInvokableClassName()
Returns the name of the invokable class which represents the task of this vertex.
|
int |
getMaxParallelism()
Gets the maximum parallelism for the task.
|
org.apache.flink.api.common.operators.ResourceSpec |
getMinResources()
Gets the minimum resource for the task.
|
String |
getName()
Returns the name of the vertex.
|
int |
getNumberOfInputs()
Returns the number of inputs.
|
int |
getNumberOfProducedIntermediateDataSets()
Returns the number of produced intermediate data sets.
|
List<org.apache.flink.util.SerializedValue<OperatorCoordinator.Provider>> |
getOperatorCoordinators() |
String |
getOperatorDescription() |
List<OperatorIDPair> |
getOperatorIDs() |
String |
getOperatorName() |
String |
getOperatorPrettyName() |
IntermediateDataSet |
getOrCreateResultDataSet(IntermediateDataSetID id,
ResultPartitionType partitionType) |
int |
getParallelism()
Gets the parallelism of the task.
|
org.apache.flink.api.common.operators.ResourceSpec |
getPreferredResources()
Gets the preferred resource for the task.
|
List<IntermediateDataSet> |
getProducedDataSets() |
String |
getResultOptimizerProperties() |
SlotSharingGroup |
getSlotSharingGroup()
Gets the slot sharing group that this vertex is associated with.
|
boolean |
hasNoConnectedInputs() |
void |
initializeOnMaster(JobVertex.InitializeOnMasterContext context)
A hook that can be overwritten by sub classes to implement logic that is called by the master
when the job starts.
|
boolean |
isInputVertex() |
boolean |
isOutputVertex() |
boolean |
isStoppable() |
void |
markContainsSinks() |
void |
markContainsSources() |
void |
setInputSplitSource(org.apache.flink.core.io.InputSplitSource<?> inputSplitSource) |
void |
setInvokableClass(Class<? extends TaskInvokable> invokable) |
void |
setMaxParallelism(int maxParallelism)
Sets the maximum parallelism for the task.
|
void |
setName(String name)
Sets the name of the vertex.
|
void |
setOperatorDescription(String operatorDescription) |
void |
setOperatorName(String operatorName) |
void |
setOperatorPrettyName(String operatorPrettyName) |
void |
setParallelism(int parallelism)
Sets the parallelism for the task.
|
void |
setResources(org.apache.flink.api.common.operators.ResourceSpec minResources,
org.apache.flink.api.common.operators.ResourceSpec preferredResources)
Sets the minimum and preferred resources for the task.
|
void |
setResultOptimizerProperties(String resultOptimizerProperties) |
void |
setSlotSharingGroup(SlotSharingGroup grp)
Associates this vertex with a slot sharing group for scheduling.
|
void |
setStrictlyCoLocatedWith(JobVertex strictlyCoLocatedWith)
Tells this vertex to strictly co locate its subtasks with the subtasks of the given vertex.
|
String |
toString() |
void |
updateCoLocationGroup(CoLocationGroupImpl group) |
public static final int MAX_PARALLELISM_DEFAULT
public JobVertex(String name)
name - The name of the new job vertex.public JobVertex(String name, JobVertexID id)
name - The name of the new job vertex.id - The id of the job vertex.public JobVertex(String name, JobVertexID primaryId, List<OperatorIDPair> operatorIDPairs)
name - The name of the new job vertex.primaryId - The id of the job vertex.operatorIDPairs - The operator ID pairs of the job vertex.public JobVertexID getID()
public String getName()
public void setName(String name)
name - The new name.public int getNumberOfProducedIntermediateDataSets()
public int getNumberOfInputs()
public List<OperatorIDPair> getOperatorIDs()
public org.apache.flink.configuration.Configuration getConfiguration()
public void setInvokableClass(Class<? extends TaskInvokable> invokable)
public String getInvokableClassName()
null if not set.public Class<? extends TaskInvokable> getInvokableClass(ClassLoader cl)
cl - The classloader used to resolve user-defined classesnull if it is not setpublic int getParallelism()
public void setParallelism(int parallelism)
parallelism - The parallelism for the task.public int getMaxParallelism()
public void setMaxParallelism(int maxParallelism)
maxParallelism - The maximum parallelism to be set. must be between 1 and
Short.MAX_VALUE.public org.apache.flink.api.common.operators.ResourceSpec getMinResources()
public org.apache.flink.api.common.operators.ResourceSpec getPreferredResources()
public void setResources(org.apache.flink.api.common.operators.ResourceSpec minResources,
org.apache.flink.api.common.operators.ResourceSpec preferredResources)
minResources - The minimum resource for the task.preferredResources - The preferred resource for the task.public org.apache.flink.core.io.InputSplitSource<?> getInputSplitSource()
public void setInputSplitSource(org.apache.flink.core.io.InputSplitSource<?> inputSplitSource)
public List<IntermediateDataSet> getProducedDataSets()
public List<org.apache.flink.util.SerializedValue<OperatorCoordinator.Provider>> getOperatorCoordinators()
public void addOperatorCoordinator(org.apache.flink.util.SerializedValue<OperatorCoordinator.Provider> serializedCoordinatorProvider)
public void setSlotSharingGroup(SlotSharingGroup grp)
grp - The slot sharing group to associate the vertex with.public SlotSharingGroup getSlotSharingGroup()
public void setStrictlyCoLocatedWith(JobVertex strictlyCoLocatedWith)
NOTE: Co-location is only possible between vertices in a slot sharing group.
NOTE: This vertex must (transitively) depend on the vertex to be co-located with. That means that the respective vertex must be a (transitive) input of this vertex.
strictlyCoLocatedWith - The vertex whose subtasks to co-locate this vertex's subtasks
with.IllegalArgumentException - Thrown, if this vertex and the vertex to co-locate with are
not in a common slot sharing group.setSlotSharingGroup(SlotSharingGroup)@Nullable public CoLocationGroup getCoLocationGroup()
public void updateCoLocationGroup(CoLocationGroupImpl group)
public IntermediateDataSet getOrCreateResultDataSet(IntermediateDataSetID id, ResultPartitionType partitionType)
public JobEdge connectNewDataSetAsInput(JobVertex input, DistributionPattern distPattern, ResultPartitionType partitionType)
public JobEdge connectNewDataSetAsInput(JobVertex input, DistributionPattern distPattern, ResultPartitionType partitionType, boolean isBroadcast)
public JobEdge connectNewDataSetAsInput(JobVertex input, DistributionPattern distPattern, ResultPartitionType partitionType, IntermediateDataSetID intermediateDataSetId, boolean isBroadcast)
public boolean isInputVertex()
public boolean isStoppable()
public boolean isOutputVertex()
public boolean hasNoConnectedInputs()
public void markContainsSources()
public boolean containsSources()
public void markContainsSinks()
public boolean containsSinks()
public void initializeOnMaster(JobVertex.InitializeOnMasterContext context) throws Exception
context - Provides contextual information for the initializationException - The method may throw exceptions which cause the job to fail immediately.public void finalizeOnMaster(JobVertex.InitializeOnMasterContext context) throws Exception
context - Provides contextual information for the initializationException - The method may throw exceptions which cause the job to fail immediately.public String getOperatorName()
public void setOperatorName(String operatorName)
public String getOperatorDescription()
public void setOperatorDescription(String operatorDescription)
public void setOperatorPrettyName(String operatorPrettyName)
public String getOperatorPrettyName()
public String getResultOptimizerProperties()
public void setResultOptimizerProperties(String resultOptimizerProperties)
public void addIntermediateDataSetIdToConsume(IntermediateDataSetID intermediateDataSetId)
public List<IntermediateDataSetID> getIntermediateDataSetIdsToConsume()
Copyright © 2014–2022 The Apache Software Foundation. All rights reserved.