Package org.apache.pulsar.client.admin
Interface Transactions
public interface Transactions
-
Method Summary
Modifier and TypeMethodDescriptionvoid
abortTransaction
(org.apache.pulsar.client.api.transaction.TxnID txnID) Abort a transaction.abortTransactionAsync
(org.apache.pulsar.client.api.transaction.TxnID txnID) Asynchronously abort a transaction.getCoordinatorInternalStats
(int coordinatorId, boolean metadata) Get transaction coordinator internal stats.getCoordinatorInternalStatsAsync
(int coordinatorId, boolean metadata) Get transaction coordinator internal stats.Get transaction metadataStore stats.Get transaction metadataStore stats.getCoordinatorStatsById
(int coordinatorId) Get transaction metadataStore stats.getCoordinatorStatsByIdAsync
(int coordinatorId) Get transaction metadataStore stats.getPendingAckInternalStats
(String topic, String subName, boolean metadata) Get pending ack internal stats.getPendingAckInternalStatsAsync
(String topic, String subName, boolean metadata) Get pending ack internal stats.default TransactionPendingAckStats
getPendingAckStats
(String topic, String subName) Get transaction pending ack stats.getPendingAckStats
(String topic, String subName, boolean lowWaterMarks) Get transaction pending ack stats.getPendingAckStatsAsync
(String topic, String subName) Get transaction pending ack stats.getPendingAckStatsAsync
(String topic, String subName, boolean lowWaterMarks) Get transaction pending ack stats.getPositionStatsInPendingAck
(String topic, String subName, Long ledgerId, Long entryId, Integer batchIndex) Get the position stats in transaction pending ack.getPositionStatsInPendingAckAsync
(String topic, String subName, Long ledgerId, Long entryId, Integer batchIndex) Get the position stats in transaction pending ack.getSlowTransactions
(long timeout, TimeUnit timeUnit) Get slow transactions.getSlowTransactionsAsync
(long timeout, TimeUnit timeUnit) Get slow transactions.getSlowTransactionsByCoordinatorId
(Integer coordinatorId, long timeout, TimeUnit timeUnit) Get slow transactions by coordinator id.getSlowTransactionsByCoordinatorIdAsync
(Integer coordinatorId, long timeout, TimeUnit timeUnit) Get slow transactions by coordinator id.getTransactionBufferInternalStats
(String topic, boolean metadata) Get transaction buffer internal stats.getTransactionBufferInternalStatsAsync
(String topic, boolean metadata) Get transaction buffer internal stats asynchronously.default TransactionBufferStats
getTransactionBufferStats
(String topic) Get transaction buffer stats.default TransactionBufferStats
getTransactionBufferStats
(String topic, boolean lowWaterMarks) Get transaction buffer stats.getTransactionBufferStats
(String topic, boolean lowWaterMarks, boolean segmentStats) Get transaction buffer stats.default CompletableFuture<TransactionBufferStats>
Get transaction buffer stats.default CompletableFuture<TransactionBufferStats>
getTransactionBufferStatsAsync
(String topic, boolean lowWaterMarks) Get transaction buffer stats.getTransactionBufferStatsAsync
(String topic, boolean lowWaterMarks, boolean segmentStats) Get transaction buffer stats.getTransactionInBufferStats
(org.apache.pulsar.client.api.transaction.TxnID txnID, String topic) Get transaction in buffer stats.getTransactionInBufferStatsAsync
(org.apache.pulsar.client.api.transaction.TxnID txnID, String topic) Get transaction in buffer stats.getTransactionInPendingAckStats
(org.apache.pulsar.client.api.transaction.TxnID txnID, String topic, String subName) Get transaction in pending ack stats.getTransactionInPendingAckStatsAsync
(org.apache.pulsar.client.api.transaction.TxnID txnID, String topic, String subName) Get transaction in pending ack stats.getTransactionMetadata
(org.apache.pulsar.client.api.transaction.TxnID txnID) Get transaction metadata.getTransactionMetadataAsync
(org.apache.pulsar.client.api.transaction.TxnID txnID) Get transaction metadata.List transaction coordinators.List transaction coordinators.void
scaleTransactionCoordinators
(int replicas) Sets the scale of the transaction coordinators.scaleTransactionCoordinatorsAsync
(int replicas) Asynchronously sets the size of the transaction coordinators.
-
Method Details
-
listTransactionCoordinators
List transaction coordinators.- Returns:
- the transaction coordinators list.
- Throws:
PulsarAdminException
-
listTransactionCoordinatorsAsync
CompletableFuture<List<TransactionCoordinatorInfo>> listTransactionCoordinatorsAsync()List transaction coordinators.- Returns:
- the future of the transaction coordinators list.
-
getCoordinatorStatsByIdAsync
Get transaction metadataStore stats.- Parameters:
coordinatorId
- the id which get transaction coordinator- Returns:
- the future of transaction metadata store stats.
-
getCoordinatorStatsById
Get transaction metadataStore stats.- Parameters:
coordinatorId
- the id which get transaction coordinator- Returns:
- the transaction metadata store stats.
- Throws:
PulsarAdminException
-
getCoordinatorStatsAsync
CompletableFuture<Map<Integer,TransactionCoordinatorStats>> getCoordinatorStatsAsync()Get transaction metadataStore stats.- Returns:
- the map future of transaction metadata store stats.
-
getCoordinatorStats
Get transaction metadataStore stats.- Returns:
- the map of transaction metadata store stats.
- Throws:
PulsarAdminException
-
getTransactionInBufferStatsAsync
CompletableFuture<TransactionInBufferStats> getTransactionInBufferStatsAsync(org.apache.pulsar.client.api.transaction.TxnID txnID, String topic) Get transaction in buffer stats.- Parameters:
txnID
- the txnIdtopic
- the produce topic- Returns:
- the future stats of transaction in buffer.
-
getTransactionInBufferStats
TransactionInBufferStats getTransactionInBufferStats(org.apache.pulsar.client.api.transaction.TxnID txnID, String topic) throws PulsarAdminException Get transaction in buffer stats.- Parameters:
txnID
- the txnIdtopic
- the produce topic- Returns:
- the stats of transaction in buffer.
- Throws:
PulsarAdminException
-
getTransactionInPendingAckStatsAsync
CompletableFuture<TransactionInPendingAckStats> getTransactionInPendingAckStatsAsync(org.apache.pulsar.client.api.transaction.TxnID txnID, String topic, String subName) Get transaction in pending ack stats.- Parameters:
txnID
- the txnIdtopic
- the ack topicsubName
- the subscription name of this transaction ack- Returns:
- the future stats of transaction in pending ack.
-
getTransactionInPendingAckStats
TransactionInPendingAckStats getTransactionInPendingAckStats(org.apache.pulsar.client.api.transaction.TxnID txnID, String topic, String subName) throws PulsarAdminException Get transaction in pending ack stats.- Parameters:
txnID
- the txnIdtopic
- the ack topicsubName
- the subscription name of this transaction ack- Returns:
- the stats of transaction in pending ack.
- Throws:
PulsarAdminException
-
getTransactionMetadataAsync
CompletableFuture<TransactionMetadata> getTransactionMetadataAsync(org.apache.pulsar.client.api.transaction.TxnID txnID) Get transaction metadata.- Parameters:
txnID
- the ID of this transaction- Returns:
- the future metadata of this transaction.
-
getTransactionMetadata
TransactionMetadata getTransactionMetadata(org.apache.pulsar.client.api.transaction.TxnID txnID) throws PulsarAdminException Get transaction metadata.- Parameters:
txnID
- the ID of this transaction- Returns:
- the metadata of this transaction.
- Throws:
PulsarAdminException
-
getTransactionBufferStatsAsync
CompletableFuture<TransactionBufferStats> getTransactionBufferStatsAsync(String topic, boolean lowWaterMarks, boolean segmentStats) Get transaction buffer stats.- Parameters:
topic
- the topic of getting transaction buffer statslowWaterMarks
- Whether to get information about lowWaterMarks stored in transaction pending ack.segmentStats
- Whether to get segment statistics.- Returns:
- the future stats of transaction buffer in topic.
-
getTransactionBufferStatsAsync
default CompletableFuture<TransactionBufferStats> getTransactionBufferStatsAsync(String topic, boolean lowWaterMarks) Get transaction buffer stats.- Parameters:
topic
- the topic of getting transaction buffer statslowWaterMarks
- Whether to get information about lowWaterMarks stored in transaction pending ack.- Returns:
- the future stats of transaction buffer in topic.
-
getTransactionBufferStatsAsync
Get transaction buffer stats.- Parameters:
topic
- the topic of getting transaction buffer stats- Returns:
- the future stats of transaction buffer in topic.
-
getTransactionBufferStats
TransactionBufferStats getTransactionBufferStats(String topic, boolean lowWaterMarks, boolean segmentStats) throws PulsarAdminException Get transaction buffer stats.- Parameters:
topic
- the topic of getting transaction buffer statslowWaterMarks
- Whether to get information about lowWaterMarks stored in transaction buffer.segmentStats
- Whether to get segment statistics.- Returns:
- the stats of transaction buffer in topic.
- Throws:
PulsarAdminException
-
getTransactionBufferStats
default TransactionBufferStats getTransactionBufferStats(String topic, boolean lowWaterMarks) throws PulsarAdminException Get transaction buffer stats.- Parameters:
topic
- the topic of getting transaction buffer statslowWaterMarks
- Whether to get information about lowWaterMarks stored in transaction buffer.- Returns:
- the stats of transaction buffer in topic.
- Throws:
PulsarAdminException
-
getTransactionBufferStats
Get transaction buffer stats.- Parameters:
topic
- the topic of getting transaction buffer stats- Returns:
- the stats of transaction buffer in topic.
- Throws:
PulsarAdminException
-
getPendingAckStatsAsync
CompletableFuture<TransactionPendingAckStats> getPendingAckStatsAsync(String topic, String subName, boolean lowWaterMarks) Get transaction pending ack stats.- Parameters:
topic
- the topic of this transaction pending ack statssubName
- the subscription name of this transaction pending ack statslowWaterMarks
- Whether to get information about lowWaterMarks stored in transaction pending ack.- Returns:
- the stats of transaction pending ack.
-
getPendingAckStatsAsync
default CompletableFuture<TransactionPendingAckStats> getPendingAckStatsAsync(String topic, String subName) Get transaction pending ack stats.- Parameters:
topic
- the topic of this transaction pending ack statssubName
- the subscription name of this transaction pending ack stats- Returns:
- the stats of transaction pending ack.
-
getPendingAckStats
TransactionPendingAckStats getPendingAckStats(String topic, String subName, boolean lowWaterMarks) throws PulsarAdminException Get transaction pending ack stats.- Parameters:
topic
- the topic of this transaction pending ack statssubName
- the subscription name of this transaction pending ack statslowWaterMarks
- Whether to get information about lowWaterMarks stored in transaction pending ack.- Returns:
- the stats of transaction pending ack.
- Throws:
PulsarAdminException
-
getPendingAckStats
default TransactionPendingAckStats getPendingAckStats(String topic, String subName) throws PulsarAdminException Get transaction pending ack stats.- Parameters:
topic
- the topic of this transaction pending ack statssubName
- the subscription name of this transaction pending ack stats- Returns:
- the stats of transaction pending ack.
- Throws:
PulsarAdminException
-
getSlowTransactionsByCoordinatorIdAsync
CompletableFuture<Map<String,TransactionMetadata>> getSlowTransactionsByCoordinatorIdAsync(Integer coordinatorId, long timeout, TimeUnit timeUnit) Get slow transactions by coordinator id.- Parameters:
coordinatorId
- the coordinator id of getting slow transaction status.timeout
- the timeouttimeUnit
- the timeout timeUnit- Returns:
- the future metadata of slow transactions.
-
getSlowTransactionsByCoordinatorId
Map<String,TransactionMetadata> getSlowTransactionsByCoordinatorId(Integer coordinatorId, long timeout, TimeUnit timeUnit) throws PulsarAdminException Get slow transactions by coordinator id.- Parameters:
coordinatorId
- the coordinator id of getting slow transaction status.timeout
- the timeouttimeUnit
- the timeout timeUnit- Returns:
- the metadata of slow transactions.
- Throws:
PulsarAdminException
-
getSlowTransactionsAsync
CompletableFuture<Map<String,TransactionMetadata>> getSlowTransactionsAsync(long timeout, TimeUnit timeUnit) Get slow transactions.- Parameters:
timeout
- the timeouttimeUnit
- the timeout timeUnit- Returns:
- the future metadata of slow transactions.
-
getSlowTransactions
Map<String,TransactionMetadata> getSlowTransactions(long timeout, TimeUnit timeUnit) throws PulsarAdminException Get slow transactions.- Parameters:
timeout
- the timeouttimeUnit
- the timeout timeUnit- Returns:
- the metadata of slow transactions.
- Throws:
PulsarAdminException
-
getCoordinatorInternalStatsAsync
CompletableFuture<TransactionCoordinatorInternalStats> getCoordinatorInternalStatsAsync(int coordinatorId, boolean metadata) Get transaction coordinator internal stats.- Parameters:
coordinatorId
- the coordinator IDmetadata
- is get ledger metadata- Returns:
- the future internal stats of this coordinator
-
getCoordinatorInternalStats
TransactionCoordinatorInternalStats getCoordinatorInternalStats(int coordinatorId, boolean metadata) throws PulsarAdminException Get transaction coordinator internal stats.- Parameters:
coordinatorId
- the coordinator IDmetadata
- whether to obtain ledger metadata- Returns:
- the internal stats of this coordinator
- Throws:
PulsarAdminException
-
getPendingAckInternalStatsAsync
CompletableFuture<TransactionPendingAckInternalStats> getPendingAckInternalStatsAsync(String topic, String subName, boolean metadata) Get pending ack internal stats.- Parameters:
topic
- the topic of get pending ack internal statssubName
- the subscription name of this pending ackmetadata
- whether to obtain ledger metadata- Returns:
- the future internal stats of pending ack
-
getPendingAckInternalStats
TransactionPendingAckInternalStats getPendingAckInternalStats(String topic, String subName, boolean metadata) throws PulsarAdminException Get pending ack internal stats.- Parameters:
topic
- the topic of get pending ack internal statssubName
- the subscription name of this pending ackmetadata
- whether to obtain ledger metadata- Returns:
- the internal stats of pending ack
- Throws:
PulsarAdminException
-
getTransactionBufferInternalStatsAsync
CompletableFuture<TransactionBufferInternalStats> getTransactionBufferInternalStatsAsync(String topic, boolean metadata) Get transaction buffer internal stats asynchronously.- Parameters:
topic
- the topic to get transaction buffer internal stats frommetadata
- whether to obtain ledger metadata- Returns:
- the future internal stats of transaction buffer
-
getTransactionBufferInternalStats
TransactionBufferInternalStats getTransactionBufferInternalStats(String topic, boolean metadata) throws PulsarAdminException Get transaction buffer internal stats.- Parameters:
topic
- the topic to get transaction buffer internal stats frommetadata
- whether to obtain ledger metadata- Returns:
- the internal stats of transaction buffer
- Throws:
PulsarAdminException
-
scaleTransactionCoordinators
Sets the scale of the transaction coordinators. And currently, we can only support scale-up.- Parameters:
replicas
- the new transaction coordinators size.- Throws:
PulsarAdminException
-
scaleTransactionCoordinatorsAsync
Asynchronously sets the size of the transaction coordinators. And currently, we can only support scale-up.- Parameters:
replicas
- the new transaction coordinators size.- Returns:
- a future that can be used to track when the transaction coordinator number is updated.
-
getPositionStatsInPendingAck
PositionInPendingAckStats getPositionStatsInPendingAck(String topic, String subName, Long ledgerId, Long entryId, Integer batchIndex) throws PulsarAdminException Get the position stats in transaction pending ack.- Parameters:
topic
- the topic of checking position in pending ack statesubName
- the subscription name of this pending ackledgerId
- the ledger id of the message position.entryId
- the entry id of the message position.batchIndex
- the batch index of the message position, `null` means not batch message.- Returns:
PositionInPendingAckStats
a state identified whether the position state.- Throws:
PulsarAdminException
-
getPositionStatsInPendingAckAsync
CompletableFuture<PositionInPendingAckStats> getPositionStatsInPendingAckAsync(String topic, String subName, Long ledgerId, Long entryId, Integer batchIndex) Get the position stats in transaction pending ack.- Parameters:
topic
- the topic of checking position in pending ack statesubName
- the subscription name of this pending ackledgerId
- the ledger id of the message position.entryId
- the entry id of the message position.batchIndex
- the batch index of the message position, `null` means not batch message.- Returns:
PositionInPendingAckStats
a state identified whether the position state.
-
abortTransaction
void abortTransaction(org.apache.pulsar.client.api.transaction.TxnID txnID) throws PulsarAdminException Abort a transaction.- Parameters:
txnID
- the txnId- Throws:
PulsarAdminException
-
abortTransactionAsync
Asynchronously abort a transaction.- Parameters:
txnID
- the txnId
-