Interface PerChannelBookieClientPool

  • All Known Implementing Classes:
    DefaultPerChannelBookieClientPool

    public interface PerChannelBookieClientPool
    An interface to manage channel pooling for bookie client.
    • Method Detail

      • initialize

        void initialize()
        initialize the pool. the implementation should not be blocked.
      • obtain

        void obtain​(BookkeeperInternalCallbacks.GenericCallback<PerChannelBookieClient> callback,
                    long key,
                    boolean forceUseV3)
        Obtain a channel from channel pool by version to execute operations.
        Parameters:
        callback - callback to return channel from channel pool
        forceUseV3 - whether or not use v3 protocol for connection
      • isWritable

        default boolean isWritable​(long key)
        Returns status of a client. It is suggested to delay/throttle requests to this channel if isWritable is false.
        Parameters:
        key -
        Returns:
      • checkTimeoutOnPendingOperations

        void checkTimeoutOnPendingOperations()
        Check if any ops on any channel needs to be timed out. This is called on all channels, even if the channel is not yet connected.
      • disconnect

        void disconnect​(boolean wait)
        Disconnect the connections in the pool.
        Parameters:
        wait - whether need to wait until pool disconnected.
      • close

        void close​(boolean wait)
        Close the pool.
        Parameters:
        wait - whether need to wait until pool closed.
      • getNumPendingCompletionRequests

        long getNumPendingCompletionRequests()
        Get the number of pending completion requests in the channel.