Package org.apache.pulsar.client.impl
Class ConnectionHandler
- java.lang.Object
-
- org.apache.pulsar.client.impl.ConnectionHandler
-
public class ConnectionHandler extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description protected Backoffbackoffprotected org.apache.pulsar.client.impl.ConnectionHandler.Connectionconnectionprotected longlastConnectionClosedTimestampprotected org.apache.pulsar.client.impl.HandlerStatestate
-
Constructor Summary
Constructors Modifier Constructor Description protectedConnectionHandler(org.apache.pulsar.client.impl.HandlerState state, Backoff backoff, org.apache.pulsar.client.impl.ConnectionHandler.Connection connection)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ClientCnxcnx()voidconnectionClosed(ClientCnx cnx)longgetEpoch()protected voidgrabCnx()protected voidreconnectLater(java.lang.Throwable exception)protected voidresetBackoff()protected voidsetClientCnx(ClientCnx clientCnx)protected longswitchClientCnx(ClientCnx clientCnx)Update theClientCnxfor the class, then increment and get the epoch value.
-
-
-
Field Detail
-
state
protected final org.apache.pulsar.client.impl.HandlerState state
-
backoff
protected final Backoff backoff
-
lastConnectionClosedTimestamp
protected volatile long lastConnectionClosedTimestamp
-
connection
protected org.apache.pulsar.client.impl.ConnectionHandler.Connection connection
-
-
Constructor Detail
-
ConnectionHandler
protected ConnectionHandler(org.apache.pulsar.client.impl.HandlerState state, Backoff backoff, org.apache.pulsar.client.impl.ConnectionHandler.Connection connection)
-
-
Method Detail
-
grabCnx
protected void grabCnx()
-
reconnectLater
protected void reconnectLater(java.lang.Throwable exception)
-
connectionClosed
public void connectionClosed(ClientCnx cnx)
-
resetBackoff
protected void resetBackoff()
-
cnx
public ClientCnx cnx()
-
setClientCnx
protected void setClientCnx(ClientCnx clientCnx)
-
switchClientCnx
protected long switchClientCnx(ClientCnx clientCnx)
Update theClientCnxfor the class, then increment and get the epoch value. Note that the epoch value is currently only used by theProducerImpl.- Parameters:
clientCnx- - the newClientCnx- Returns:
- the epoch value to use for this pair of
ClientCnxandProducerImpl
-
getEpoch
public long getEpoch()
-
-