Package akka.remote.artery
Class ArteryTransport
- java.lang.Object
-
- akka.remote.RemoteTransport
-
- akka.remote.artery.ArteryTransport
-
- All Implemented Interfaces:
InboundContext
- Direct Known Subclasses:
ArteryAeronUdpTransport
,ArteryTcpTransport
public abstract class ArteryTransport extends RemoteTransport implements InboundContext
Compression tables must be created once, such that inbound lane restarts don't cause dropping of the tables. However are the InboundCompressions are owned by the Decoder operator, and any call into them must be looped through the Decoder!Use
inboundCompressionAccess
(provided by the materializedDecoder
) to call into the compression infrastructure.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ArteryTransport.AeronTerminated
static class
ArteryTransport.InboundStreamMatValues<LifeCycle>
static class
ArteryTransport.InboundStreamMatValues$
static class
ArteryTransport.ShutdownSignal$
static class
ArteryTransport.ShuttingDown$
-
Constructor Summary
Constructors Constructor Description ArteryTransport(ExtendedActorSystem _system, RemoteActorRefProvider _provider)
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected InboundCompressions
_inboundCompressions()
Compression tables must be created once, such that inbound lane restarts don't cause dropping of the tables.scala.collection.immutable.Set<Address>
addresses()
Address to be used in RootActorPath of refs generated for this transport.scala.Option<java.nio.file.Path>
afrFile()
scala.Option<java.nio.channels.FileChannel>
afrFileChannel()
OptionVal<Association>
association(long uid)
Lookup the outbound association for a given UID.Association
association(Address remoteAddress)
Lookup the outbound association for a given address.protected void
attachControlMessageObserver(InboundControlJunction.ControlMessageSubject ctrl)
protected void
attachInboundStreamRestart(java.lang.String streamName, scala.concurrent.Future<Done> streamCompleted, scala.Function0<scala.runtime.BoxedUnit> restart)
UniqueAddress
bindAddress()
protected abstract scala.Tuple2<java.lang.Object,java.lang.Object>
bindInboundStreams()
Bind to the ports for inbound streams.scala.concurrent.Future<Done>
completeHandshake(UniqueAddress peer)
protected Materializer
controlMaterializer()
protected void
controlMaterializer_$eq(Materializer x$1)
static int
ControlStreamId()
Flow<EnvelopeBuffer,InboundEnvelope,Decoder.InboundCompressionAccess>
createDecoder(ArterySettings settings, InboundCompressions compressions)
Flow<InboundEnvelope,InboundEnvelope,NotUsed>
createDeserializer(EnvelopeBufferPool bufferPool)
Flow<OutboundEnvelope,EnvelopeBuffer,Encoder.OutboundCompressionAccess>
createEncoder(EnvelopeBufferPool pool, int streamId)
EventSink
createFlightRecorderEventSink(boolean synchr)
boolean
createFlightRecorderEventSink$default$1()
Address
defaultAddress()
The default transport address of the ActorSystemprotected EnvelopeBufferPool
envelopeBufferPool()
scala.Option<FlightRecorder>
flightRecorder()
static byte
HighestVersion()
OptionVal<Decoder.InboundCompressionAccess>
inboundCompressionAccess()
Only access compression tables via the CompressionAccessSink<InboundEnvelope,scala.Tuple2<InboundControlJunction.ControlMessageSubject,scala.concurrent.Future<Done>>>
inboundControlSink()
Flow<EnvelopeBuffer,InboundEnvelope,Decoder.InboundCompressionAccess>
inboundFlow(ArterySettings settings, InboundCompressions compressions)
protected scala.Function1<InboundEnvelope,java.lang.Object>
inboundLanePartitioner()
protected int
inboundLanes()
Flow<EnvelopeBuffer,InboundEnvelope,java.lang.Object>
inboundLargeFlow(ArterySettings settings)
Sink<InboundEnvelope,scala.concurrent.Future<Done>>
inboundSink(EnvelopeBufferPool bufferPool)
boolean
isShutdown()
protected SharedKillSwitch
killSwitch()
protected EnvelopeBufferPool
largeEnvelopeBufferPool()
boolean
largeMessageChannelEnabled()
static int
LargeStreamId()
UniqueAddress
localAddress()
Address
localAddressForRemote(Address remote)
Resolves the correct local address to be used for contacting the given remote addressLoggingAdapter
log()
A Logger that can be used to log issues that may occurscala.concurrent.Future<java.lang.Object>
managementCommand(java.lang.Object cmd)
Sends a management command to the underlying transport stack.protected Materializer
materializer()
protected void
materializer_$eq(Materializer x$1)
Sink<InboundEnvelope,scala.concurrent.Future<Done>>
messageDispatcherSink()
static int
OrdinaryStreamId()
Sink<OutboundEnvelope,scala.Tuple2<Encoder.OutboundCompressionAccess,scala.concurrent.Future<Done>>>
outbound(OutboundContext outboundContext)
Sink<OutboundEnvelope,scala.Tuple2<OutboundControlJunction.OutboundControlIngress,scala.concurrent.Future<Done>>>
outboundControl(OutboundContext outboundContext)
Flow<OutboundEnvelope,EnvelopeBuffer,Encoder.OutboundCompressionAccess>
outboundLane(OutboundContext outboundContext)
Sink<OutboundEnvelope,scala.concurrent.Future<Done>>
outboundLarge(OutboundContext outboundContext)
Flow<OutboundEnvelope,OutboundEnvelope,NotUsed>
outboundTestFlow(OutboundContext outboundContext)
Sink<EnvelopeBuffer,scala.concurrent.Future<Done>>
outboundTransportSink(OutboundContext outboundContext)
protected abstract Sink<EnvelopeBuffer,scala.concurrent.Future<Done>>
outboundTransportSink(OutboundContext outboundContext, int streamId, EnvelopeBufferPool bufferPool)
static java.lang.String
ProtocolName()
void
quarantine(Address remoteAddress, scala.Option<java.lang.Object> uid, java.lang.String reason)
Marks a remote system as out of sync and prevents reconnects until the quarantine timeout elapses.void
quarantine(Address remoteAddress, scala.Option<java.lang.Object> uid, java.lang.String reason, boolean harmless)
scala.collection.immutable.Set<Address>
remoteAddresses()
protected abstract void
runInboundStreams(int port, int bindPort)
Run the inbound streams that have been previously bound.void
send(java.lang.Object message, OptionVal<ActorRef> sender, RemoteActorRef recipient)
Sends the given message to the recipient supplying the sender() if anyvoid
sendControl(Address to, ControlMessage message)
An inbound operator can send control message, e.g.protected void
setInboundCompressionAccess(Decoder.InboundCompressionAccess a)
ArterySettings
settings()
scala.concurrent.Future<Done>
shutdown()
protected abstract scala.concurrent.Future<Done>
shutdownTransport()
void
start()
Start up the transport, i.e.protected abstract void
startTransport()
protected java.util.concurrent.atomic.AtomicReference<scala.collection.immutable.Map<java.lang.Object,ArteryTransport.InboundStreamMatValues<java.lang.Object>>>
streamMatValues()
static java.lang.String
streamName(int streamId)
Flow<InboundEnvelope,InboundEnvelope,NotUsed>
terminationHintReplier(boolean inControlStream)
EventSink
topLevelFlightRecorder()
Thread-safe flight recorder for top level events.void
triggerCompressionAdvertisements(boolean actorRef, boolean manifest)
INTERNAL API: for testing only.protected void
updateStreamMatValues(int streamId, ArteryTransport.InboundStreamMatValues<java.lang.Object> values)
-
Methods inherited from class akka.remote.RemoteTransport
provider, system
-
-
-
-
Constructor Detail
-
ArteryTransport
public ArteryTransport(ExtendedActorSystem _system, RemoteActorRefProvider _provider)
-
-
Method Detail
-
ProtocolName
public static java.lang.String ProtocolName()
-
HighestVersion
public static byte HighestVersion()
-
ControlStreamId
public static int ControlStreamId()
-
OrdinaryStreamId
public static int OrdinaryStreamId()
-
LargeStreamId
public static int LargeStreamId()
-
streamName
public static java.lang.String streamName(int streamId)
-
materializer
protected Materializer materializer()
-
materializer_$eq
protected void materializer_$eq(Materializer x$1)
-
controlMaterializer
protected Materializer controlMaterializer()
-
controlMaterializer_$eq
protected void controlMaterializer_$eq(Materializer x$1)
-
log
public LoggingAdapter log()
Description copied from class:RemoteTransport
A Logger that can be used to log issues that may occur- Specified by:
log
in classRemoteTransport
- Returns:
- (undocumented)
-
afrFileChannel
public scala.Option<java.nio.channels.FileChannel> afrFileChannel()
-
afrFile
public scala.Option<java.nio.file.Path> afrFile()
-
flightRecorder
public scala.Option<FlightRecorder> flightRecorder()
-
_inboundCompressions
protected InboundCompressions _inboundCompressions()
Compression tables must be created once, such that inbound lane restarts don't cause dropping of the tables. However are the InboundCompressions are owned by the Decoder operator, and any call into them must be looped through the Decoder!Use
inboundCompressionAccess
(provided by the materializedDecoder
) to call into the compression infrastructure.- Returns:
- (undocumented)
-
inboundCompressionAccess
public OptionVal<Decoder.InboundCompressionAccess> inboundCompressionAccess()
Only access compression tables via the CompressionAccess
-
setInboundCompressionAccess
protected void setInboundCompressionAccess(Decoder.InboundCompressionAccess a)
-
bindAddress
public UniqueAddress bindAddress()
-
localAddress
public UniqueAddress localAddress()
- Specified by:
localAddress
in interfaceInboundContext
-
defaultAddress
public Address defaultAddress()
Description copied from class:RemoteTransport
The default transport address of the ActorSystem- Specified by:
defaultAddress
in classRemoteTransport
- Returns:
- The listen address of the default transport
-
addresses
public scala.collection.immutable.Set<Address> addresses()
Description copied from class:RemoteTransport
Address to be used in RootActorPath of refs generated for this transport.- Specified by:
addresses
in classRemoteTransport
- Returns:
- (undocumented)
-
localAddressForRemote
public Address localAddressForRemote(Address remote)
Description copied from class:RemoteTransport
Resolves the correct local address to be used for contacting the given remote address- Specified by:
localAddressForRemote
in classRemoteTransport
- Parameters:
remote
- the remote address- Returns:
- the local address to be used for the given remote address
-
killSwitch
protected SharedKillSwitch killSwitch()
-
streamMatValues
protected java.util.concurrent.atomic.AtomicReference<scala.collection.immutable.Map<java.lang.Object,ArteryTransport.InboundStreamMatValues<java.lang.Object>>> streamMatValues()
-
inboundLanes
protected int inboundLanes()
-
largeMessageChannelEnabled
public boolean largeMessageChannelEnabled()
-
envelopeBufferPool
protected EnvelopeBufferPool envelopeBufferPool()
-
largeEnvelopeBufferPool
protected EnvelopeBufferPool largeEnvelopeBufferPool()
-
topLevelFlightRecorder
public EventSink topLevelFlightRecorder()
Thread-safe flight recorder for top level events.- Returns:
- (undocumented)
-
createFlightRecorderEventSink
public EventSink createFlightRecorderEventSink(boolean synchr)
-
createFlightRecorderEventSink$default$1
public boolean createFlightRecorderEventSink$default$1()
-
remoteAddresses
public scala.collection.immutable.Set<Address> remoteAddresses()
-
settings
public ArterySettings settings()
- Specified by:
settings
in interfaceInboundContext
-
start
public void start()
Description copied from class:RemoteTransport
Start up the transport, i.e. enable incoming connections.- Specified by:
start
in classRemoteTransport
-
startTransport
protected abstract void startTransport()
-
bindInboundStreams
protected abstract scala.Tuple2<java.lang.Object,java.lang.Object> bindInboundStreams()
Bind to the ports for inbound streams. If '0' is specified, this will also select an arbitrary free local port. For UDP, we only select the port and leave the actual binding to Aeron when running the inbound stream.After calling this method the 'localAddress' and 'bindAddress' fields can be set.
- Returns:
- (undocumented)
-
runInboundStreams
protected abstract void runInboundStreams(int port, int bindPort)
Run the inbound streams that have been previously bound.Before calling this method the 'localAddress' and 'bindAddress' should have been set.
- Parameters:
port
- (undocumented)bindPort
- (undocumented)
-
inboundLanePartitioner
protected scala.Function1<InboundEnvelope,java.lang.Object> inboundLanePartitioner()
-
attachControlMessageObserver
protected void attachControlMessageObserver(InboundControlJunction.ControlMessageSubject ctrl)
-
attachInboundStreamRestart
protected void attachInboundStreamRestart(java.lang.String streamName, scala.concurrent.Future<Done> streamCompleted, scala.Function0<scala.runtime.BoxedUnit> restart)
-
shutdown
public scala.concurrent.Future<Done> shutdown()
- Specified by:
shutdown
in classRemoteTransport
-
shutdownTransport
protected abstract scala.concurrent.Future<Done> shutdownTransport()
-
updateStreamMatValues
protected final void updateStreamMatValues(int streamId, ArteryTransport.InboundStreamMatValues<java.lang.Object> values)
-
isShutdown
public boolean isShutdown()
-
managementCommand
public scala.concurrent.Future<java.lang.Object> managementCommand(java.lang.Object cmd)
Description copied from class:RemoteTransport
Sends a management command to the underlying transport stack. The call returns with a Future that indicates if the command was handled successfully or dropped.- Overrides:
managementCommand
in classRemoteTransport
- Parameters:
cmd
- Command message to send to the transports.- Returns:
- A Future that indicates when the message was successfully handled or dropped.
-
sendControl
public void sendControl(Address to, ControlMessage message)
Description copied from interface:InboundContext
An inbound operator can send control message, e.g. a reply, to the origin address with this method. It will be sent over the control sub-channel.- Specified by:
sendControl
in interfaceInboundContext
- Parameters:
to
- (undocumented)message
- (undocumented)
-
send
public void send(java.lang.Object message, OptionVal<ActorRef> sender, RemoteActorRef recipient)
Description copied from class:RemoteTransport
Sends the given message to the recipient supplying the sender() if any- Specified by:
send
in classRemoteTransport
- Parameters:
message
- (undocumented)sender
- (undocumented)recipient
- (undocumented)
-
association
public Association association(Address remoteAddress)
Description copied from interface:InboundContext
Lookup the outbound association for a given address.- Specified by:
association
in interfaceInboundContext
- Parameters:
remoteAddress
- (undocumented)- Returns:
- (undocumented)
-
association
public OptionVal<Association> association(long uid)
Description copied from interface:InboundContext
Lookup the outbound association for a given UID. Will returnOptionVal.None
if the UID is unknown, i.e. handshake not completed.- Specified by:
association
in interfaceInboundContext
- Parameters:
uid
- (undocumented)- Returns:
- (undocumented)
-
completeHandshake
public scala.concurrent.Future<Done> completeHandshake(UniqueAddress peer)
- Specified by:
completeHandshake
in interfaceInboundContext
-
quarantine
public void quarantine(Address remoteAddress, scala.Option<java.lang.Object> uid, java.lang.String reason)
Description copied from class:RemoteTransport
Marks a remote system as out of sync and prevents reconnects until the quarantine timeout elapses.- Specified by:
quarantine
in classRemoteTransport
- Parameters:
remoteAddress
- Address of the remote system to be quarantineduid
- UID of the remote system, if the uid is not defined it will not be a strong quarantine but the current endpoint writer will be stopped (dropping system messages) and the address will be gatedreason
- (undocumented)
-
quarantine
public void quarantine(Address remoteAddress, scala.Option<java.lang.Object> uid, java.lang.String reason, boolean harmless)
-
outboundLarge
public Sink<OutboundEnvelope,scala.concurrent.Future<Done>> outboundLarge(OutboundContext outboundContext)
-
outbound
public Sink<OutboundEnvelope,scala.Tuple2<Encoder.OutboundCompressionAccess,scala.concurrent.Future<Done>>> outbound(OutboundContext outboundContext)
-
outboundTransportSink
public Sink<EnvelopeBuffer,scala.concurrent.Future<Done>> outboundTransportSink(OutboundContext outboundContext)
-
outboundTransportSink
protected abstract Sink<EnvelopeBuffer,scala.concurrent.Future<Done>> outboundTransportSink(OutboundContext outboundContext, int streamId, EnvelopeBufferPool bufferPool)
-
outboundLane
public Flow<OutboundEnvelope,EnvelopeBuffer,Encoder.OutboundCompressionAccess> outboundLane(OutboundContext outboundContext)
-
outboundControl
public Sink<OutboundEnvelope,scala.Tuple2<OutboundControlJunction.OutboundControlIngress,scala.concurrent.Future<Done>>> outboundControl(OutboundContext outboundContext)
-
createEncoder
public Flow<OutboundEnvelope,EnvelopeBuffer,Encoder.OutboundCompressionAccess> createEncoder(EnvelopeBufferPool pool, int streamId)
-
createDecoder
public Flow<EnvelopeBuffer,InboundEnvelope,Decoder.InboundCompressionAccess> createDecoder(ArterySettings settings, InboundCompressions compressions)
-
createDeserializer
public Flow<InboundEnvelope,InboundEnvelope,NotUsed> createDeserializer(EnvelopeBufferPool bufferPool)
-
messageDispatcherSink
public Sink<InboundEnvelope,scala.concurrent.Future<Done>> messageDispatcherSink()
-
terminationHintReplier
public Flow<InboundEnvelope,InboundEnvelope,NotUsed> terminationHintReplier(boolean inControlStream)
-
inboundSink
public Sink<InboundEnvelope,scala.concurrent.Future<Done>> inboundSink(EnvelopeBufferPool bufferPool)
-
inboundFlow
public Flow<EnvelopeBuffer,InboundEnvelope,Decoder.InboundCompressionAccess> inboundFlow(ArterySettings settings, InboundCompressions compressions)
-
inboundLargeFlow
public Flow<EnvelopeBuffer,InboundEnvelope,java.lang.Object> inboundLargeFlow(ArterySettings settings)
-
inboundControlSink
public Sink<InboundEnvelope,scala.Tuple2<InboundControlJunction.ControlMessageSubject,scala.concurrent.Future<Done>>> inboundControlSink()
-
outboundTestFlow
public Flow<OutboundEnvelope,OutboundEnvelope,NotUsed> outboundTestFlow(OutboundContext outboundContext)
-
triggerCompressionAdvertisements
public void triggerCompressionAdvertisements(boolean actorRef, boolean manifest)
INTERNAL API: for testing only.
-
-