Interface TransactionMeta


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

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      java.util.concurrent.CompletableFuture<TransactionMeta> abortTxn()
      Mark the transaction is aborted.
      java.util.concurrent.CompletableFuture<org.apache.bookkeeper.mledger.Position> appendEntry​(long sequenceId, org.apache.bookkeeper.mledger.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.
      java.util.concurrent.CompletableFuture<TransactionMeta> committingTxn()
      Mark the transaction status is committing.
      java.util.concurrent.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.
      java.util.concurrent.CompletableFuture<java.util.SortedMap<java.lang.Long,​org.apache.bookkeeper.mledger.Position>> readEntries​(int num, long startSequenceId)
      Read the entries from start sequence id.
      org.apache.pulsar.transaction.coordinator.proto.TxnStatus status()
      Return the status of the transaction.
    • Method Detail

      • 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
      • 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

        java.util.concurrent.CompletableFuture<java.util.SortedMap<java.lang.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

        java.util.concurrent.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

        java.util.concurrent.CompletableFuture<TransactionMeta> committingTxn()
        Mark the transaction status is committing.
        Returns:
      • commitTxn

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

        java.util.concurrent.CompletableFuture<TransactionMeta> abortTxn()
        Mark the transaction is aborted.
        Returns: