public class ExecutionVertex extends Object implements AccessExecutionVertex, Archiveable<ArchivedExecutionVertex>
Execution
.Modifier and Type | Field and Description |
---|---|
static int |
MAX_DISTINCT_LOCATIONS_TO_CONSIDER |
Modifier and Type | Method and Description |
---|---|
ArchivedExecutionVertex |
archive() |
CompletableFuture<?> |
cancel()
Cancels this ExecutionVertex.
|
void |
connectSource(int inputNumber,
IntermediateResult source,
JobEdge edge,
int consumerNumber) |
void |
deploy() |
void |
deployToSlot(LogicalSlot slot) |
void |
fail(Throwable t) |
ExecutionEdge[][] |
getAllInputEdges() |
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.
|
ExecutionVertexID |
getID() |
InputDependencyConstraint |
getInputDependencyConstraint() |
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() |
InputSplit |
getNextInputSplit(String host) |
int |
getNumberOfInputs() |
int |
getParallelSubtaskIndex()
Returns the subtask index of this execution vertex.
|
Optional<TaskManagerLocation> |
getPreferredLocationBasedOnState()
Gets the preferred location to execute the current task execution attempt, based on the state
that the execution attempt will resume.
|
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() |
ResourceProfile |
getResourceProfile() |
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() |
boolean |
isLegacyScheduling() |
void |
markFailed(Throwable t)
This method marks the task as failed, but will make no attempt to remove task execution from
the task manager.
|
void |
resetForNewExecution() |
Execution |
resetForNewExecution(long timestamp,
long originatingGlobalModVersion)
Archives the current Execution and creates a new Execution for this vertex.
|
CompletableFuture<Void> |
scheduleForExecution(SlotProviderStrategy slotProviderStrategy,
LocationPreferenceConstraint locationPreferenceConstraint,
Set<AllocationID> allPreviousExecutionGraphAllocationIds)
Schedules the current execution of this ExecutionVertex.
|
CompletableFuture<?> |
suspend() |
String |
toString() |
void |
tryAssignResource(LogicalSlot slot) |
public static final int MAX_DISTINCT_LOCATIONS_TO_CONSIDER
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 ResourceProfile getResourceProfile()
public int getParallelSubtaskIndex()
AccessExecutionVertex
getParallelSubtaskIndex
in interface AccessExecutionVertex
public ExecutionVertexID getID()
public int getNumberOfInputs()
public ExecutionEdge[] getInputEdges(int input)
public ExecutionEdge[][] getAllInputEdges()
public CoLocationConstraint getLocationConstraint()
public InputSplit getNextInputSplit(String host)
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
@Nullable 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 InputDependencyConstraint getInputDependencyConstraint()
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 Optional<TaskManagerLocation> getPreferredLocationBasedOnState()
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 void resetForNewExecution()
public CompletableFuture<Void> scheduleForExecution(SlotProviderStrategy slotProviderStrategy, LocationPreferenceConstraint locationPreferenceConstraint, @Nonnull Set<AllocationID> allPreviousExecutionGraphAllocationIds)
slotProviderStrategy
- to allocate the slots fromlocationPreferenceConstraint
- constraint for the location preferencesallPreviousExecutionGraphAllocationIds
- set with all previous allocation ids in the job
graph. Can be empty if the allocation ids are not required for scheduling.public void tryAssignResource(LogicalSlot slot)
public void deploy() throws JobException
JobException
@VisibleForTesting public void deployToSlot(LogicalSlot slot) throws JobException
JobException
public CompletableFuture<?> cancel()
public CompletableFuture<?> suspend()
public void fail(Throwable t)
public void markFailed(Throwable t)
t
- The exception that caused the task to fail.public ArchivedExecutionVertex archive()
archive
in interface Archiveable<ArchivedExecutionVertex>
public boolean isLegacyScheduling()
Copyright © 2014–2021 The Apache Software Foundation. All rights reserved.