Class ConnectionHandler

java.lang.Object
org.apache.pulsar.client.impl.ConnectionHandler

public class ConnectionHandler extends Object
  • Field Details

    • state

      protected final org.apache.pulsar.client.impl.HandlerState state
    • backoff

      protected final Backoff backoff
    • lastConnectionClosedTimestamp

      protected volatile long lastConnectionClosedTimestamp
    • randomKeyForSelectConnection

      protected final int randomKeyForSelectConnection
    • connection

      protected org.apache.pulsar.client.impl.ConnectionHandler.Connection connection
  • Constructor Details

    • ConnectionHandler

      protected ConnectionHandler(org.apache.pulsar.client.impl.HandlerState state, Backoff backoff, org.apache.pulsar.client.impl.ConnectionHandler.Connection connection)
  • Method Details

    • grabCnx

      protected void grabCnx()
    • grabCnx

      protected void grabCnx(Optional<URI> hostURI)
    • connectionClosed

      public void connectionClosed(ClientCnx cnx)
    • connectionClosed

      public void connectionClosed(ClientCnx cnx, Optional<Long> initialConnectionDelayMs, Optional<URI> hostUrl)
    • resetBackoff

      protected void resetBackoff()
    • cnx

      public ClientCnx cnx()
    • setClientCnx

      protected void setClientCnx(ClientCnx clientCnx)
    • switchClientCnx

      protected long switchClientCnx(ClientCnx clientCnx)
      Update the ClientCnx for the class, then increment and get the epoch value. Note that the epoch value is currently only used by the ProducerImpl.
      Parameters:
      clientCnx - - the new ClientCnx
      Returns:
      the epoch value to use for this pair of ClientCnx and ProducerImpl
    • getEpoch

      public long getEpoch()