public class ExecutionVertex extends Object implements AccessExecutionVertex, org.apache.flink.api.common.Archiveable<ArchivedExecutionVertex>
Execution.| Constructor and Description |
|---|
ExecutionVertex(ExecutionJobVertex jobVertex,
int subTaskIndex,
IntermediateResult[] producedDataSets,
org.apache.flink.api.common.time.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) |
org.apache.flink.api.common.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,
Set<AllocationID> allPreviousExecutionGraphAllocationIds)
Schedules the current execution of this ExecutionVertex.
|
void |
stop() |
String |
toString() |
public ExecutionVertex(ExecutionJobVertex jobVertex, int subTaskIndex, IntermediateResult[] producedDataSets, org.apache.flink.api.common.time.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 org.apache.flink.api.common.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 AccessExecutionVertexpublic int getTotalNumberOfParallelSubtasks()
public int getMaxParallelism()
public int getParallelSubtaskIndex()
AccessExecutionVertexgetParallelSubtaskIndex in interface AccessExecutionVertexpublic int getNumberOfInputs()
public ExecutionEdge[] getInputEdges(int input)
public CoLocationConstraint getLocationConstraint()
public Execution getCurrentExecutionAttempt()
AccessExecutionVertexgetCurrentExecutionAttempt in interface AccessExecutionVertexpublic ExecutionState getExecutionState()
AccessExecutionVertexExecutionState for this execution vertex.getExecutionState in interface AccessExecutionVertexpublic long getStateTimestamp(ExecutionState state)
AccessExecutionVertexExecutionState.getStateTimestamp in interface AccessExecutionVertexstate - state for which the timestamp should be returnedpublic String getFailureCauseAsString()
AccessExecutionVertexgetFailureCauseAsString in interface AccessExecutionVertex"(null)"public Throwable getFailureCause()
public CompletableFuture<TaskManagerLocation> getCurrentTaskManagerLocationFuture()
public LogicalSlot getCurrentAssignedResource()
public TaskManagerLocation getCurrentAssignedResourceLocation()
AccessExecutionVertexTaskManagerLocation for this execution vertex.getCurrentAssignedResourceLocation in interface AccessExecutionVertexpublic ArchivedExecution getPriorExecutionAttempt(int attemptNumber)
AccessExecutionVertexgetPriorExecutionAttempt in interface AccessExecutionVertexattemptNumber - 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, @Nonnull Set<AllocationID> allPreviousExecutionGraphAllocationIds)
slotProvider - to allocate the slots fromqueued - if the allocation can be queuedlocationPreferenceConstraint - 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.@VisibleForTesting public void deployToSlot(SimpleSlot slot) throws JobException
JobExceptionpublic CompletableFuture<?> cancel()
public void stop()
public void fail(Throwable t)
public void cachePartitionInfo(PartialInputChannelDeploymentDescriptor partitionInfo)
public ArchivedExecutionVertex archive()
archive in interface org.apache.flink.api.common.Archiveable<ArchivedExecutionVertex>Copyright © 2014–2019 The Apache Software Foundation. All rights reserved.