public final class ExecutionVertex extends Object
This class is thread-safe.
| Constructor and Description |
|---|
ExecutionVertex(ExecutionGraph executionGraph,
ExecutionGroupVertex groupVertex,
int numberOfOutputGates,
int numberOfInputGates)
Create a new execution vertex and instantiates its environment.
|
| Modifier and Type | Method and Description |
|---|---|
TaskCancelResult |
cancelTask()
Cancels and removes the task represented by this vertex
from the instance it is currently running on.
|
boolean |
compareAndUpdateExecutionState(ExecutionState expected,
ExecutionState update) |
TaskDeploymentDescriptor |
constructDeploymentDescriptor()
Constructs a new task deployment descriptor for this vertex.
|
boolean |
decrementRetriesLeftAndCheck()
Decrements the number of retries left and checks whether another attempt to run the task is possible.
|
ExecutionVertex |
duplicateVertex(boolean preserveVertexID)
Returns a duplicate of this execution vertex.
|
AllocatedResource |
getAllocatedResource()
Returns the allocated resources assigned to this execution vertex.
|
AllocationID |
getAllocationID()
Returns the allocation ID which identifies the resources used
by this vertex within the assigned instance.
|
ExecutionGraph |
getExecutionGraph()
Returns the
ExecutionGraph this vertex belongs to. |
ExecutionPipeline |
getExecutionPipeline()
Returns the
ExecutionPipeline this vertex is part of. |
ExecutionState |
getExecutionState()
Returns this execution vertex's current execution status.
|
ExecutionGroupVertex |
getGroupVertex()
Returns the group vertex this execution vertex belongs to.
|
ExecutionVertexID |
getID()
Returns the ID of this execution vertex.
|
int |
getIndexInVertexGroup()
Returns the index of this vertex in the vertex group.
|
ExecutionGate |
getInputGate(int index)
Returns the input gate with the given index.
|
String |
getName()
Returns the name of the execution vertex.
|
int |
getNumberOfInputGates()
Returns the number of input gates attached to this vertex.
|
int |
getNumberOfOutputGates()
Returns the number of output gates attached to this vertex.
|
int |
getNumberOfPredecessors()
Returns the number of predecessors, i.e.
|
int |
getNumberOfSuccessors()
Returns the number of successors, i.e.
|
ExecutionGate |
getOutputGate(int index)
Returns the output gate with the given index.
|
ExecutionVertex |
getPredecessor(int index) |
ExecutionVertex |
getSuccessor(int index) |
boolean |
hasRetriesLeft()
Deprecated.
|
boolean |
isInputVertex()
Checks if this vertex is an input vertex in its stage, i.e.
|
boolean |
isOutputVertex()
Checks if this vertex is an output vertex in its stage, i.e.
|
TaskKillResult |
killTask()
Kills and removes the task represented by this vertex from the instance it is currently running on.
|
void |
registerExecutionListener(ExecutionListener executionListener)
Registers the
ExecutionListener object for this vertex. |
void |
registerVertexAssignmentListener(VertexAssignmentListener vertexAssignmentListener)
Registers the
VertexAssignmentListener object for this vertex. |
void |
setAllocatedResource(AllocatedResource allocatedResource)
Assigns the execution vertex with an
AllocatedResource. |
ExecutionVertex |
splitVertex()
Returns a duplicate of this execution vertex.
|
TaskSubmissionResult |
startTask()
Deploys and starts the task represented by this vertex
on the assigned instance.
|
String |
toString() |
void |
unregisterExecutionListener(ExecutionListener executionListener)
Unregisters the
ExecutionListener object for this vertex. |
void |
unregisterVertexAssignmentListener(VertexAssignmentListener vertexAssignmentListener)
Unregisters the
VertexAssignmentListener object for this vertex. |
ExecutionState |
updateExecutionState(ExecutionState newExecutionState)
Updates the vertex's current execution state.
|
ExecutionState |
updateExecutionState(ExecutionState newExecutionState,
String optionalMessage)
Updates the vertex's current execution state.
|
void |
updateExecutionStateAsynchronously(ExecutionState newExecutionState)
Updates the vertex's current execution state through the job's executor service.
|
void |
updateExecutionStateAsynchronously(ExecutionState newExecutionState,
String optionalMessage)
Updates the vertex's current execution state through the job's executor service.
|
public ExecutionVertex(ExecutionGraph executionGraph, ExecutionGroupVertex groupVertex, int numberOfOutputGates, int numberOfInputGates)
executionGraph - the execution graph the new vertex belongs togroupVertex - the group vertex the new vertex belongs tonumberOfOutputGates - the number of output gates attached to this vertexnumberOfInputGates - the number of input gates attached to this vertexpublic ExecutionGroupVertex getGroupVertex()
public String getName()
public ExecutionVertex duplicateVertex(boolean preserveVertexID)
preserveVertexID - true to copy the vertex's ID to the duplicated vertex, false to create a new IDpublic ExecutionVertex splitVertex()
public ExecutionState getExecutionState()
public void updateExecutionStateAsynchronously(ExecutionState newExecutionState, String optionalMessage)
newExecutionState - the new execution stateoptionalMessage - an optional message related to the state changepublic void updateExecutionStateAsynchronously(ExecutionState newExecutionState)
newExecutionState - the new execution statepublic ExecutionState updateExecutionState(ExecutionState newExecutionState)
newExecutionState - the new execution statepublic ExecutionState updateExecutionState(ExecutionState newExecutionState, String optionalMessage)
newExecutionState - the new execution stateoptionalMessage - an optional message related to the state changepublic boolean compareAndUpdateExecutionState(ExecutionState expected, ExecutionState update)
public void setAllocatedResource(AllocatedResource allocatedResource)
AllocatedResource.allocatedResource - the resources which are supposed to be allocated to this vertexpublic AllocatedResource getAllocatedResource()
public AllocationID getAllocationID()
null if the instance is still assigned to a
DummyInstance.public ExecutionVertexID getID()
public int getNumberOfPredecessors()
public int getNumberOfSuccessors()
public ExecutionVertex getPredecessor(int index)
public ExecutionVertex getSuccessor(int index)
public boolean isInputVertex()
true if this vertex is an input vertex, false otherwisepublic boolean isOutputVertex()
true if this vertex is an output vertex, false otherwisepublic int getIndexInVertexGroup()
public int getNumberOfOutputGates()
public ExecutionGate getOutputGate(int index)
index - the index of the output gate to returnpublic int getNumberOfInputGates()
public ExecutionGate getInputGate(int index)
index - the index of the input gate to returnpublic TaskSubmissionResult startTask()
public TaskKillResult killTask()
RUNNING, this call will be ignored. If the call has been
executed
successfully, the task will change the state FAILED.public TaskCancelResult cancelTask()
CANCELLED.public ExecutionGraph getExecutionGraph()
ExecutionGraph this vertex belongs to.ExecutionGraph this vertex belongs to@Deprecated public boolean hasRetriesLeft()
true if the task has a retry attempt left, false otherwisepublic boolean decrementRetriesLeftAndCheck()
trueif the task represented by this vertex can be started at least once more,
false/ otherwisepublic void registerVertexAssignmentListener(VertexAssignmentListener vertexAssignmentListener)
VertexAssignmentListener object for this vertex. This object
will be notified about reassignments of this vertex to another instance.vertexAssignmentListener - the object to be notified about reassignments of this vertex to another instancepublic void unregisterVertexAssignmentListener(VertexAssignmentListener vertexAssignmentListener)
VertexAssignmentListener object for this vertex. This object
will no longer be notified about reassignments of this vertex to another instance.vertexAssignmentListener - the listener to be unregisteredpublic void registerExecutionListener(ExecutionListener executionListener)
ExecutionListener object for this vertex. This object
will be notified about particular events during the vertex's lifetime.executionListener - the object to be notified about particular events during the vertex's lifetimepublic void unregisterExecutionListener(ExecutionListener executionListener)
ExecutionListener object for this vertex. This object
will no longer be notified about particular events during the vertex's lifetime.executionListener - the object to be unregisteredpublic ExecutionPipeline getExecutionPipeline()
ExecutionPipeline this vertex is part of.public TaskDeploymentDescriptor constructDeploymentDescriptor()
Copyright © 2014 The Apache Software Foundation. All rights reserved.