Class MLTransactionMetadataStore

    • Method Detail

      • getTxnStatus

        public java.util.concurrent.CompletableFuture<TxnStatus> getTxnStatus​(org.apache.pulsar.client.api.transaction.TxnID txnID)
        Description copied from interface: TransactionMetadataStore
        Query the TxnStatus of a given transaction txnid.
        Specified by:
        getTxnStatus in interface TransactionMetadataStore
        Parameters:
        txnID - transaction id
        Returns:
        a future represents the result of this operation. it returns TxnStatus of the given transaction.
      • getTxnMeta

        public java.util.concurrent.CompletableFuture<TxnMeta> getTxnMeta​(org.apache.pulsar.client.api.transaction.TxnID txnID)
        Description copied from interface: TransactionMetadataStore
        Query the TxnMeta of a given transaction txnid.
        Specified by:
        getTxnMeta in interface TransactionMetadataStore
        Parameters:
        txnID - transaction id
        Returns:
        a future represents the result of this operation. it returns TxnMeta of the given transaction.
      • newTransaction

        public java.util.concurrent.CompletableFuture<org.apache.pulsar.client.api.transaction.TxnID> newTransaction​(long timeOut,
                                                                                                                     java.lang.String owner)
        Description copied from interface: TransactionMetadataStore
        Create a new transaction in the transaction metadata store.
        Specified by:
        newTransaction in interface TransactionMetadataStore
        Parameters:
        timeOut - the timeout duration of the transaction in mills
        owner - the role which is the owner of the transaction
        Returns:
        a future represents the result of creating a new transaction. it returns TxnID as the identifier for identifying the transaction.
      • addProducedPartitionToTxn

        public java.util.concurrent.CompletableFuture<java.lang.Void> addProducedPartitionToTxn​(org.apache.pulsar.client.api.transaction.TxnID txnID,
                                                                                                java.util.List<java.lang.String> partitions)
        Description copied from interface: TransactionMetadataStore
        Add the produced partitions to transaction identified by txnid.
        Specified by:
        addProducedPartitionToTxn in interface TransactionMetadataStore
        Parameters:
        txnID - transaction id
        partitions - the list of partitions that a transaction produces to
        Returns:
        a future represents the result of this operation
      • addAckedPartitionToTxn

        public java.util.concurrent.CompletableFuture<java.lang.Void> addAckedPartitionToTxn​(org.apache.pulsar.client.api.transaction.TxnID txnID,
                                                                                             java.util.List<TransactionSubscription> txnSubscriptions)
        Description copied from interface: TransactionMetadataStore
        Add the acked partitions to transaction identified by txnid.
        Specified by:
        addAckedPartitionToTxn in interface TransactionMetadataStore
        Parameters:
        txnID - transaction id
        txnSubscriptions - the list of partitions that a transaction acknowledge to
        Returns:
        a future represents the result of the operation
      • updateTxnStatus

        public java.util.concurrent.CompletableFuture<java.lang.Void> updateTxnStatus​(org.apache.pulsar.client.api.transaction.TxnID txnID,
                                                                                      TxnStatus newStatus,
                                                                                      TxnStatus expectedStatus,
                                                                                      boolean isTimeout)
        Description copied from interface: TransactionMetadataStore
        Update the transaction from expectedStatus to newStatus.

        If the current transaction status is not expectedStatus, the update will be failed.

        Specified by:
        updateTxnStatus in interface TransactionMetadataStore
        Parameters:
        txnID - TxnID for update txn status
        newStatus - the new txn status that the transaction should be updated to
        expectedStatus - the expected status that the transaction should be
        isTimeout - the update txn status operation is it timeout
        Returns:
        a future represents the result of the operation
      • getLowWaterMark

        public long getLowWaterMark()
        Description copied from interface: TransactionMetadataStore
        Get the low water mark of this tc, in order to delete unless transaction in transaction buffer and pending ack.
        Specified by:
        getLowWaterMark in interface TransactionMetadataStore
        Returns:
        long long the lowWaterMark
      • getCoordinatorStats

        public org.apache.pulsar.common.policies.data.TransactionCoordinatorStats getCoordinatorStats()
        Description copied from interface: TransactionMetadataStore
        Get the transaction metadata store stats.
        Specified by:
        getCoordinatorStats in interface TransactionMetadataStore
        Returns:
        TransactionCoordinatorStats TransactionCoordinatorStats
      • closeAsync

        public java.util.concurrent.CompletableFuture<java.lang.Void> closeAsync()
        Description copied from interface: TransactionMetadataStore
        Close the transaction metadata store.
        Specified by:
        closeAsync in interface TransactionMetadataStore
        Returns:
        a future represents the result of this operation
      • txnSubscriptionToSubscription

        public static java.util.List<org.apache.pulsar.common.api.proto.Subscription> txnSubscriptionToSubscription​(java.util.List<TransactionSubscription> tnxSubscriptions)
      • subscriptionToTxnSubscription

        public static java.util.List<TransactionSubscription> subscriptionToTxnSubscription​(java.util.List<org.apache.pulsar.common.api.proto.Subscription> subscriptions)
      • getManagedLedger

        public org.apache.bookkeeper.mledger.ManagedLedger getManagedLedger()