Package org.apache.pekko.stream.scaladsl
Class RestartWithBackoffLogic<S extends Shape>
java.lang.Object
org.apache.pekko.stream.stage.GraphStageLogic
org.apache.pekko.stream.stage.TimerGraphStageLogic
org.apache.pekko.stream.stage.TimerGraphStageLogicWithLogging
org.apache.pekko.stream.scaladsl.RestartWithBackoffLogic<S>
- All Implemented Interfaces:
StageLogging
public abstract class RestartWithBackoffLogic<S extends Shape>
extends TimerGraphStageLogicWithLogging
Shared logic for all restart with backoff logics.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.pekko.stream.stage.GraphStageLogic
GraphStageLogic.ConditionalTerminateInput, GraphStageLogic.ConditionalTerminateOutput, GraphStageLogic.EagerTerminateInput$, GraphStageLogic.EagerTerminateOutput$, GraphStageLogic.IgnoreTerminateInput$, GraphStageLogic.IgnoreTerminateOutput$, GraphStageLogic.StageActor, GraphStageLogic.StageActorRef$, GraphStageLogic.StageActorRefNotInitializedException, GraphStageLogic.StageActorRefNotInitializedException$, GraphStageLogic.SubSinkInlet<T>, GraphStageLogic.SubSourceOutlet<T>, GraphStageLogic.TotallyIgnorantInput$ -
Constructor Summary
ConstructorsConstructorDescriptionRestartWithBackoffLogic(String name, S shape, Attributes inheritedAttributes, RestartSettings settings, boolean onlyOnFailures) -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract voidbackoff()protected final <T> GraphStageLogic.SubSinkInlet<T>createSubInlet(Outlet<T> out) protected final <T> GraphStageLogic.SubSourceOutlet<T>createSubOutlet(Inlet<T> in) booleanvoidfinishing_$eq(boolean x$1) protected Class<?>Override to customise reported log sourceprotected final booleanprotected voidWill be called when the scheduled timer is triggered.voidpreStart()Invoked before any external events are processed, at the startup of the operator.scala.concurrent.duration.DeadlinevoidresetDeadline_$eq(scala.concurrent.duration.Deadline x$1) intvoidrestartCount_$eq(int x$1) protected final voidprotected abstract voidMethods inherited from class org.apache.pekko.stream.stage.TimerGraphStageLogic
afterPostStop, cancelTimer, isTimerActive, scheduleAtFixedRate, scheduleAtFixedRate, scheduleOnce, scheduleOnce, scheduleWithFixedDelay, scheduleWithFixedDelayMethods inherited from class org.apache.pekko.stream.stage.GraphStageLogic
abortEmitting, abortReading, beforePreStart, cancel, cancel, cancelStage, complete, completeStage, conditionalTerminateInput, conditionalTerminateOutput, createAsyncCallback, eagerTerminateInput, eagerTerminateOutput, emit, emit, emit, emitMultiple, emitMultiple, emitMultiple, emitMultiple, emitMultiple, emitMultiple, emitMultiple, fail, failStage, getAsyncCallback, getEagerStageActor, getHandler, getHandler, getStageActor, grab, hasBeenPulled, ignoreTerminateInput, ignoreTerminateOutput, inCount, isAvailable, isAvailable, isClosed, isClosed, materializer, outCount, passAlong, passAlong$default$3, passAlong$default$4, passAlong$default$5, postStop, pull, push, read, read, readN, readN, setHandler, setHandler, setHandlers, setKeepGoing, stageActor, stageActorName, subFusingMaterializer, toString, totallyIgnorantInput, tryPullMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.pekko.stream.stage.StageLogging
_log_$eq, log
-
Constructor Details
-
RestartWithBackoffLogic
public RestartWithBackoffLogic(String name, S shape, Attributes inheritedAttributes, RestartSettings settings, boolean onlyOnFailures)
-
-
Method Details
-
backoff
protected abstract void backoff() -
createSubInlet
- Parameters:
out- The permanent outlet- Returns:
- A sub sink inlet that's sink is attached to the wrapped operator
-
createSubOutlet
- Parameters:
in- The permanent inlet for this operator- Returns:
- Temporary SubSourceOutlet for this "restart"
-
finishing
public boolean finishing() -
finishing_$eq
public void finishing_$eq(boolean x$1) -
logSource
Description copied from interface:StageLoggingOverride to customise reported log source -
maxRestartsReached
protected final boolean maxRestartsReached() -
onTimer
Description copied from class:TimerGraphStageLogicWill be called when the scheduled timer is triggered.- Overrides:
onTimerin classTimerGraphStageLogic- Parameters:
timerKey- key of the scheduled timer
-
preStart
public void preStart()Description copied from class:GraphStageLogicInvoked before any external events are processed, at the startup of the operator.- Overrides:
preStartin classGraphStageLogic
-
resetDeadline
public scala.concurrent.duration.Deadline resetDeadline() -
resetDeadline_$eq
public void resetDeadline_$eq(scala.concurrent.duration.Deadline x$1) -
restartCount
public int restartCount() -
restartCount_$eq
public void restartCount_$eq(int x$1) -
scheduleRestartTimer
protected final void scheduleRestartTimer() -
startGraph
protected abstract void startGraph()
-