public class ExecutionVertex extends Object implements AccessExecutionVertex, Archiveable<ArchivedExecutionVertex>
Execution
.Constructor and Description |
---|
ExecutionVertex(ExecutionJobVertex jobVertex,
int subTaskIndex,
IntermediateResult[] producedDataSets,
Time timeout,
long initialGlobalModVersion,
long createTimestamp,
int maxPriorExecutionHistoryLength)
Creates an ExecutionVertex.
|
Modifier and Type | Method and Description |
---|---|
ArchivedExecutionVertex |
archive() |
void |
cachePartitionInfo(PartialInputChannelDeploymentDescriptor partitionInfo) |
CompletableFuture<?> |
cancel()
Cancels this ExecutionVertex.
|
void |
connectSource(int inputNumber,
IntermediateResult source,
JobEdge edge,
int consumerNumber) |
void |
deployToSlot(SimpleSlot slot) |
void |
fail(Throwable t) |
LogicalSlot |
getCurrentAssignedResource() |
TaskManagerLocation |
getCurrentAssignedResourceLocation()
Returns the
TaskManagerLocation for this execution vertex. |
Execution |
getCurrentExecutionAttempt()
Returns the current execution for this execution vertex.
|
CompletableFuture<TaskManagerLocation> |
getCurrentTaskManagerLocationFuture() |
ExecutionGraph |
getExecutionGraph() |
ExecutionState |
getExecutionState()
Returns the current
ExecutionState for this execution vertex. |
Throwable |
getFailureCause() |
String |
getFailureCauseAsString()
Returns the exception that caused the job to fail.
|
ExecutionEdge[] |
getInputEdges(int input) |
JobID |
getJobId() |
ExecutionJobVertex |
getJobVertex() |
JobVertexID |
getJobvertexId() |
AllocationID |
getLatestPriorAllocation() |
ArchivedExecution |
getLatestPriorExecution() |
TaskManagerLocation |
getLatestPriorLocation()
Gets the location where the latest completed/canceled/failed execution of the vertex's
task happened.
|
CoLocationConstraint |
getLocationConstraint() |
int |
getMaxParallelism() |
int |
getNumberOfInputs() |
int |
getParallelSubtaskIndex()
Returns the subtask index of this execution vertex.
|
Collection<CompletableFuture<TaskManagerLocation>> |
getPreferredLocations()
Gets the overall preferred execution location for this vertex's current execution.
|
Collection<CompletableFuture<TaskManagerLocation>> |
getPreferredLocationsBasedOnInputs()
Gets the location preferences of the vertex's current task execution, as determined by the locations
of the predecessors from which it receives input data.
|
Collection<CompletableFuture<TaskManagerLocation>> |
getPreferredLocationsBasedOnState()
Gets the preferred location to execute the current task execution attempt, based on the state
that the execution attempt will resume.
|
ArchivedExecution |
getPriorExecutionAttempt(int attemptNumber)
Returns the execution for the given attempt number.
|
Map<IntermediateResultPartitionID,IntermediateResultPartition> |
getProducedPartitions() |
long |
getStateTimestamp(ExecutionState state)
Returns the timestamp for the given
ExecutionState . |
String |
getTaskName() |
String |
getTaskNameWithSubtaskIndex()
Creates a simple name representation in the style 'taskname (x/y)', where
'taskname' is the name as returned by
getTaskName() , 'x' is the parallel
subtask index as returned by getParallelSubtaskIndex() + 1 , and 'y' is the total
number of tasks, as returned by getTotalNumberOfParallelSubtasks() . |
int |
getTotalNumberOfParallelSubtasks() |
Execution |
resetForNewExecution(long timestamp,
long originatingGlobalModVersion)
Archives the current Execution and creates a new Execution for this vertex.
|
CompletableFuture<Void> |
scheduleForExecution(SlotProvider slotProvider,
boolean queued,
LocationPreferenceConstraint locationPreferenceConstraint)
Schedules the current execution of this ExecutionVertex.
|
void |
stop() |
String |
toString() |
public ExecutionVertex(ExecutionJobVertex jobVertex, int subTaskIndex, IntermediateResult[] producedDataSets, Time timeout, long initialGlobalModVersion, long createTimestamp, int maxPriorExecutionHistoryLength)
timeout
- The RPC timeout to use for deploy / cancel callsinitialGlobalModVersion
- The global modification version to initialize the first Execution with.createTimestamp
- The timestamp for the vertex creation, used to initialize the first Execution with.maxPriorExecutionHistoryLength
- The number of prior Executions (= execution attempts) to keep.public JobID getJobId()
public ExecutionJobVertex getJobVertex()
public JobVertexID getJobvertexId()
public String getTaskName()
public String getTaskNameWithSubtaskIndex()
getTaskName()
, 'x' is the parallel
subtask index as returned by getParallelSubtaskIndex()
+ 1
, and 'y' is the total
number of tasks, as returned by getTotalNumberOfParallelSubtasks()
.getTaskNameWithSubtaskIndex
in interface AccessExecutionVertex
public int getTotalNumberOfParallelSubtasks()
public int getMaxParallelism()
public int getParallelSubtaskIndex()
AccessExecutionVertex
getParallelSubtaskIndex
in interface AccessExecutionVertex
public int getNumberOfInputs()
public ExecutionEdge[] getInputEdges(int input)
public CoLocationConstraint getLocationConstraint()
public Execution getCurrentExecutionAttempt()
AccessExecutionVertex
getCurrentExecutionAttempt
in interface AccessExecutionVertex
public ExecutionState getExecutionState()
AccessExecutionVertex
ExecutionState
for this execution vertex.getExecutionState
in interface AccessExecutionVertex
public long getStateTimestamp(ExecutionState state)
AccessExecutionVertex
ExecutionState
.getStateTimestamp
in interface AccessExecutionVertex
state
- state for which the timestamp should be returnedpublic String getFailureCauseAsString()
AccessExecutionVertex
getFailureCauseAsString
in interface AccessExecutionVertex
"(null)"
public Throwable getFailureCause()
public CompletableFuture<TaskManagerLocation> getCurrentTaskManagerLocationFuture()
public LogicalSlot getCurrentAssignedResource()
public TaskManagerLocation getCurrentAssignedResourceLocation()
AccessExecutionVertex
TaskManagerLocation
for this execution vertex.getCurrentAssignedResourceLocation
in interface AccessExecutionVertex
public ArchivedExecution getPriorExecutionAttempt(int attemptNumber)
AccessExecutionVertex
getPriorExecutionAttempt
in interface AccessExecutionVertex
attemptNumber
- attempt number of execution to be returnedpublic ArchivedExecution getLatestPriorExecution()
public TaskManagerLocation getLatestPriorLocation()
public AllocationID getLatestPriorAllocation()
public ExecutionGraph getExecutionGraph()
public Map<IntermediateResultPartitionID,IntermediateResultPartition> getProducedPartitions()
public void connectSource(int inputNumber, IntermediateResult source, JobEdge edge, int consumerNumber)
public Collection<CompletableFuture<TaskManagerLocation>> getPreferredLocations()
These rules should result in the following behavior:
getPreferredLocationsBasedOnState()
,
getPreferredLocationsBasedOnInputs()
public Collection<CompletableFuture<TaskManagerLocation>> getPreferredLocationsBasedOnState()
public Collection<CompletableFuture<TaskManagerLocation>> getPreferredLocationsBasedOnInputs()
null
to indicate no location preference.public Execution resetForNewExecution(long timestamp, long originatingGlobalModVersion) throws GlobalModVersionMismatch
This method atomically checks if the ExecutionGraph is still of an expected global mod. version and replaces the execution if that is the case. If the ExecutionGraph has increased its global mod. version in the meantime, this operation fails.
This mechanism can be used to prevent conflicts between various concurrent recovery and reconfiguration actions in a similar way as "optimistic concurrency control".
timestamp
- The creation timestamp for the new ExecutionoriginatingGlobalModVersion
- GlobalModVersionMismatch
- Thrown, if the execution graph has a new global mod
version than the one passed to this message.public CompletableFuture<Void> scheduleForExecution(SlotProvider slotProvider, boolean queued, LocationPreferenceConstraint locationPreferenceConstraint)
slotProvider
- to allocate the slots fromqueued
- if the allocation can be queuedlocationPreferenceConstraint
- constraint for the location preferences@VisibleForTesting public void deployToSlot(SimpleSlot slot) throws JobException
JobException
public CompletableFuture<?> cancel()
public void stop()
public void fail(Throwable t)
public void cachePartitionInfo(PartialInputChannelDeploymentDescriptor partitionInfo)
public ArchivedExecutionVertex archive()
archive
in interface Archiveable<ArchivedExecutionVertex>
Copyright © 2014–2019 The Apache Software Foundation. All rights reserved.