Package io.debezium.pipeline.txmetadata
Class TransactionContext
- java.lang.Object
-
- io.debezium.pipeline.txmetadata.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
- Author:
- Jiri Pechanec
-
-
Field Summary
Fields Modifier and Type Field Description private static String
OFFSET_TABLE_COUNT_PREFIX
private static int
OFFSET_TABLE_COUNT_PREFIX_LENGTH
private static String
OFFSET_TRANSACTION_ID
private Map<String,Long>
perTableEventCount
private long
totalEventCount
private String
transactionId
private Map<String,Long>
viewPerTableEventCount
-
Constructor Summary
Constructors Constructor Description TransactionContext()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
beginTransaction(String txId)
void
endTransaction()
long
event(DataCollectionId source)
Map<String,Long>
getPerTableEventCount()
long
getTotalEventCount()
String
getTransactionId()
boolean
isTransactionInProgress()
static TransactionContext
load(Map<String,?> offsets)
private void
reset()
Map<String,Object>
store(Map<String,Object> offset)
String
toString()
-
-
-
Field Detail
-
OFFSET_TRANSACTION_ID
private static final String OFFSET_TRANSACTION_ID
- See Also:
- Constant Field Values
-
OFFSET_TABLE_COUNT_PREFIX
private static final String OFFSET_TABLE_COUNT_PREFIX
- See Also:
- Constant Field Values
-
OFFSET_TABLE_COUNT_PREFIX_LENGTH
private static final int OFFSET_TABLE_COUNT_PREFIX_LENGTH
-
transactionId
private String transactionId
-
totalEventCount
private long totalEventCount
-
-
Method Detail
-
reset
private void reset()
-
load
public static TransactionContext load(Map<String,?> offsets)
-
isTransactionInProgress
public boolean isTransactionInProgress()
-
getTransactionId
public String getTransactionId()
-
getTotalEventCount
public long getTotalEventCount()
-
beginTransaction
public void beginTransaction(String txId)
-
endTransaction
public void endTransaction()
-
event
public long event(DataCollectionId source)
-
-