@Beta
public interface TransactionMeta
| Modifier and Type | Method and Description |
|---|---|
CompletableFuture<TransactionMeta> |
abortTxn()
Mark the transaction is aborted.
|
CompletableFuture<Position> |
appendEntry(long sequenceId,
Position position,
int batchSize)
Add transaction entry into the transaction.
|
long |
committedAtEntryId()
Return the committed entry id at data ledger.
|
long |
committedAtLedgerId()
Return the committed ledger id at data ledger.
|
CompletableFuture<TransactionMeta> |
committingTxn()
Mark the transaction status is committing.
|
CompletableFuture<TransactionMeta> |
commitTxn(long committedAtLedgerId,
long committedAtEntryId)
Mark the transaction is committed.
|
org.apache.pulsar.client.api.transaction.TxnID |
id()
Returns the transaction id.
|
long |
lastSequenceId()
Return the last sequence id.
|
int |
numEntries()
Return the number of entries appended to the transaction.
|
int |
numMessageInTxn()
Return messages number in one transaction.
|
CompletableFuture<SortedMap<Long,Position>> |
readEntries(int num,
long startSequenceId)
Read the entries from start sequence id.
|
TxnStatus |
status()
Return the status of the transaction.
|
org.apache.pulsar.client.api.transaction.TxnID id()
TxnStatus status()
int numEntries()
int numMessageInTxn()
throws TransactionException.TransactionStatusException
TransactionBufferException.TransactionStatusExceptionTransactionException.TransactionStatusExceptionlong committedAtLedgerId()
long committedAtEntryId()
long lastSequenceId()
CompletableFuture<SortedMap<Long,Position>> readEntries(int num, long startSequenceId)
num - the entries number need to readstartSequenceId - the start position of the entriesCompletableFuture<Position> appendEntry(long sequenceId, Position position, int batchSize)
sequenceId - the message sequence idposition - the position of transaction logbatchSize - CompletableFuture<TransactionMeta> committingTxn()
CompletableFuture<TransactionMeta> commitTxn(long committedAtLedgerId, long committedAtEntryId)
committedAtLedgerId - committedAtEntryId - CompletableFuture<TransactionMeta> abortTxn()
Copyright © 2017–2022 Apache Software Foundation. All rights reserved.