public class FixedDelayRestartStrategy extends Object implements RestartStrategy
ExecutionGraph
a fixed number of times
with a fixed time delay in between.Modifier and Type | Class and Description |
---|---|
static class |
FixedDelayRestartStrategy.FixedDelayRestartStrategyFactory |
Constructor and Description |
---|
FixedDelayRestartStrategy(int maxNumberRestartAttempts,
long delayBetweenRestartAttempts) |
Modifier and Type | Method and Description |
---|---|
boolean |
canRestart()
True if the restart strategy can be applied to restart the
ExecutionGraph . |
static FixedDelayRestartStrategy.FixedDelayRestartStrategyFactory |
createFactory(Configuration configuration)
Creates a FixedDelayRestartStrategy from the given Configuration.
|
int |
getCurrentRestartAttempt() |
CompletableFuture<Void> |
restart(RestartCallback restarter,
ScheduledExecutor executor)
Called by the ExecutionGraph to eventually trigger a full recovery.
|
String |
toString() |
public FixedDelayRestartStrategy(int maxNumberRestartAttempts, long delayBetweenRestartAttempts)
public int getCurrentRestartAttempt()
public boolean canRestart()
RestartStrategy
ExecutionGraph
.canRestart
in interface RestartStrategy
public CompletableFuture<Void> restart(RestartCallback restarter, ScheduledExecutor executor)
RestartStrategy
The thread that calls this method is not supposed to block/sleep.
restart
in interface RestartStrategy
restarter
- The hook to restart the ExecutionGraphexecutor
- An scheduled executor to delay the restartCompletableFuture
that will be completed when the restarting process is done.public static FixedDelayRestartStrategy.FixedDelayRestartStrategyFactory createFactory(Configuration configuration) throws Exception
configuration
- Configuration containing the parameter values for the restart strategyException
Copyright © 2014–2020 The Apache Software Foundation. All rights reserved.