Interface PerChannelBookieClientPool

All Known Implementing Classes:
DefaultPerChannelBookieClientPool

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

    • initialize

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

      Obtain a channel from channel pool to execute operations.
      Parameters:
      callback - callback to return channel from channel pool.
    • 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:
    • recordError

      void recordError()
      record any read/write error on PerChannelBookieClientPool.
    • 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.