public class JobVertex extends Object implements Serializable
Constructor and Description |
---|
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.
|
Modifier and Type | Method and Description |
---|---|
void |
addOperatorCoordinator(SerializedValue<OperatorCoordinator.Provider> serializedCoordinatorProvider) |
JobEdge |
connectDataSetAsInput(IntermediateDataSet dataSet,
DistributionPattern distPattern) |
void |
connectIdInput(IntermediateDataSetID dataSetId,
DistributionPattern distPattern) |
JobEdge |
connectNewDataSetAsInput(JobVertex input,
DistributionPattern distPattern,
ResultPartitionType partitionType) |
IntermediateDataSet |
createAndAddResultDataSet(IntermediateDataSetID id,
ResultPartitionType partitionType) |
IntermediateDataSet |
createAndAddResultDataSet(ResultPartitionType partitionType) |
void |
finalizeOnMaster(ClassLoader loader)
A hook that can be overwritten by sub classes to implement logic that is called by the master
after the job completed.
|
CoLocationGroup |
getCoLocationGroup() |
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.
|
InputDependencyConstraint |
getInputDependencyConstraint() |
List<JobEdge> |
getInputs() |
InputSplitSource<?> |
getInputSplitSource() |
Class<? extends AbstractInvokable> |
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.
|
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<SerializedValue<OperatorCoordinator.Provider>> |
getOperatorCoordinators() |
String |
getOperatorDescription() |
List<OperatorIDPair> |
getOperatorIDs() |
String |
getOperatorName() |
String |
getOperatorPrettyName() |
int |
getParallelism()
Gets the parallelism of the task.
|
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(ClassLoader loader)
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 |
setInputDependencyConstraint(InputDependencyConstraint inputDependencyConstraint) |
void |
setInputSplitSource(InputSplitSource<?> inputSplitSource) |
void |
setInvokableClass(Class<? extends AbstractInvokable> 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(ResourceSpec minResources,
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(CoLocationGroup group) |
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 Configuration getConfiguration()
public void setInvokableClass(Class<? extends AbstractInvokable> invokable)
public String getInvokableClassName()
null
if not set.public Class<? extends AbstractInvokable> 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 ResourceSpec getMinResources()
public ResourceSpec getPreferredResources()
public void setResources(ResourceSpec minResources, ResourceSpec preferredResources)
minResources
- The minimum resource for the task.preferredResources
- The preferred resource for the task.public InputSplitSource<?> getInputSplitSource()
public void setInputSplitSource(InputSplitSource<?> inputSplitSource)
public List<IntermediateDataSet> getProducedDataSets()
public List<SerializedValue<OperatorCoordinator.Provider>> getOperatorCoordinators()
public void addOperatorCoordinator(SerializedValue<OperatorCoordinator.Provider> serializedCoordinatorProvider)
public void setSlotSharingGroup(SlotSharingGroup grp)
grp
- The slot sharing group to associate the vertex with.@Nullable public SlotSharingGroup getSlotSharingGroup()
null
.null
, if not
associated with one.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)
public CoLocationGroup getCoLocationGroup()
public void updateCoLocationGroup(CoLocationGroup group)
public IntermediateDataSet createAndAddResultDataSet(ResultPartitionType partitionType)
public IntermediateDataSet createAndAddResultDataSet(IntermediateDataSetID id, ResultPartitionType partitionType)
public JobEdge connectDataSetAsInput(IntermediateDataSet dataSet, DistributionPattern distPattern)
public JobEdge connectNewDataSetAsInput(JobVertex input, DistributionPattern distPattern, ResultPartitionType partitionType)
public void connectIdInput(IntermediateDataSetID dataSetId, DistributionPattern distPattern)
public boolean isInputVertex()
public boolean isStoppable()
public boolean isOutputVertex()
public boolean hasNoConnectedInputs()
public void initializeOnMaster(ClassLoader loader) throws Exception
loader
- The class loader for user defined code.Exception
- The method may throw exceptions which cause the job to fail immediately.public void finalizeOnMaster(ClassLoader loader) throws Exception
loader
- The class loader for user defined code.Exception
- 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 InputDependencyConstraint getInputDependencyConstraint()
public void setInputDependencyConstraint(InputDependencyConstraint inputDependencyConstraint)
Copyright © 2014–2021 The Apache Software Foundation. All rights reserved.