Class ConnectionPoolImpl

  • All Implemented Interfaces:
    ConnectionPool, java.lang.AutoCloseable

    public class ConnectionPoolImpl
    extends java.lang.Object
    implements ConnectionPool
    • Method Detail

      • getClientConnection

        public java.util.concurrent.CompletableFuture<ClientConnection> getClientConnection​(Flow flow,
                                                                                            io.pravega.shared.protocol.netty.PravegaNodeUri location,
                                                                                            io.pravega.shared.protocol.netty.ReplyProcessor rp)
        Description copied from interface: ConnectionPool
        This is used to create a ClientConnection on an existing Connection pool. The Connection pool implementation decides if a new connection needs to be established to the PravegaNode or an existing connection can be reused to establish the connection.
        Specified by:
        getClientConnection in interface ConnectionPool
        Parameters:
        flow - Flow
        location - The Pravega Node Uri.
        rp - ReplyProcessor instance.
        Returns:
        An instance of client connection.
      • getClientConnection

        public java.util.concurrent.CompletableFuture<ClientConnection> getClientConnection​(io.pravega.shared.protocol.netty.PravegaNodeUri location,
                                                                                            io.pravega.shared.protocol.netty.ReplyProcessor rp)
        Description copied from interface: ConnectionPool
        This is used to create a ClientConnection where flows are disabled. This implies that only one ClientConnection can exist on the underlying connection.
        Specified by:
        getClientConnection in interface ConnectionPool
        Parameters:
        location - The Pravega Node Uri.
        rp - ReplyProcessor instance.
        Returns:
        An instance of client connection.
      • pruneUnusedConnections

        public void pruneUnusedConnections()
        Used only for testing.
      • getActiveChannels

        public java.util.List<io.pravega.client.connection.impl.ConnectionPoolImpl.Connection> getActiveChannels()
      • close

        public void close()
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface ConnectionPool
      • getInternalExecutor

        public java.util.concurrent.ScheduledExecutorService getInternalExecutor()
        Description copied from interface: ConnectionPool
        Returns the client internal thread pool executor.
        Specified by:
        getInternalExecutor in interface ConnectionPool