public class JobVertex extends Object implements Serializable
Modifier and Type | Class and Description |
---|---|
static interface |
JobVertex.FinalizeOnMasterContext
The context exposes some runtime infos for finalization.
|
static interface |
JobVertex.InitializeOnMasterContext |
Modifier and Type | Field and Description |
---|---|
static int |
MAX_PARALLELISM_DEFAULT |
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 |
addIntermediateDataSetIdToConsume(IntermediateDataSetID intermediateDataSetId) |
void |
addOperatorCoordinator(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) |
void |
finalizeOnMaster(JobVertex.FinalizeOnMasterContext 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() |
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() |
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.
|
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() |
IntermediateDataSet |
getOrCreateResultDataSet(IntermediateDataSetID id,
ResultPartitionType partitionType) |
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(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 |
isParallelismConfigured() |
boolean |
isStoppable() |
boolean |
isSupportsConcurrentExecutionAttempts() |
void |
setInputSplitSource(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 |
setParallelismConfigured(boolean parallelismConfigured) |
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.
|
void |
setSupportsConcurrentExecutionAttempts(boolean supportsConcurrentExecutionAttempts) |
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 Configuration getConfiguration()
public void setInvokableClass(Class<? extends TaskInvokable> invokable)
public void setParallelismConfigured(boolean parallelismConfigured)
public boolean isParallelismConfigured()
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 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.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 setSupportsConcurrentExecutionAttempts(boolean supportsConcurrentExecutionAttempts)
public boolean isSupportsConcurrentExecutionAttempts()
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.FinalizeOnMasterContext 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–2024 The Apache Software Foundation. All rights reserved.