Interface TransactionMeta


@Beta public interface TransactionMeta
The metadata for the transaction in the transaction buffer.
  • Method Details

    • id

      org.apache.pulsar.client.api.transaction.TxnID id()
      Returns the transaction id.
      Returns:
      the transaction id
    • status

      org.apache.pulsar.transaction.coordinator.proto.TxnStatus status()
      Return the status of the transaction.
      Returns:
      the status of the transaction
    • numEntries

      int numEntries()
      Return the number of entries appended to the transaction.
      Returns:
      the number of entries
    • numMessageInTxn

      Return messages number in one transaction.
      Returns:
      the number of transaction messages
      Throws:
      TransactionException.TransactionStatusException
    • committedAtLedgerId

      long committedAtLedgerId()
      Return the committed ledger id at data ledger.
      Returns:
      the committed ledger id
    • committedAtEntryId

      long committedAtEntryId()
      Return the committed entry id at data ledger.
      Returns:
      the committed entry id
    • lastSequenceId

      long lastSequenceId()
      Return the last sequence id.
      Returns:
      the last sequence id
    • readEntries

      CompletableFuture<SortedMap<Long,org.apache.bookkeeper.mledger.Position>> readEntries(int num, long startSequenceId)
      Read the entries from start sequence id.
      Parameters:
      num - the entries number need to read
      startSequenceId - the start position of the entries
      Returns:
    • appendEntry

      CompletableFuture<org.apache.bookkeeper.mledger.Position> appendEntry(long sequenceId, org.apache.bookkeeper.mledger.Position position, int batchSize)
      Add transaction entry into the transaction.
      Parameters:
      sequenceId - the message sequence id
      position - the position of transaction log
      batchSize -
      Returns:
    • committingTxn

      Mark the transaction status is committing.
      Returns:
    • commitTxn

      CompletableFuture<TransactionMeta> commitTxn(long committedAtLedgerId, long committedAtEntryId)
      Mark the transaction is committed.
      Parameters:
      committedAtLedgerId -
      committedAtEntryId -
      Returns:
    • abortTxn

      Mark the transaction is aborted.
      Returns: