Class 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 materialized Decoder) to call into the compression infrastructure.

    • 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_$eq

        protected void materializer_$eq​(Materializer x$1)
      • controlMaterializer

        protected Materializer controlMaterializer()
      • controlMaterializer_$eq

        protected void controlMaterializer_$eq​(Materializer x$1)
      • 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 materialized Decoder) to call into the compression infrastructure.

        Returns:
        (undocumented)
      • defaultAddress

        public Address defaultAddress()
        Description copied from class: RemoteTransport
        The default transport address of the ActorSystem
        Specified by:
        defaultAddress in class RemoteTransport
        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 class RemoteTransport
        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 class RemoteTransport
        Parameters:
        remote - the remote address
        Returns:
        the local address to be used for the given remote address
      • 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()
      • 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()
      • start

        public void start()
        Description copied from class: RemoteTransport
        Start up the transport, i.e. enable incoming connections.
        Specified by:
        start in class RemoteTransport
      • 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()
      • attachInboundStreamRestart

        protected void attachInboundStreamRestart​(java.lang.String streamName,
                                                  scala.concurrent.Future<Done> streamCompleted,
                                                  scala.Function0<scala.runtime.BoxedUnit> restart)
      • shutdownTransport

        protected abstract scala.concurrent.Future<Done> shutdownTransport()
      • 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 class RemoteTransport
        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 interface InboundContext
        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 class RemoteTransport
        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 interface InboundContext
        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 return OptionVal.None if the UID is unknown, i.e. handshake not completed.
        Specified by:
        association in interface InboundContext
        Parameters:
        uid - (undocumented)
        Returns:
        (undocumented)
      • 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 class RemoteTransport
        Parameters:
        remoteAddress - Address of the remote system to be quarantined
        uid - 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 gated
        reason - (undocumented)
      • quarantine

        public void quarantine​(Address remoteAddress,
                               scala.Option<java.lang.Object> uid,
                               java.lang.String reason,
                               boolean harmless)
      • triggerCompressionAdvertisements

        public void triggerCompressionAdvertisements​(boolean actorRef,
                                                     boolean manifest)
        INTERNAL API: for testing only.