Interface SpeculativeExecutionHandler
-
- All Known Implementing Classes:
DefaultSpeculativeExecutionHandler,DummySpeculativeExecutionHandler
public interface SpeculativeExecutionHandlerInterface for managing speculative execution of tasks and handling slow task detection.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleanhandleTaskFailure(Execution failedExecution, Throwable error, BiConsumer<Execution,Throwable> handleLocalExecutionAttemptFailure)Handles a task failure.voidinit(ExecutionGraph executionGraph, org.apache.flink.runtime.concurrent.ComponentMainThreadExecutor mainThreadExecutor, org.apache.flink.metrics.MetricGroup metricGroup)Initial speculative execution handler.voidnotifyTaskFailed(Execution execution)Notifies that a task has failed its execution.voidnotifyTaskFinished(Execution execution, Function<ExecutionVertexID,CompletableFuture<?>> cancelPendingExecutionsFunction)Notifies that a task has finished its execution.voidresetForNewExecution(ExecutionVertexID executionVertexId)Resets the state of the component for a new execution of a specific execution vertex.voidstopSlowTaskDetector()Stops the slow task detector.
-
-
-
Method Detail
-
init
void init(ExecutionGraph executionGraph, org.apache.flink.runtime.concurrent.ComponentMainThreadExecutor mainThreadExecutor, org.apache.flink.metrics.MetricGroup metricGroup)
Initial speculative execution handler.
-
stopSlowTaskDetector
void stopSlowTaskDetector()
Stops the slow task detector.
-
notifyTaskFinished
void notifyTaskFinished(Execution execution, Function<ExecutionVertexID,CompletableFuture<?>> cancelPendingExecutionsFunction)
Notifies that a task has finished its execution.- Parameters:
execution- the execution that has finishedcancelPendingExecutionsFunction- the function to cancel pending executions
-
notifyTaskFailed
void notifyTaskFailed(Execution execution)
Notifies that a task has failed its execution.- Parameters:
execution- the execution that has failed
-
handleTaskFailure
boolean handleTaskFailure(Execution failedExecution, @Nullable Throwable error, BiConsumer<Execution,Throwable> handleLocalExecutionAttemptFailure)
Handles a task failure.- Parameters:
failedExecution- the execution that failederror- the error that caused the failure, if availablehandleLocalExecutionAttemptFailure- a consumer that handles local execution attempt failure- Returns:
- true if the failure was handled as a local failure, false otherwise
-
resetForNewExecution
void resetForNewExecution(ExecutionVertexID executionVertexId)
Resets the state of the component for a new execution of a specific execution vertex.- Parameters:
executionVertexId- the ID of the execution vertex to reset
-
-