Class ExponentialDelayRestartBackoffTimeStrategy
- java.lang.Object
-
- org.apache.flink.runtime.executiongraph.failover.ExponentialDelayRestartBackoffTimeStrategy
-
- All Implemented Interfaces:
RestartBackoffTimeStrategy
public class ExponentialDelayRestartBackoffTimeStrategy extends Object implements RestartBackoffTimeStrategy
Restart strategy which tries to restart indefinitely number of times with an exponential backoff time in between. The delay starts at initial value and keeps increasing (multiplying by backoff multiplier) until maximum delay is reached.If the tasks are running smoothly for some time, backoff is reset to its initial value.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ExponentialDelayRestartBackoffTimeStrategy.ExponentialDelayRestartBackoffTimeStrategyFactory
The factory for creatingExponentialDelayRestartBackoffTimeStrategy
.-
Nested classes/interfaces inherited from interface org.apache.flink.runtime.executiongraph.failover.RestartBackoffTimeStrategy
RestartBackoffTimeStrategy.Factory
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
canRestart()
Returns whether a restart should be conducted.static ExponentialDelayRestartBackoffTimeStrategy.ExponentialDelayRestartBackoffTimeStrategyFactory
createFactory(org.apache.flink.configuration.Configuration configuration)
long
getBackoffTime()
Returns the delay to do the restarting.boolean
notifyFailure(Throwable cause)
Notify the strategy about the task failure cause.String
toString()
-
-
-
Method Detail
-
canRestart
public boolean canRestart()
Description copied from interface:RestartBackoffTimeStrategy
Returns whether a restart should be conducted.- Specified by:
canRestart
in interfaceRestartBackoffTimeStrategy
- Returns:
- whether a restart should be conducted
-
getBackoffTime
public long getBackoffTime()
Description copied from interface:RestartBackoffTimeStrategy
Returns the delay to do the restarting.- Specified by:
getBackoffTime
in interfaceRestartBackoffTimeStrategy
- Returns:
- the delay to do the restarting
-
notifyFailure
public boolean notifyFailure(Throwable cause)
Description copied from interface:RestartBackoffTimeStrategy
Notify the strategy about the task failure cause.- Specified by:
notifyFailure
in interfaceRestartBackoffTimeStrategy
- Parameters:
cause
- of the task failure- Returns:
- True means that the current failure is the first one after the most-recent failure handling happened, false means that there has been a failure before that was not handled, yet, and the current failure will be considered in a combined failure handling effort.
-
createFactory
public static ExponentialDelayRestartBackoffTimeStrategy.ExponentialDelayRestartBackoffTimeStrategyFactory createFactory(org.apache.flink.configuration.Configuration configuration)
-
-