Package org.apache.pulsar.client.impl
Class ConnectionHandler
java.lang.Object
org.apache.pulsar.client.impl.ConnectionHandler
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final Backoffprotected org.apache.pulsar.client.impl.ConnectionHandler.Connectionprotected longprotected final intprotected final org.apache.pulsar.client.impl.HandlerState -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedConnectionHandler(org.apache.pulsar.client.impl.HandlerState state, Backoff backoff, org.apache.pulsar.client.impl.ConnectionHandler.Connection connection) -
Method Summary
Modifier and TypeMethodDescriptioncnx()voidlonggetEpoch()protected voidgrabCnx()booleanprotected voidprotected voidsetClientCnx(ClientCnx clientCnx) protected longswitchClientCnx(ClientCnx clientCnx) Update theClientCnxfor the class, then increment and get the epoch value.
-
Field Details
-
state
protected final org.apache.pulsar.client.impl.HandlerState state -
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() -
connectionClosed
-
resetBackoff
protected void resetBackoff() -
cnx
-
setClientCnx
-
switchClientCnx
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
-
isValidStateForReconnection
public boolean isValidStateForReconnection() -
getEpoch
public long getEpoch()
-