Package io.debezium.pipeline.txmetadata
Class TransactionContext
java.lang.Object
io.debezium.pipeline.txmetadata.TransactionContext
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
- Author:
- Jiri Pechanec
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidbeginTransaction(TransactionInfo transactionInfo) voidbeginTransaction(String transactionId) voidlongevent(DataCollectionId source) longbooleanstatic TransactionContextnewTransactionContextFromOffsets(Map<String, ?> offsets) Instance method to allow for overriding by custom transaction contexts.voidputPerTableEventCount(Map<String, Long> perTableEventCount) private voidreset()voidsetTotalEventCount(long totalEventCount) voidsetTransactionId(String transactionId) toString()
-
Field Details
-
OFFSET_TRANSACTION_ID
- See Also:
-
OFFSET_TABLE_COUNT_PREFIX
- See Also:
-
OFFSET_TABLE_COUNT_PREFIX_LENGTH
private static final int OFFSET_TABLE_COUNT_PREFIX_LENGTH -
transactionId
-
perTableEventCount
-
viewPerTableEventCount
-
totalEventCount
private long totalEventCount
-
-
Constructor Details
-
TransactionContext
public TransactionContext()
-
-
Method Details
-
reset
private void reset() -
store
-
newTransactionContextFromOffsets
Instance method to allow for overriding by custom transaction contexts.- Parameters:
offsets- Offsets to load- Returns:
- TransactionContext instance with loaded offsets
-
load
-
isTransactionInProgress
public boolean isTransactionInProgress() -
getTransactionId
-
getTotalEventCount
public long getTotalEventCount() -
setTransactionId
-
putPerTableEventCount
-
setTotalEventCount
public void setTotalEventCount(long totalEventCount) -
beginTransaction
-
beginTransaction
-
endTransaction
public void endTransaction() -
event
-
getPerTableEventCount
-
toString
-