Package akka.stream.impl.fusing
Class GraphInterpreter
- java.lang.Object
-
- akka.stream.impl.fusing.GraphInterpreter
-
public final class GraphInterpreter extends java.lang.ObjectINTERNAL API
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classGraphInterpreter.ConnectionINERNAL APIstatic classGraphInterpreter.DownstreamBoundaryStageLogic<T>static classGraphInterpreter.Empty$Marker object that indicates that a port holds no element since it was already grabbed.static classGraphInterpreter.Failedstatic classGraphInterpreter.Failed$static classGraphInterpreter.UpstreamBoundaryStageLogic<T>
-
Constructor Summary
Constructors Constructor Description GraphInterpreter(Materializer materializer, LoggingAdapter log, GraphStageLogic[] logics, GraphInterpreter.Connection[] connections, scala.Function4<GraphStageLogic,java.lang.Object,scala.concurrent.Promise<Done>,scala.Function1<java.lang.Object,scala.runtime.BoxedUnit>,scala.runtime.BoxedUnit> onAsyncInput, boolean fuzzingMode, ActorRef context)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description GraphStageLogicactiveStage()voidactiveStage_$eq(GraphStageLogic x$1)voidafterStageHasRun(GraphStageLogic logic)voidcancel(GraphInterpreter.Connection connection)voidchasePull(GraphInterpreter.Connection connection)voidchasePush(GraphInterpreter.Connection connection)voidcomplete(GraphInterpreter.Connection connection)GraphInterpreter.Connection[]connections()ActorRefcontext()static GraphInterpretercurrentInterpreter()INTERNAL APIstatic GraphInterpretercurrentInterpreterOrNull()INTERNAL APIstatic booleanDebug()voidenqueue(GraphInterpreter.Connection connection)intexecute(int eventLimit)Executes pending events until the given limit is met.voidfail(GraphInterpreter.Connection connection, java.lang.Throwable ex)voidfinalizeStage(GraphStageLogic logic)voidfinish()Finalizes the state of all operators by calling postStop() (if necessary).booleanfuzzingMode()static intInClosed()static intInFailed()voidinit(Materializer subMat)Initializes the states of all the operator logics by calling preStart().static intInReady()booleanisCompleted()Returns true if there are no more running operators and pending events.booleanisStageCompleted(GraphStageLogic stage)booleanisSuspended()Returns true if there are pending unprocessed events in the event queue.static intKeepGoingFlag()static intKeepGoingMask()LoggingAdapterlog()GraphStageLogic[]logics()Materializermaterializer()java.lang.StringName()static scala.runtime.Null$NoEvent()GraphInterpreternonNull()INTERNAL APIscala.Function4<GraphStageLogic,java.lang.Object,scala.concurrent.Promise<Done>,scala.Function1<java.lang.Object,scala.runtime.BoxedUnit>,scala.runtime.BoxedUnit>onAsyncInput()static intOutClosed()static intOutReady()static intPullEndFlip()static intPulling()static intPullStartFlip()static intPushEndFlip()static intPushing()static intPushStartFlip()voidrunAsyncInput(GraphStageLogic logic, java.lang.Object evt, scala.concurrent.Promise<Done> promise, scala.Function1<java.lang.Object,scala.runtime.BoxedUnit> handler)voidsetHandler(GraphInterpreter.Connection connection, InHandler handler)Dynamic handler changes are communicated from a GraphStageLogic by this method.voidsetHandler(GraphInterpreter.Connection connection, OutHandler handler)Dynamic handler changes are communicated from a GraphStageLogic by this method.voidsetKeepGoing(GraphStageLogic logic, boolean enabled)static Attributes[]singleNoAttribute()MaterializersubFusingMaterializer()RunningInterpretertoSnapshot()Debug utility to dump the "waits-on" relationships in an AST format for rendering in some suitable format for analysis of deadlocks.
-
-
-
Constructor Detail
-
GraphInterpreter
public GraphInterpreter(Materializer materializer, LoggingAdapter log, GraphStageLogic[] logics, GraphInterpreter.Connection[] connections, scala.Function4<GraphStageLogic,java.lang.Object,scala.concurrent.Promise<Done>,scala.Function1<java.lang.Object,scala.runtime.BoxedUnit>,scala.runtime.BoxedUnit> onAsyncInput, boolean fuzzingMode, ActorRef context)
-
-
Method Detail
-
Debug
public static final boolean Debug()
-
NoEvent
public static final scala.runtime.Null$ NoEvent()
-
InReady
public static final int InReady()
-
Pulling
public static final int Pulling()
-
Pushing
public static final int Pushing()
-
OutReady
public static final int OutReady()
-
InClosed
public static final int InClosed()
-
OutClosed
public static final int OutClosed()
-
InFailed
public static final int InFailed()
-
PullStartFlip
public static final int PullStartFlip()
-
PullEndFlip
public static final int PullEndFlip()
-
PushStartFlip
public static final int PushStartFlip()
-
PushEndFlip
public static final int PushEndFlip()
-
KeepGoingFlag
public static final int KeepGoingFlag()
-
KeepGoingMask
public static final int KeepGoingMask()
-
singleNoAttribute
public static Attributes[] singleNoAttribute()
-
currentInterpreter
public static GraphInterpreter currentInterpreter()
INTERNAL API- Returns:
- (undocumented)
-
currentInterpreterOrNull
public static GraphInterpreter currentInterpreterOrNull()
INTERNAL API- Returns:
- (undocumented)
-
materializer
public Materializer materializer()
-
log
public LoggingAdapter log()
-
logics
public GraphStageLogic[] logics()
-
connections
public GraphInterpreter.Connection[] connections()
-
onAsyncInput
public scala.Function4<GraphStageLogic,java.lang.Object,scala.concurrent.Promise<Done>,scala.Function1<java.lang.Object,scala.runtime.BoxedUnit>,scala.runtime.BoxedUnit> onAsyncInput()
-
fuzzingMode
public boolean fuzzingMode()
-
context
public ActorRef context()
-
activeStage
public GraphStageLogic activeStage()
-
activeStage_$eq
public void activeStage_$eq(GraphStageLogic x$1)
-
subFusingMaterializer
public Materializer subFusingMaterializer()
-
Name
public java.lang.String Name()
-
nonNull
public GraphInterpreter nonNull()
INTERNAL API- Returns:
- (undocumented)
-
setHandler
public void setHandler(GraphInterpreter.Connection connection, InHandler handler)
Dynamic handler changes are communicated from a GraphStageLogic by this method.- Parameters:
connection- (undocumented)handler- (undocumented)
-
setHandler
public void setHandler(GraphInterpreter.Connection connection, OutHandler handler)
Dynamic handler changes are communicated from a GraphStageLogic by this method.- Parameters:
connection- (undocumented)handler- (undocumented)
-
isSuspended
public boolean isSuspended()
Returns true if there are pending unprocessed events in the event queue.- Returns:
- (undocumented)
-
isCompleted
public boolean isCompleted()
Returns true if there are no more running operators and pending events.- Returns:
- (undocumented)
-
init
public void init(Materializer subMat)
Initializes the states of all the operator logics by calling preStart(). The passed-in materializer is intended to be a SubFusingActorMaterializer that avoids creating new Actors when operators materialize sub-flows. If no such materializer is available, passing innullwill reuse the normal materializer for the GraphInterpreter—fusing is only an optimization.- Parameters:
subMat- (undocumented)
-
finish
public void finish()
Finalizes the state of all operators by calling postStop() (if necessary).
-
execute
public int execute(int eventLimit)
Executes pending events until the given limit is met. If there were remaining events, isSuspended will return true.- Parameters:
eventLimit- (undocumented)- Returns:
- (undocumented)
-
runAsyncInput
public void runAsyncInput(GraphStageLogic logic, java.lang.Object evt, scala.concurrent.Promise<Done> promise, scala.Function1<java.lang.Object,scala.runtime.BoxedUnit> handler)
-
enqueue
public void enqueue(GraphInterpreter.Connection connection)
-
afterStageHasRun
public void afterStageHasRun(GraphStageLogic logic)
-
isStageCompleted
public boolean isStageCompleted(GraphStageLogic stage)
-
setKeepGoing
public void setKeepGoing(GraphStageLogic logic, boolean enabled)
-
finalizeStage
public void finalizeStage(GraphStageLogic logic)
-
chasePush
public void chasePush(GraphInterpreter.Connection connection)
-
chasePull
public void chasePull(GraphInterpreter.Connection connection)
-
complete
public void complete(GraphInterpreter.Connection connection)
-
fail
public void fail(GraphInterpreter.Connection connection, java.lang.Throwable ex)
-
cancel
public void cancel(GraphInterpreter.Connection connection)
-
toSnapshot
public RunningInterpreter toSnapshot()
Debug utility to dump the "waits-on" relationships in an AST format for rendering in some suitable format for analysis of deadlocks.Only invoke this after the interpreter completely settled, otherwise the results might be off. This is a very simplistic tool, make sure you are understanding what you are doing and then it will serve you well.
- Returns:
- (undocumented)
-
-