Class SpeculativeExecutionVertex
- java.lang.Object
-
- org.apache.flink.runtime.executiongraph.ExecutionVertex
-
- org.apache.flink.runtime.executiongraph.SpeculativeExecutionVertex
-
- All Implemented Interfaces:
org.apache.flink.api.common.Archiveable<ArchivedExecutionVertex>,AccessExecutionVertex
public class SpeculativeExecutionVertex extends ExecutionVertex
The ExecutionVertex which supports speculative execution.
-
-
Field Summary
-
Fields inherited from class org.apache.flink.runtime.executiongraph.ExecutionVertex
NUM_BYTES_UNKNOWN
-
-
Constructor Summary
Constructors Constructor Description SpeculativeExecutionVertex(ExecutionJobVertex jobVertex, int subTaskIndex, IntermediateResult[] producedDataSets, Duration timeout, long createTimestamp, int executionHistorySizeLimit, int initialAttemptCount)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ArchivedExecutionVertexarchive()voidarchiveFailedExecution(ExecutionAttemptID executionAttemptId)Remove execution from currentExecutions if it is failed.CompletableFuture<?>cancel()Cancels this ExecutionVertex.ExecutioncreateNewSpeculativeExecution(long timestamp)voiddeploy()voiddeployToSlot(LogicalSlot slot)voidfail(Throwable t)ExecutiongetCurrentExecution(int attemptNumber)ExecutiongetCurrentExecutionAttempt()Returns the current execution for this execution vertex.Collection<Execution>getCurrentExecutions()Returns the current executions for this execution vertex.Optional<org.apache.flink.core.io.InputSplit>getNextInputSplit(String host, int attemptNumber)ExecutiongetPartitionProducer()Optional<TaskManagerLocation>getPreferredLocationBasedOnState()Gets the preferred location to execute the current task execution attempt, based on the state that the execution attempt will resume.booleanisOriginalAttempt(int attemptNumber)Returns whether the given attempt is the original execution attempt of the execution vertex, i.e. it is created along with the creation of resetting of the execution vertex.booleanisSupportsConcurrentExecutionAttempts()voidmarkFailed(Throwable t)This method marks the task as failed, but will make no attempt to remove task execution from the task manager.voidresetForNewExecution()Archives the current Execution and creates a new Execution for this vertex.CompletableFuture<?>suspend()voidtryAssignResource(LogicalSlot slot)-
Methods inherited from class org.apache.flink.runtime.executiongraph.ExecutionVertex
addConsumedPartitionGroup, findLastAllocation, findLastLocation, finishPartitionsIfNeeded, getAllConsumedPartitionGroups, getConsumedPartitionGroup, getCurrentAssignedResource, getCurrentAssignedResourceLocation, getCurrentTaskManagerLocationFuture, getExecutionGraphAccessor, getExecutionHistory, getExecutionState, getExecutionVertexInputInfo, getFailureInfo, getID, getInputBytes, getJobId, getJobVertex, getJobvertexId, getMaxParallelism, getNumberOfInputs, getParallelSubtaskIndex, getProducedPartitions, getResourceProfile, getStateTimestamp, getTaskName, getTaskNameWithSubtaskIndex, getTotalNumberOfParallelSubtasks, setInputBytes, toString
-
-
-
-
Constructor Detail
-
SpeculativeExecutionVertex
public SpeculativeExecutionVertex(ExecutionJobVertex jobVertex, int subTaskIndex, IntermediateResult[] producedDataSets, Duration timeout, long createTimestamp, int executionHistorySizeLimit, int initialAttemptCount)
-
-
Method Detail
-
isSupportsConcurrentExecutionAttempts
public boolean isSupportsConcurrentExecutionAttempts()
-
createNewSpeculativeExecution
public Execution createNewSpeculativeExecution(long timestamp)
-
isOriginalAttempt
public boolean isOriginalAttempt(int attemptNumber)
Returns whether the given attempt is the original execution attempt of the execution vertex, i.e. it is created along with the creation of resetting of the execution vertex.
-
getCurrentExecutions
public Collection<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- Overrides:
getCurrentExecutionsin classExecutionVertex- Returns:
- current executions
-
getCurrentExecution
public Execution getCurrentExecution(int attemptNumber)
- Overrides:
getCurrentExecutionin classExecutionVertex
-
getPartitionProducer
public Execution getPartitionProducer()
- Overrides:
getPartitionProducerin classExecutionVertex
-
cancel
public CompletableFuture<?> cancel()
Description copied from class:ExecutionVertexCancels this ExecutionVertex.- Overrides:
cancelin classExecutionVertex- Returns:
- A future that completes once the execution has reached its final state.
-
suspend
public CompletableFuture<?> suspend()
- Overrides:
suspendin classExecutionVertex
-
fail
public void fail(Throwable t)
- Overrides:
failin classExecutionVertex
-
markFailed
public void markFailed(Throwable t)
Description copied from class:ExecutionVertexThis 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.- Overrides:
markFailedin classExecutionVertex- Parameters:
t- The exception that caused the task to fail.
-
resetForNewExecution
public void resetForNewExecution()
Description copied from class:ExecutionVertexArchives the current Execution and creates a new Execution for this vertex.- Overrides:
resetForNewExecutionin classExecutionVertex
-
archiveFailedExecution
public void archiveFailedExecution(ExecutionAttemptID executionAttemptId)
Remove execution from currentExecutions if it is failed. It is needed to make room for possible future speculative executions.- Parameters:
executionAttemptId- attemptID of the execution to be removed
-
getCurrentExecutionAttempt
public Execution getCurrentExecutionAttempt()
Description copied from interface:AccessExecutionVertexReturns the current execution for this execution vertex.- Specified by:
getCurrentExecutionAttemptin interfaceAccessExecutionVertex- Overrides:
getCurrentExecutionAttemptin classExecutionVertex- Returns:
- current execution
-
getNextInputSplit
public Optional<org.apache.flink.core.io.InputSplit> getNextInputSplit(String host, int attemptNumber)
- Overrides:
getNextInputSplitin classExecutionVertex
-
archive
public ArchivedExecutionVertex archive()
- Specified by:
archivein interfaceorg.apache.flink.api.common.Archiveable<ArchivedExecutionVertex>- Overrides:
archivein classExecutionVertex
-
tryAssignResource
public void tryAssignResource(LogicalSlot slot)
- Overrides:
tryAssignResourcein classExecutionVertex
-
deploy
public void deploy()
- Overrides:
deployin classExecutionVertex
-
deployToSlot
public void deployToSlot(LogicalSlot slot)
- Overrides:
deployToSlotin classExecutionVertex
-
getPreferredLocationBasedOnState
public Optional<TaskManagerLocation> getPreferredLocationBasedOnState()
Description copied from class:ExecutionVertexGets the preferred location to execute the current task execution attempt, based on the state that the execution attempt will resume.- Overrides:
getPreferredLocationBasedOnStatein classExecutionVertex
-
-