Skip to content

Commit

Permalink
added logs
Browse files Browse the repository at this point in the history
  • Loading branch information
vaibhav-yb committed Sep 12, 2024
1 parent 00d70e3 commit c379bf4
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ public class PostgresStreamingChangeEventSource implements StreamingChangeEventS
* For DEBUGGING
*/
private OptionalLong lastTxnidForWhichCommitSeen = OptionalLong.empty();
private long recordCount = 0;

public PostgresStreamingChangeEventSource(PostgresConnectorConfig connectorConfig, Snapshotter snapshotter,
PostgresConnection connection, PostgresEventDispatcher<TableId> dispatcher, ErrorHandler errorHandler, Clock clock,
Expand Down Expand Up @@ -297,6 +298,8 @@ private void processReplicationMessages(PostgresPartition partition, PostgresOff
LOGGER.debug("Processing BEGIN with end LSN {} and txnid {}", lsn, message.getTransactionId());
} else {
LOGGER.debug("Processing COMMIT with end LSN {} and txnid {}", lsn, message.getTransactionId());
LOGGER.debug("Record count in the txn {} is {}", message.getTransactionId(), recordCount);
recordCount = 0;
}

OptionalLong currentTxnid = message.getTransactionId();
Expand Down Expand Up @@ -352,6 +355,7 @@ else if (message.getOperation() == Operation.MESSAGE) {
// DML event
else {
LOGGER.trace("Processing DML event with lsn {} and lastCompletelyProcessedLsn {}", lsn, lastCompletelyProcessedLsn);
++recordCount;

TableId tableId = null;
if (message.getOperation() != Operation.NOOP) {
Expand Down

0 comments on commit c379bf4

Please sign in to comment.