Class PhasedFusingActorMaterializer
- java.lang.Object
-
- akka.stream.Materializer
-
- akka.stream.ActorMaterializer
-
- akka.stream.impl.ExtendedActorMaterializer
-
- akka.stream.impl.PhasedFusingActorMaterializer
-
- All Implemented Interfaces:
MaterializerLoggingProvider
,java.io.Serializable
,scala.Equals
,scala.Product
public class PhasedFusingActorMaterializer extends ExtendedActorMaterializer implements scala.Product, java.io.Serializable
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description PhasedFusingActorMaterializer(ActorSystem system, ActorMaterializerSettings settings, Attributes defaultAttributes, Dispatchers dispatchers, ActorRef supervisor, java.util.concurrent.atomic.AtomicBoolean haveShutDown, SeqActorName flowNames)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description ActorRef
actorOf(MaterializationContext context, Props props)
INTERNAL APIstatic PhasedFusingActorMaterializer
apply(ActorContext context, java.lang.String namePrefix, ActorMaterializerSettings settings, Attributes attributes)
static PhasedFusingActorMaterializer
apply(ActorSystem system, ActorMaterializerSettings settings, Attributes defaultAttributes, Dispatchers dispatchers, ActorRef supervisor, java.util.concurrent.atomic.AtomicBoolean haveShutDown, SeqActorName flowNames)
INTERNAL APIboolean
canEqual(java.lang.Object x$1)
PhasedFusingActorMaterializer
copy(ActorSystem system, ActorMaterializerSettings settings, Attributes defaultAttributes, Dispatchers dispatchers, ActorRef supervisor, java.util.concurrent.atomic.AtomicBoolean haveShutDown, SeqActorName flowNames)
ActorSystem
copy$default$1()
ActorMaterializerSettings
copy$default$2()
Attributes
copy$default$3()
Dispatchers
copy$default$4()
ActorRef
copy$default$5()
java.util.concurrent.atomic.AtomicBoolean
copy$default$6()
SeqActorName
copy$default$7()
static boolean
Debug()
Attributes
defaultAttributes()
static Phase<java.lang.Object>
DefaultPhase()
static scala.collection.immutable.Map<IslandTag,Phase<java.lang.Object>>
DefaultPhases()
Dispatchers
dispatchers()
boolean
equals(java.lang.Object x$1)
scala.concurrent.ExecutionContextExecutor
executionContext()
Running a flow graph will require execution resources, as will computations within Sources, Sinks, etc.SeqActorName
flowNames()
int
hashCode()
java.util.concurrent.atomic.AtomicBoolean
haveShutDown()
boolean
isShutdown()
Indicates if the materializer has been shut down.LoggingAdapter
logger()
INTERNAL APILoggingAdapter
makeLogger(java.lang.Class<java.lang.Object> logSource)
<Mat> Mat
materialize(Graph<ClosedShape,Mat> _runnableGraph)
INTERNAL API<Mat> Mat
materialize(Graph<ClosedShape,Mat> _runnableGraph, Attributes defaultAttributes)
INTERNAL API<Mat> Mat
materialize(Graph<ClosedShape,Mat> graph, Attributes defaultAttributes, Phase<java.lang.Object> defaultPhase, scala.collection.immutable.Map<IslandTag,Phase<java.lang.Object>> phases)
INTERNAL APIint
productArity()
java.lang.Object
productElement(int x$1)
java.lang.String
productElementName(int x$1)
scala.collection.Iterator<java.lang.Object>
productIterator()
java.lang.String
productPrefix()
Cancellable
scheduleAtFixedRate(scala.concurrent.duration.FiniteDuration initialDelay, scala.concurrent.duration.FiniteDuration interval, java.lang.Runnable task)
Interface for operators that need timer services for their functionality.Cancellable
scheduleOnce(scala.concurrent.duration.FiniteDuration delay, java.lang.Runnable task)
Interface for operators that need timer services for their functionality.Cancellable
schedulePeriodically(scala.concurrent.duration.FiniteDuration initialDelay, scala.concurrent.duration.FiniteDuration interval, java.lang.Runnable task)
Interface for operators that need timer services for their functionality.Cancellable
scheduleWithFixedDelay(scala.concurrent.duration.FiniteDuration initialDelay, scala.concurrent.duration.FiniteDuration delay, java.lang.Runnable task)
Interface for operators that need timer services for their functionality.ActorMaterializerSettings
settings()
void
shutdown()
Shuts down this materializer and all the operators that have been materialized through this materializer.ActorRef
supervisor()
INTERNAL APIActorSystem
system()
INTERNAL APIjava.lang.String
toString()
static scala.Option<scala.Tuple7<ActorSystem,ActorMaterializerSettings,Attributes,Dispatchers,ActorRef,java.util.concurrent.atomic.AtomicBoolean,SeqActorName>>
unapply(PhasedFusingActorMaterializer x$0)
PhasedFusingActorMaterializer
withNamePrefix(java.lang.String name)
ThenamePrefix
shall be used for deriving the names of processing entities that are created during materialization.-
Methods inherited from class akka.stream.impl.ExtendedActorMaterializer
actorOf
-
Methods inherited from class akka.stream.ActorMaterializer
apply, apply, apply, apply$default$1, apply$default$2, create, create, create, create
-
Methods inherited from class akka.stream.Materializer
apply, apply, createMaterializer, createMaterializer, matFromSystem
-
-
-
-
Constructor Detail
-
PhasedFusingActorMaterializer
public PhasedFusingActorMaterializer(ActorSystem system, ActorMaterializerSettings settings, Attributes defaultAttributes, Dispatchers dispatchers, ActorRef supervisor, java.util.concurrent.atomic.AtomicBoolean haveShutDown, SeqActorName flowNames)
-
-
Method Detail
-
Debug
public static boolean Debug()
-
DefaultPhase
public static Phase<java.lang.Object> DefaultPhase()
-
DefaultPhases
public static scala.collection.immutable.Map<IslandTag,Phase<java.lang.Object>> DefaultPhases()
-
apply
public static PhasedFusingActorMaterializer apply(ActorContext context, java.lang.String namePrefix, ActorMaterializerSettings settings, Attributes attributes)
-
apply
public static PhasedFusingActorMaterializer apply(ActorSystem system, ActorMaterializerSettings settings, Attributes defaultAttributes, Dispatchers dispatchers, ActorRef supervisor, java.util.concurrent.atomic.AtomicBoolean haveShutDown, SeqActorName flowNames)
INTERNAL APIdefaultAttributes
for the materializer, based on theActorMaterializerSettings
and are always seen as least specific, so any attribute specified in the graph "wins" over these. In addition to that this also guarantees that the attributesInputBuffer
,SupervisionStrategy
, andDispatcher
is _always_ present in the attributes and can be accessed throughAttributes.mandatoryAttribute
When these attributes are needed later in the materialization process it is important that they are gotten through the attributes and not through the
ActorMaterializerSettings
-
unapply
public static scala.Option<scala.Tuple7<ActorSystem,ActorMaterializerSettings,Attributes,Dispatchers,ActorRef,java.util.concurrent.atomic.AtomicBoolean,SeqActorName>> unapply(PhasedFusingActorMaterializer x$0)
-
system
public ActorSystem system()
Description copied from class:ActorMaterializer
INTERNAL API- Specified by:
system
in classActorMaterializer
-
settings
public ActorMaterializerSettings settings()
- Specified by:
settings
in classActorMaterializer
-
defaultAttributes
public Attributes defaultAttributes()
-
dispatchers
public Dispatchers dispatchers()
-
supervisor
public ActorRef supervisor()
Description copied from class:ExtendedActorMaterializer
INTERNAL API- Specified by:
supervisor
in classExtendedActorMaterializer
-
haveShutDown
public java.util.concurrent.atomic.AtomicBoolean haveShutDown()
-
flowNames
public SeqActorName flowNames()
-
logger
public LoggingAdapter logger()
Description copied from class:ExtendedActorMaterializer
INTERNAL API- Specified by:
logger
in classExtendedActorMaterializer
-
shutdown
public void shutdown()
Description copied from class:ActorMaterializer
Shuts down this materializer and all the operators that have been materialized through this materializer. After having shut down, this materializer cannot be used again. Any attempt to materialize operators after having shut down will result in an IllegalStateException being thrown at materialization time.- Specified by:
shutdown
in classActorMaterializer
-
isShutdown
public boolean isShutdown()
Description copied from class:ActorMaterializer
Indicates if the materializer has been shut down.- Specified by:
isShutdown
in classActorMaterializer
-
withNamePrefix
public PhasedFusingActorMaterializer withNamePrefix(java.lang.String name)
Description copied from class:Materializer
ThenamePrefix
shall be used for deriving the names of processing entities that are created during materialization. This is meant to aid logging and failure reporting both during materialization and while the stream is running.- Specified by:
withNamePrefix
in classExtendedActorMaterializer
-
executionContext
public scala.concurrent.ExecutionContextExecutor executionContext()
Description copied from class:Materializer
Running a flow graph will require execution resources, as will computations within Sources, Sinks, etc. ThisExecutionContextExecutor
can be used by parts of the flow to submit processing jobs for execution, run Future callbacks, etc.Note that this is not necessarily the same execution context the stream operator itself is running on.
- Specified by:
executionContext
in classMaterializer
-
scheduleWithFixedDelay
public Cancellable scheduleWithFixedDelay(scala.concurrent.duration.FiniteDuration initialDelay, scala.concurrent.duration.FiniteDuration delay, java.lang.Runnable task)
Description copied from class:Materializer
Interface for operators that need timer services for their functionality.Schedules a
Runnable
to be run repeatedly with an initial delay and a fixeddelay
between subsequent executions.It will not compensate the delay between tasks if the execution takes a long time or if scheduling is delayed longer than specified for some reason. The delay between subsequent execution will always be (at least) the given
delay
. In the long run, the frequency of execution will generally be slightly lower than the reciprocal of the specifieddelay
.If the
Runnable
throws an exception the repeated scheduling is aborted, i.e. the function will not be invoked any more.- Specified by:
scheduleWithFixedDelay
in classMaterializer
- Returns:
- A
Cancellable
that allows cancelling the timer. Cancelling is best effort, if the event has been already enqueued it will not have an effect.
-
scheduleAtFixedRate
public Cancellable scheduleAtFixedRate(scala.concurrent.duration.FiniteDuration initialDelay, scala.concurrent.duration.FiniteDuration interval, java.lang.Runnable task)
Description copied from class:Materializer
Interface for operators that need timer services for their functionality.Schedules a
Runnable
to be run repeatedly with an initial delay and a frequency. E.g. if you would like the function to be run after 2 seconds and thereafter every 100ms you would setdelay=Duration(2, TimeUnit.SECONDS)
andinterval=Duration(100, TimeUnit.MILLISECONDS)
.It will compensate the delay for a subsequent task if the previous tasks took too long to execute. In such cases, the actual execution interval will differ from the interval passed to the method.
If the execution of the tasks takes longer than the
interval
, the subsequent execution will start immediately after the prior one completes (there will be no overlap of executions). This also has the consequence that after long garbage collection pauses or other reasons when the JVM was suspended all "missed" tasks will execute when the process wakes up again.In the long run, the frequency of execution will be exactly the reciprocal of the specified
interval
.Warning:
scheduleAtFixedRate
can result in bursts of scheduled tasks after long garbage collection pauses, which may in worst case cause undesired load on the system. ThereforescheduleWithFixedDelay
is often preferred.If the
Runnable
throws an exception the repeated scheduling is aborted, i.e. the function will not be invoked any more.- Specified by:
scheduleAtFixedRate
in classMaterializer
- Returns:
- A
Cancellable
that allows cancelling the timer. Cancelling is best effort, if the event has been already enqueued it will not have an effect.
-
schedulePeriodically
public Cancellable schedulePeriodically(scala.concurrent.duration.FiniteDuration initialDelay, scala.concurrent.duration.FiniteDuration interval, java.lang.Runnable task)
Description copied from class:Materializer
Interface for operators that need timer services for their functionality. Schedules a repeated task with the given interval between invocations.- Specified by:
schedulePeriodically
in classMaterializer
- Returns:
- A
Cancellable
that allows cancelling the timer. Cancelling is best effort, if the event has been already enqueued it will not have an effect.
-
scheduleOnce
public Cancellable scheduleOnce(scala.concurrent.duration.FiniteDuration delay, java.lang.Runnable task)
Description copied from class:Materializer
Interface for operators that need timer services for their functionality. Schedules a single task with the given delay.- Specified by:
scheduleOnce
in classMaterializer
- Returns:
- A
Cancellable
that allows cancelling the timer. Cancelling is best effort, if the event has been already enqueued it will not have an effect.
-
materialize
public <Mat> Mat materialize(Graph<ClosedShape,Mat> _runnableGraph)
Description copied from class:ExtendedActorMaterializer
INTERNAL API- Specified by:
materialize
in classExtendedActorMaterializer
-
materialize
public <Mat> Mat materialize(Graph<ClosedShape,Mat> _runnableGraph, Attributes defaultAttributes)
Description copied from class:ExtendedActorMaterializer
INTERNAL API- Specified by:
materialize
in classExtendedActorMaterializer
-
materialize
public <Mat> Mat materialize(Graph<ClosedShape,Mat> graph, Attributes defaultAttributes, Phase<java.lang.Object> defaultPhase, scala.collection.immutable.Map<IslandTag,Phase<java.lang.Object>> phases)
Description copied from class:ExtendedActorMaterializer
INTERNAL API- Specified by:
materialize
in classExtendedActorMaterializer
-
makeLogger
public LoggingAdapter makeLogger(java.lang.Class<java.lang.Object> logSource)
- Specified by:
makeLogger
in interfaceMaterializerLoggingProvider
-
actorOf
public ActorRef actorOf(MaterializationContext context, Props props)
INTERNAL API- Overrides:
actorOf
in classExtendedActorMaterializer
-
copy
public PhasedFusingActorMaterializer copy(ActorSystem system, ActorMaterializerSettings settings, Attributes defaultAttributes, Dispatchers dispatchers, ActorRef supervisor, java.util.concurrent.atomic.AtomicBoolean haveShutDown, SeqActorName flowNames)
-
copy$default$1
public ActorSystem copy$default$1()
-
copy$default$2
public ActorMaterializerSettings copy$default$2()
-
copy$default$3
public Attributes copy$default$3()
-
copy$default$4
public Dispatchers copy$default$4()
-
copy$default$5
public ActorRef copy$default$5()
-
copy$default$6
public java.util.concurrent.atomic.AtomicBoolean copy$default$6()
-
copy$default$7
public SeqActorName copy$default$7()
-
productPrefix
public java.lang.String productPrefix()
- Specified by:
productPrefix
in interfacescala.Product
-
productArity
public int productArity()
- Specified by:
productArity
in interfacescala.Product
-
productElement
public java.lang.Object productElement(int x$1)
- Specified by:
productElement
in interfacescala.Product
-
productIterator
public scala.collection.Iterator<java.lang.Object> productIterator()
- Specified by:
productIterator
in interfacescala.Product
-
canEqual
public boolean canEqual(java.lang.Object x$1)
- Specified by:
canEqual
in interfacescala.Equals
-
productElementName
public java.lang.String productElementName(int x$1)
- Specified by:
productElementName
in interfacescala.Product
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object x$1)
- Specified by:
equals
in interfacescala.Equals
- Overrides:
equals
in classjava.lang.Object
-
-