public class DefaultSpeculativeExecutionHandler extends Object implements SpeculativeExecutionHandler, SlowTaskDetectorListener
SpeculativeExecutionHandler
.Constructor and Description |
---|
DefaultSpeculativeExecutionHandler(Configuration jobMasterConfiguration,
BlocklistOperations blocklistOperations,
java.util.function.Function<ExecutionVertexID,ExecutionVertex> executionVertexRetriever,
java.util.function.Supplier<Map<ExecutionAttemptID,Execution>> registerExecutionsSupplier,
java.util.function.BiConsumer<List<Execution>,Collection<ExecutionVertexID>> allocateSlotsAndDeployFunction,
org.slf4j.Logger log) |
Modifier and Type | Method and Description |
---|---|
boolean |
handleTaskFailure(Execution failedExecution,
Throwable error,
java.util.function.BiConsumer<Execution,Throwable> handleLocalExecutionAttemptFailure)
Handles a task failure.
|
void |
init(ExecutionGraph executionGraph,
ComponentMainThreadExecutor mainThreadExecutor,
MetricGroup metricGroup)
Initial speculative execution handler.
|
void |
notifySlowTasks(Map<ExecutionVertexID,Collection<ExecutionAttemptID>> slowTasks)
Notify detected slow tasks.
|
void |
notifyTaskFailed(Execution execution)
Notifies that a task has failed its execution.
|
void |
notifyTaskFinished(Execution execution,
java.util.function.Function<ExecutionVertexID,CompletableFuture<?>> cancelPendingExecutionsFunction)
Notifies that a task has finished its execution.
|
void |
resetForNewExecution(ExecutionVertexID executionVertexId)
Resets the state of the component for a new execution of a specific execution vertex.
|
void |
stopSlowTaskDetector()
Stops the slow task detector.
|
public DefaultSpeculativeExecutionHandler(Configuration jobMasterConfiguration, BlocklistOperations blocklistOperations, java.util.function.Function<ExecutionVertexID,ExecutionVertex> executionVertexRetriever, java.util.function.Supplier<Map<ExecutionAttemptID,Execution>> registerExecutionsSupplier, java.util.function.BiConsumer<List<Execution>,Collection<ExecutionVertexID>> allocateSlotsAndDeployFunction, org.slf4j.Logger log)
public void init(ExecutionGraph executionGraph, ComponentMainThreadExecutor mainThreadExecutor, MetricGroup metricGroup)
SpeculativeExecutionHandler
init
in interface SpeculativeExecutionHandler
public void stopSlowTaskDetector()
SpeculativeExecutionHandler
stopSlowTaskDetector
in interface SpeculativeExecutionHandler
public void notifyTaskFinished(Execution execution, java.util.function.Function<ExecutionVertexID,CompletableFuture<?>> cancelPendingExecutionsFunction)
SpeculativeExecutionHandler
notifyTaskFinished
in interface SpeculativeExecutionHandler
execution
- the execution that has finishedcancelPendingExecutionsFunction
- the function to cancel pending executionspublic void notifyTaskFailed(Execution execution)
SpeculativeExecutionHandler
notifyTaskFailed
in interface SpeculativeExecutionHandler
execution
- the execution that has failedpublic boolean handleTaskFailure(Execution failedExecution, @Nullable Throwable error, java.util.function.BiConsumer<Execution,Throwable> handleLocalExecutionAttemptFailure)
SpeculativeExecutionHandler
handleTaskFailure
in interface SpeculativeExecutionHandler
failedExecution
- the execution that failederror
- the error that caused the failure, if availablehandleLocalExecutionAttemptFailure
- a consumer that handles local execution attempt
failurepublic void notifySlowTasks(Map<ExecutionVertexID,Collection<ExecutionAttemptID>> slowTasks)
SlowTaskDetectorListener
notifySlowTasks
in interface SlowTaskDetectorListener
slowTasks
- the map of execution vertices and their execution attempts which are
detected as slow.public void resetForNewExecution(ExecutionVertexID executionVertexId)
SpeculativeExecutionHandler
resetForNewExecution
in interface SpeculativeExecutionHandler
executionVertexId
- the ID of the execution vertex to resetCopyright © 2014–2024 The Apache Software Foundation. All rights reserved.