Class WalPositionLocator
java.lang.Object
io.debezium.connector.postgresql.connection.WalPositionLocator
This class is responsible for finding out a LSN from which Debezium should
resume streaming after connector restarts. The LSNs are not guaranteed to be
ordered in the WAL. LSN of commits are ordered and LSNs inside a transaction
are ordered. It is thus necessary to find out the beginning of the
unprocessed transaction and the LSN from which the streaming should start.
- Author:
- Jiri Pechanec
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionWalPositionLocator(Lsn lastCommitStoredLsn, Lsn lastEventStoredLsn, ReplicationMessage.Operation lastProcessedMessageType) -
Method Summary
Modifier and TypeMethodDescriptionvoidEnables filtering of message LSNs based on calculated position.resumeFromLsn(Lsn currentLsn, ReplicationMessage message) booleanbooleanskipMessage(Lsn lsn) Decides whether the message with given LSN should be removed or not based on previously located LSN point.toString()
-
Field Details
-
LOGGER
private static final org.slf4j.Logger LOGGER -
lastCommitStoredLsn
-
lastEventStoredLsn
-
lastProcessedMessageType
-
txStartLsn
-
lsnAfterLastEventStoredLsn
-
firstLsnReceived
-
passMessages
private boolean passMessages -
startStreamingLsn
-
storeLsnAfterLastEventStoredLsn
private boolean storeLsnAfterLastEventStoredLsn -
lsnSeen
-
-
Constructor Details
-
WalPositionLocator
public WalPositionLocator(Lsn lastCommitStoredLsn, Lsn lastEventStoredLsn, ReplicationMessage.Operation lastProcessedMessageType) -
WalPositionLocator
public WalPositionLocator()
-
-
Method Details
-
resumeFromLsn
- Returns:
- the first LSN from which processing should be started or empty if the position has not been found yet
-
skipMessage
Decides whether the message with given LSN should be removed or not based on previously located LSN point.- Parameters:
lsn-- Returns:
- true if the message should be skipped, false otherwise
-
enableFiltering
public void enableFiltering()Enables filtering of message LSNs based on calculated position. -
searchingEnabled
public boolean searchingEnabled()- Returns:
- true if searching of WAL position should be executed
-
getLastEventStoredLsn
-
getLastCommitStoredLsn
-
toString
-