Class TransactionEntryImpl

  • All Implemented Interfaces:
    java.lang.AutoCloseable, org.apache.bookkeeper.mledger.Entry, TransactionEntry

    public class TransactionEntryImpl
    extends java.lang.Object
    implements TransactionEntry
    A simple implementation of TransactionEntry.
    • Constructor Detail

      • TransactionEntryImpl

        public TransactionEntryImpl​(org.apache.pulsar.client.api.transaction.TxnID txnId,
                                    long sequenceId,
                                    org.apache.bookkeeper.mledger.Entry entry,
                                    long committedAtLedgerId,
                                    long committedAtEntryId,
                                    int numMessageInTxn)
    • Method Detail

      • txnId

        public org.apache.pulsar.client.api.transaction.TxnID txnId()
        Description copied from interface: TransactionEntry
        The transaction id that the entry is appended to.
        Specified by:
        txnId in interface TransactionEntry
        Returns:
        the transaction id
      • sequenceId

        public long sequenceId()
        Description copied from interface: TransactionEntry
        The sequence id of this entry in this transaction.
        Specified by:
        sequenceId in interface TransactionEntry
        Returns:
        the sequence id
      • committedAtLedgerId

        public long committedAtLedgerId()
        Description copied from interface: TransactionEntry
        The ledger id that the transaction is committed to.
        Specified by:
        committedAtLedgerId in interface TransactionEntry
        Returns:
        the ledger id that the transaction is committed to.
      • committedAtEntryId

        public long committedAtEntryId()
        Description copied from interface: TransactionEntry
        The entry id that the transaction is committed to.
        Specified by:
        committedAtEntryId in interface TransactionEntry
        Returns:
        the entry id that the transaction is committed to.
      • setStartBatchIndex

        public void setStartBatchIndex​(int startBatchIndex)
      • getStartBatchIndex

        public int getStartBatchIndex()
      • close

        public void close()
        Description copied from interface: TransactionEntry
        Close the entry to release the resource that it holds.
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface TransactionEntry
      • getData

        public byte[] getData()
        Specified by:
        getData in interface org.apache.bookkeeper.mledger.Entry
      • getDataAndRelease

        public byte[] getDataAndRelease()
        Specified by:
        getDataAndRelease in interface org.apache.bookkeeper.mledger.Entry
      • getLength

        public int getLength()
        Specified by:
        getLength in interface org.apache.bookkeeper.mledger.Entry
      • getDataBuffer

        public io.netty.buffer.ByteBuf getDataBuffer()
        Specified by:
        getDataBuffer in interface org.apache.bookkeeper.mledger.Entry
      • getPosition

        public org.apache.bookkeeper.mledger.Position getPosition()
        Specified by:
        getPosition in interface org.apache.bookkeeper.mledger.Entry
      • getLedgerId

        public long getLedgerId()
        Specified by:
        getLedgerId in interface org.apache.bookkeeper.mledger.Entry
      • getEntryId

        public long getEntryId()
        Specified by:
        getEntryId in interface org.apache.bookkeeper.mledger.Entry
      • release

        public boolean release()
        Specified by:
        release in interface org.apache.bookkeeper.mledger.Entry