public class MLTransactionMetadataStore extends TransactionMetadataStoreState implements TransactionMetadataStore
TransactionMetadataStore.TransactionMetadataStoreState.State| Constructor and Description |
|---|
MLTransactionMetadataStore(TransactionCoordinatorID tcID,
MLTransactionLogImpl mlTransactionLog,
TransactionTimeoutTracker timeoutTracker,
TransactionRecoverTracker recoverTracker,
MLTransactionSequenceIdGenerator sequenceIdGenerator) |
changeToCloseState, changeToInitializingState, changeToReadyState, checkIfReady, getStatepublic MLTransactionMetadataStore(TransactionCoordinatorID tcID, MLTransactionLogImpl mlTransactionLog, TransactionTimeoutTracker timeoutTracker, TransactionRecoverTracker recoverTracker, MLTransactionSequenceIdGenerator sequenceIdGenerator)
public CompletableFuture<TxnStatus> getTxnStatus(org.apache.pulsar.client.api.transaction.TxnID txnID)
TransactionMetadataStoreTxnStatus of a given transaction txnid.getTxnStatus in interface TransactionMetadataStoretxnID - transaction idTxnStatus of the given transaction.public CompletableFuture<TxnMeta> getTxnMeta(org.apache.pulsar.client.api.transaction.TxnID txnID)
TransactionMetadataStoreTxnMeta of a given transaction txnid.getTxnMeta in interface TransactionMetadataStoretxnID - transaction idTxnMeta of the given transaction.public CompletableFuture<org.apache.pulsar.client.api.transaction.TxnID> newTransaction(long timeOut)
TransactionMetadataStorenewTransaction in interface TransactionMetadataStoretimeOut - the timeout duration of the transaction in millsTxnID as the identifier for identifying the
transaction.public CompletableFuture<Void> addProducedPartitionToTxn(org.apache.pulsar.client.api.transaction.TxnID txnID, List<String> partitions)
TransactionMetadataStoreaddProducedPartitionToTxn in interface TransactionMetadataStoretxnID - transaction idpartitions - the list of partitions that a transaction produces topublic CompletableFuture<Void> addAckedPartitionToTxn(org.apache.pulsar.client.api.transaction.TxnID txnID, List<TransactionSubscription> txnSubscriptions)
TransactionMetadataStoreaddAckedPartitionToTxn in interface TransactionMetadataStoretxnID - transaction idtxnSubscriptions - the list of partitions that a transaction acknowledge topublic CompletableFuture<Void> updateTxnStatus(org.apache.pulsar.client.api.transaction.TxnID txnID, TxnStatus newStatus, TxnStatus expectedStatus, boolean isTimeout)
TransactionMetadataStoreIf the current transaction status is not expectedStatus, the update will be failed.
updateTxnStatus in interface TransactionMetadataStoretxnID - TxnID for update txn statusnewStatus - the new txn status that the transaction should be updated toexpectedStatus - the expected status that the transaction should beisTimeout - the update txn status operation is it timeoutpublic long getLowWaterMark()
TransactionMetadataStoregetLowWaterMark in interface TransactionMetadataStorelong the lowWaterMarkpublic TransactionCoordinatorID getTransactionCoordinatorID()
TransactionMetadataStoregetTransactionCoordinatorID in interface TransactionMetadataStorepublic TransactionCoordinatorStats getCoordinatorStats()
TransactionMetadataStoregetCoordinatorStats in interface TransactionMetadataStoreTransactionCoordinatorStatspublic CompletableFuture<Void> closeAsync()
TransactionMetadataStorecloseAsync in interface TransactionMetadataStorepublic TransactionMetadataStoreStats getMetadataStoreStats()
TransactionMetadataStoregetMetadataStoreStats in interface TransactionMetadataStoreTransactionMetadataStoreStatspublic List<TxnMeta> getSlowTransactions(long timeout)
TransactionMetadataStoregetSlowTransactions in interface TransactionMetadataStoreTxnMeta the txnMetas of slow transactionspublic static List<Subscription> txnSubscriptionToSubscription(List<TransactionSubscription> tnxSubscriptions)
public static List<TransactionSubscription> subscriptionToTxnSubscription(List<Subscription> subscriptions)
public ManagedLedger getManagedLedger()
Copyright © 2017–2021 Apache Software Foundation. All rights reserved.