Class ExecutionVertex
java.lang.Object
org.apache.flink.runtime.executiongraph.ExecutionVertex
- All Implemented Interfaces:
org.apache.flink.api.common.Archiveable<ArchivedExecutionVertex>,AccessExecutionVertex
- Direct Known Subclasses:
SpeculativeExecutionVertex
public class ExecutionVertex
extends Object
implements AccessExecutionVertex, org.apache.flink.api.common.Archiveable<ArchivedExecutionVertex>
The ExecutionVertex is a parallel subtask of the execution. It may be executed once, or several
times, each of which time it spawns an
Execution.-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionExecutionVertex(ExecutionJobVertex jobVertex, int subTaskIndex, IntermediateResult[] producedDataSets, Duration timeout, long createTimestamp, int executionHistorySizeLimit, int initialAttemptCount) Creates an ExecutionVertex. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddConsumedPartitionGroup(ConsumedPartitionGroup consumedPartitions) archive()cancel()Cancels this ExecutionVertex.voiddeploy()voiddeployToSlot(LogicalSlot slot) voidGets the location that an execution of this vertex was assigned to.Mark partition finished if needed.getConsumedPartitionGroup(int input) Returns theTaskManagerLocationfor this execution vertex.getCurrentExecution(int attemptNumber) Returns the current execution for this execution vertex.Returns the current executions for this execution vertex.Returns the execution history.Returns the currentExecutionStatefor this execution vertex.Returns the exception that caused the job to fail.getID()longorg.apache.flink.api.common.JobIDgetJobId()intOptional<org.apache.flink.core.io.InputSplit>getNextInputSplit(String host, int attemptNumber) intintReturns the subtask index of this execution vertex.Gets the preferred location to execute the current task execution attempt, based on the state that the execution attempt will resume.longgetStateTimestamp(ExecutionState state) Returns the timestamp for the givenExecutionState.Creates a simple name representation in the style 'taskname (x/y)', where 'taskname' is the name as returned bygetTaskName(), 'x' is the parallel subtask index as returned bygetParallelSubtaskIndex()+ 1, and 'y' is the total number of tasks, as returned bygetTotalNumberOfParallelSubtasks().intvoidThis method marks the task as failed, but will make no attempt to remove task execution from the task manager.voidArchives the current Execution and creates a new Execution for this vertex.voidsetInputBytes(long inputBytes) suspend()toString()voidtryAssignResource(LogicalSlot slot)
-
Field Details
-
NUM_BYTES_UNKNOWN
public static final long NUM_BYTES_UNKNOWN- See Also:
-
-
Constructor Details
-
ExecutionVertex
@VisibleForTesting public ExecutionVertex(ExecutionJobVertex jobVertex, int subTaskIndex, IntermediateResult[] producedDataSets, Duration timeout, long createTimestamp, int executionHistorySizeLimit, int initialAttemptCount) Creates an ExecutionVertex.- Parameters:
timeout- The RPC timeout to use for deploy / cancel callscreateTimestamp- The timestamp for the vertex creation, used to initialize the first Execution with.executionHistorySizeLimit- The maximum number of historical Executions (= execution attempts) to keep.initialAttemptCount- The attempt number of the first execution of this vertex.
-
-
Method Details
-
getExecutionVertexInputInfo
-
setInputBytes
public void setInputBytes(long inputBytes) -
getInputBytes
public long getInputBytes() -
getPartitionProducer
-
getJobId
public org.apache.flink.api.common.JobID getJobId() -
getJobVertex
-
getJobvertexId
-
getTaskName
-
getTaskNameWithSubtaskIndex
Creates a simple name representation in the style 'taskname (x/y)', where 'taskname' is the name as returned bygetTaskName(), 'x' is the parallel subtask index as returned bygetParallelSubtaskIndex()+ 1, and 'y' is the total number of tasks, as returned bygetTotalNumberOfParallelSubtasks().- Specified by:
getTaskNameWithSubtaskIndexin interfaceAccessExecutionVertex- Returns:
- A simple name representation in the form 'myTask (2/7)'
-
getTotalNumberOfParallelSubtasks
public int getTotalNumberOfParallelSubtasks() -
getMaxParallelism
public int getMaxParallelism() -
getResourceProfile
-
getParallelSubtaskIndex
public int getParallelSubtaskIndex()Description copied from interface:AccessExecutionVertexReturns the subtask index of this execution vertex.- Specified by:
getParallelSubtaskIndexin interfaceAccessExecutionVertex- Returns:
- subtask index of this execution vertex.
-
getID
-
getNumberOfInputs
public int getNumberOfInputs() -
getAllConsumedPartitionGroups
-
getConsumedPartitionGroup
-
getNextInputSplit
-
getCurrentExecutionAttempt
Description copied from interface:AccessExecutionVertexReturns the current execution for this execution vertex.- Specified by:
getCurrentExecutionAttemptin interfaceAccessExecutionVertex- Returns:
- current execution
-
getCurrentExecutions
Description copied from interface:AccessExecutionVertexReturns the current executions for this execution vertex. The returned collection must contain the current execution attempt.- Specified by:
getCurrentExecutionsin interfaceAccessExecutionVertex- Returns:
- current executions
-
getCurrentExecution
-
getExecutionState
Description copied from interface:AccessExecutionVertexReturns the currentExecutionStatefor this execution vertex.- Specified by:
getExecutionStatein interfaceAccessExecutionVertex- Returns:
- execution state for this execution vertex
-
getStateTimestamp
Description copied from interface:AccessExecutionVertexReturns the timestamp for the givenExecutionState.- Specified by:
getStateTimestampin interfaceAccessExecutionVertex- Parameters:
state- state for which the timestamp should be returned- Returns:
- timestamp for the given state
-
getFailureInfo
Description copied from interface:AccessExecutionVertexReturns the exception that caused the job to fail. This is the first root exception that was not recoverable and triggered job failure.- Specified by:
getFailureInfoin interfaceAccessExecutionVertex- Returns:
- failure exception wrapped in an
OptionalofErrorInfo, or an emptyOptionalif no exception was caught.
-
getCurrentTaskManagerLocationFuture
-
getCurrentAssignedResource
-
getCurrentAssignedResourceLocation
Description copied from interface:AccessExecutionVertexReturns theTaskManagerLocationfor this execution vertex.- Specified by:
getCurrentAssignedResourceLocationin interfaceAccessExecutionVertex- Returns:
- taskmanager location for this execution vertex.
-
getExecutionHistory
Description copied from interface:AccessExecutionVertexReturns the execution history.- Specified by:
getExecutionHistoryin interfaceAccessExecutionVertex- Returns:
- the execution history
-
findLastLocation
Gets the location that an execution of this vertex was assigned to.- Returns:
- The last execution location, or null, if there is none, yet.
-
findLastAllocation
-
getExecutionGraphAccessor
-
getProducedPartitions
-
addConsumedPartitionGroup
-
getPreferredLocationBasedOnState
Gets the preferred location to execute the current task execution attempt, based on the state that the execution attempt will resume. -
resetForNewExecution
public void resetForNewExecution()Archives the current Execution and creates a new Execution for this vertex. -
tryAssignResource
-
deploy
- Throws:
JobException
-
deployToSlot
- Throws:
JobException
-
cancel
Cancels this ExecutionVertex.- Returns:
- A future that completes once the execution has reached its final state.
-
suspend
-
fail
-
markFailed
This method marks the task as failed, but will make no attempt to remove task execution from the task manager. It is intended for cases where the task is known not to be deployed yet.- Parameters:
t- The exception that caused the task to fail.
-
finishPartitionsIfNeeded
Mark partition finished if needed.- Returns:
- list of finished partitions.
-
toString
-
archive
- Specified by:
archivein interfaceorg.apache.flink.api.common.Archiveable<ArchivedExecutionVertex>
-