public final class DriverRestartManager extends Object implements DriverIdlenessSource, AutoCloseable
Modifier and Type | Method and Description |
---|---|
void |
close()
Close the restart timer.
|
boolean |
detectRestart()
Triggers the state machine if the application is a restart instance.
|
EvaluatorRestartState |
getEvaluatorRestartState(String evaluatorId) |
IdleMessage |
getIdleStatus() |
ResourceRecoverEvent |
getResourceRecoverEvent(String evaluatorId) |
boolean |
isRestarting() |
boolean |
onRecoverEvaluator(String evaluatorId)
Indicate that this Driver has re-established the connection with one more Evaluator of a previous run.
|
void |
onRestart(StartTime startTime,
List<EventHandler<DriverRestarted>> orderedHandlers)
Recovers the list of alive and failed evaluators and inform the driver restart handlers and inform the
evaluator failure handlers based on the specific runtime.
|
void |
recordAllocatedEvaluator(String id)
Records the evaluators when it is allocated.
|
void |
recordRemovedEvaluator(String id)
Records a removed evaluator into the evaluator log.
|
void |
setEvaluatorExpired(String evaluatorId)
Signals to the
DriverRestartManager that an expected evaluator has been expired. |
void |
setEvaluatorProcessed(String evaluatorId)
Signals to the
DriverRestartManager that an evaluator has had its running task or active context processed. |
void |
setEvaluatorReported(String evaluatorId)
Signals to the
DriverRestartManager that an evaluator has reported back after restart. |
void |
setEvaluatorReregistered(String evaluatorId)
Signals to the
DriverRestartManager that an evaluator has had its recovery heartbeat processed. |
public boolean detectRestart()
public boolean isRestarting()
public void onRestart(StartTime startTime, List<EventHandler<DriverRestarted>> orderedHandlers)
public EvaluatorRestartState getEvaluatorRestartState(String evaluatorId)
EvaluatorRestartState.NOT_EXPECTED
if the DriverRestartManager
does not believe that it's an evaluator to be recovered.public ResourceRecoverEvent getResourceRecoverEvent(String evaluatorId)
DriverFatalRuntimeException
if
the evaluator does not exist in the set of known evaluators.public boolean onRecoverEvaluator(String evaluatorId)
public void recordAllocatedEvaluator(String id)
id
- The evaluator ID of the allocated evaluator.public void recordRemovedEvaluator(String id)
id
- The evaluator ID of the removed evaluator.public void setEvaluatorReported(String evaluatorId)
DriverRestartManager
that an evaluator has reported back after restart.public void setEvaluatorReregistered(String evaluatorId)
DriverRestartManager
that an evaluator has had its recovery heartbeat processed.public void setEvaluatorProcessed(String evaluatorId)
DriverRestartManager
that an evaluator has had its running task or active context processed.public void setEvaluatorExpired(String evaluatorId)
DriverRestartManager
that an expected evaluator has been expired.public IdleMessage getIdleStatus()
getIdleStatus
in interface DriverIdlenessSource
public void close()
close
in interface AutoCloseable
Copyright © 2017 The Apache Software Foundation. All rights reserved.