Interface Transport

    • Method Detail

      • id

        String id()
        This method returns id of the current transport
        Returns:
      • getUpstreamId

        String getUpstreamId()
        This methos returns Id of the upstream node
        Returns:
      • getRandomDownstreamFrom

        String getRandomDownstreamFrom​(String id,
                                       String exclude)
        This method returns random
        Parameters:
        id -
        exclude -
        Returns:
      • outgoingConsumer

        io.reactivex.functions.Consumer<VoidMessage> outgoingConsumer()
        This method returns consumer that accepts messages for delivery
        Returns:
      • incomingPublisher

        org.reactivestreams.Publisher<INDArrayMessage> incomingPublisher()
        This method returns flow of messages for parameter server
        Returns:
      • launch

        void launch()
        This method starts this Transport instance
      • launchAsMaster

        void launchAsMaster()
        This method will start this Transport instance
      • shutdown

        void shutdown()
        This method shuts down this Transport instance
      • sendMessage

        void sendMessage​(VoidMessage message,
                         String id)
        This method will send message to the node specified by Id
        Parameters:
        message -
        id -
      • processMessage

        void processMessage​(VoidMessage message)
        This method will be invoked for all incoming messages PLEASE NOTE: this method is mostly suited for tests
        Parameters:
        message -
      • setRestartCallback

        void setRestartCallback​(RestartCallback callback)
        This method allows to set callback instance, which will be called upon restart event
        Parameters:
        callback -
      • addRequestConsumer

        <T extends RequestMessage> void addRequestConsumer​(Class<T> cls,
                                                           io.reactivex.functions.Consumer<T> consumer)
        This methd allows to set callback instance for various
        Type Parameters:
        T1 - RequestMessage class
        T2 - ResponseMessage class
        Parameters:
        cls -
        callback -
      • onMeshUpdate

        void onMeshUpdate​(MeshOrganizer mesh)
        This method will be called if mesh update was received PLEASE NOTE: This method will be called ONLY if new mesh differs from current one
        Parameters:
        mesh -
      • onRemap

        void onRemap​(String id)
        This method will be called upon remap request
        Parameters:
        id -
      • totalNumberOfNodes

        int totalNumberOfNodes()
        This method returns total number of nodes known to this Transport
        Returns:
      • getRootId

        String getRootId()
        This method returns ID of the root node
        Returns:
      • isConnected

        boolean isConnected()
        This method checks if all connections required for work are established
        Returns:
        true
      • isIntroduced

        boolean isIntroduced()
        This method checks if this node was properly introduced to driver
        Returns:
      • ensureConnection

        void ensureConnection​(String id)
        This method checks connection to the given node ID, and if it's not connected - establishes connection
        Parameters:
        id -