Package org.apache.pulsar.client.impl
Class TransactionMetaStoreHandler
java.lang.Object
org.apache.pulsar.client.impl.TransactionMetaStoreHandler
- All Implemented Interfaces:
io.netty.util.TimerTask
,Closeable
,AutoCloseable
public class TransactionMetaStoreHandler
extends Object
implements Closeable, io.netty.util.TimerTask
Handler for transaction meta store.
-
Field Summary
Modifier and TypeFieldDescriptionprotected final PulsarClientImpl
protected URI
protected final io.netty.util.Timer
protected final String
-
Constructor Summary
ConstructorDescriptionTransactionMetaStoreHandler
(long transactionCoordinatorId, PulsarClientImpl pulsarClient, String topic, CompletableFuture<Void> connectFuture) -
Method Summary
Modifier and TypeMethodDescriptionaddPublishPartitionToTxnAsync
(TxnID txnID, List<String> partitions) addSubscriptionToTxn
(TxnID txnID, List<Subscription> subscriptionList) protected boolean
protected boolean
protected boolean
void
close()
void
connectionFailed
(PulsarClientException exception) endTxnAsync
(TxnID txnID, TxnAction action) protected org.apache.pulsar.client.impl.HandlerState.State
getAndUpdateState
(UnaryOperator<org.apache.pulsar.client.impl.HandlerState.State> updater) org.apache.pulsar.client.impl.HandlerState.State
getExceptionByServerError
(ServerError serverError, String msg) protected org.apache.pulsar.client.impl.HandlerState.State
getState()
void
newTransactionAsync
(long timeout, TimeUnit unit) void
run
(io.netty.util.Timeout timeout) protected void
setRedirectedClusterURI
(String serviceUrl, String serviceUrlTls) protected void
setState
(org.apache.pulsar.client.impl.HandlerState.State s) void
start()
-
Field Details
-
timer
protected final io.netty.util.Timer timer -
client
-
topic
-
redirectedClusterURI
-
-
Constructor Details
-
TransactionMetaStoreHandler
public TransactionMetaStoreHandler(long transactionCoordinatorId, PulsarClientImpl pulsarClient, String topic, CompletableFuture<Void> connectFuture)
-
-
Method Details
-
start
public void start() -
connectionFailed
-
connectionOpened
-
newTransactionAsync
-
addPublishPartitionToTxnAsync
-
addSubscriptionToTxn
public CompletableFuture<Void> addSubscriptionToTxn(TxnID txnID, List<Subscription> subscriptionList) -
handleAddSubscriptionToTxnResponse
-
endTxnAsync
-
getExceptionByServerError
public static TransactionCoordinatorClientException getExceptionByServerError(ServerError serverError, String msg) -
run
- Specified by:
run
in interfaceio.netty.util.TimerTask
- Throws:
Exception
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Throws:
IOException
-
getConnectHandleState
public org.apache.pulsar.client.impl.HandlerState.State getConnectHandleState() -
getHandlerName
-
setRedirectedClusterURI
protected void setRedirectedClusterURI(String serviceUrl, String serviceUrlTls) throws URISyntaxException - Throws:
URISyntaxException
-
changeToReadyState
protected boolean changeToReadyState() -
changeToRegisteringSchemaState
protected boolean changeToRegisteringSchemaState() -
getState
protected org.apache.pulsar.client.impl.HandlerState.State getState() -
changeToConnecting
protected boolean changeToConnecting() -
setState
protected void setState(org.apache.pulsar.client.impl.HandlerState.State s) -
getAndUpdateState
protected org.apache.pulsar.client.impl.HandlerState.State getAndUpdateState(UnaryOperator<org.apache.pulsar.client.impl.HandlerState.State> updater) -
getClient
-