Class TransactionContext


  • @NotThreadSafe
    public class TransactionContext
    extends Object
    The context holds internal state necessary for book-keeping of events in active transaction. The main data tracked are
    • active transaction id
    • the total event number seen from the transaction
    • the number of events per table/collection seen in the transaction
    The state of this context is stored in offsets and is recovered upon restart.
    Author:
    Jiri Pechanec
    • Field Detail

      • OFFSET_TABLE_COUNT_PREFIX_LENGTH

        private static final int OFFSET_TABLE_COUNT_PREFIX_LENGTH
      • transactionId

        private String transactionId
      • perTableEventCount

        private final Map<String,​Long> perTableEventCount
      • viewPerTableEventCount

        private final Map<String,​Long> viewPerTableEventCount
      • totalEventCount

        private long totalEventCount
    • Constructor Detail

      • TransactionContext

        public TransactionContext()
    • Method Detail

      • reset

        private void reset()
      • isTransactionInProgress

        public boolean isTransactionInProgress()
      • getTransactionId

        public String getTransactionId()
      • getTotalEventCount

        public long getTotalEventCount()
      • beginTransaction

        public void beginTransaction​(String txId)
      • endTransaction

        public void endTransaction()
      • getPerTableEventCount

        public Map<String,​Long> getPerTableEventCount()