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
FieldsModifier and TypeFieldDescriptionprotected final PulsarClientImplprotected URIprotected final io.netty.util.Timerprotected final String -
Constructor Summary
ConstructorsConstructorDescriptionTransactionMetaStoreHandler(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 booleanprotected booleanprotected booleanvoidclose()protected booleancompareAndSetState(org.apache.pulsar.client.impl.HandlerState.State expect, org.apache.pulsar.client.impl.HandlerState.State update) booleanconnectionFailed(PulsarClientException exception) endTxnAsync(TxnID txnID, TxnAction action) protected org.apache.pulsar.client.impl.HandlerState.StategetAndUpdateState(UnaryOperator<org.apache.pulsar.client.impl.HandlerState.State> updater) org.apache.pulsar.client.impl.HandlerState.StategetExceptionByServerError(ServerError serverError, String msg) protected org.apache.pulsar.client.impl.HandlerState.StategetState()voidnewTransactionAsync(long timeout, TimeUnit unit) voidrun(io.netty.util.Timeout timeout) protected voidsetRedirectedClusterURI(String serviceUrl, String serviceUrlTls) protected voidsetState(org.apache.pulsar.client.impl.HandlerState.State s) voidstart()
-
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:
runin interfaceio.netty.util.TimerTask- Throws:
Exception
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein 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() -
compareAndSetState
protected boolean compareAndSetState(org.apache.pulsar.client.impl.HandlerState.State expect, org.apache.pulsar.client.impl.HandlerState.State update) -
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
-