Class TcpClientConnection

    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close()
      Drop the connection.
      static java.util.concurrent.CompletableFuture<TcpClientConnection> connect​(io.pravega.shared.protocol.netty.PravegaNodeUri location, ClientConfig clientConfig, io.pravega.shared.protocol.netty.ReplyProcessor callback, java.util.concurrent.ScheduledExecutorService executor, java.lang.Runnable onClose)
      Connects to the specified location.
      void send​(io.pravega.shared.protocol.netty.Append append)
      Sends the provided append request.
      void send​(io.pravega.shared.protocol.netty.WireCommand cmd)
      Sends the provided command.
      void sendAsync​(java.util.List<io.pravega.shared.protocol.netty.Append> appends, ClientConnection.CompletedCallback callback)
      Sends the provided append commands.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Method Detail

      • connect

        public static java.util.concurrent.CompletableFuture<TcpClientConnection> connect​(io.pravega.shared.protocol.netty.PravegaNodeUri location,
                                                                                          ClientConfig clientConfig,
                                                                                          io.pravega.shared.protocol.netty.ReplyProcessor callback,
                                                                                          java.util.concurrent.ScheduledExecutorService executor,
                                                                                          java.lang.Runnable onClose)
        Connects to the specified location.
        Parameters:
        location - Location to connect to.
        clientConfig - config for socket.
        callback - ReplyProcessor for replies from the server.
        executor - Thread pool to perform the connect in.
        onClose - A callback to be notified when this connection closes.
        Returns:
        A future for a new connection. If the connect attempt fails the future will be failed with a ConnectionFailedException
      • send

        public void send​(io.pravega.shared.protocol.netty.WireCommand cmd)
                  throws io.pravega.shared.protocol.netty.ConnectionFailedException
        Description copied from interface: ClientConnection
        Sends the provided command. This operation may block. (Though buffering is used to try to prevent it)
        Specified by:
        send in interface ClientConnection
        Parameters:
        cmd - The command to send.
        Throws:
        io.pravega.shared.protocol.netty.ConnectionFailedException - The connection has died, and can no longer be used.
      • send

        public void send​(io.pravega.shared.protocol.netty.Append append)
                  throws io.pravega.shared.protocol.netty.ConnectionFailedException
        Description copied from interface: ClientConnection
        Sends the provided append request. This operation may block. (Though buffering is used to try to prevent it)
        Specified by:
        send in interface ClientConnection
        Parameters:
        append - The append command to send.
        Throws:
        io.pravega.shared.protocol.netty.ConnectionFailedException - The connection has died, and can no longer be used.
      • close

        public void close()
        Description copied from interface: ClientConnection
        Drop the connection. No further operations may be performed.
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface ClientConnection
      • sendAsync

        public void sendAsync​(java.util.List<io.pravega.shared.protocol.netty.Append> appends,
                              ClientConnection.CompletedCallback callback)
        Description copied from interface: ClientConnection
        Sends the provided append commands.
        Specified by:
        sendAsync in interface ClientConnection
        Parameters:
        appends - A list of append command to send.
        callback - A callback to be invoked when the operation is complete
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object