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 Details

    • timer

      protected final io.netty.util.Timer timer
    • client

      protected final PulsarClientImpl client
    • topic

      protected final String topic
    • redirectedClusterURI

      protected volatile URI redirectedClusterURI
  • Constructor Details

  • Method Details

    • start

      public void start()
    • connectionFailed

      public boolean connectionFailed(PulsarClientException exception)
    • connectionOpened

      public CompletableFuture<Void> connectionOpened(ClientCnx cnx)
    • newTransactionAsync

      public CompletableFuture<TxnID> newTransactionAsync(long timeout, TimeUnit unit)
    • addPublishPartitionToTxnAsync

      public CompletableFuture<Void> addPublishPartitionToTxnAsync(TxnID txnID, List<String> partitions)
    • addSubscriptionToTxn

      public CompletableFuture<Void> addSubscriptionToTxn(TxnID txnID, List<Subscription> subscriptionList)
    • handleAddSubscriptionToTxnResponse

      public void handleAddSubscriptionToTxnResponse(CommandAddSubscriptionToTxnResponse response)
    • endTxnAsync

      public CompletableFuture<Void> endTxnAsync(TxnID txnID, TxnAction action)
    • getExceptionByServerError

      public static TransactionCoordinatorClientException getExceptionByServerError(ServerError serverError, String msg)
    • run

      public void run(io.netty.util.Timeout timeout) throws Exception
      Specified by:
      run in interface io.netty.util.TimerTask
      Throws:
      Exception
    • close

      public void close() throws IOException
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Throws:
      IOException
    • getConnectHandleState

      public org.apache.pulsar.client.impl.HandlerState.State getConnectHandleState()
    • getHandlerName

      public String 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

      public PulsarClientImpl getClient()