Class AbstractMessageDecoder
java.lang.Object
io.debezium.connector.postgresql.connection.AbstractMessageDecoder
- All Implemented Interfaces:
MessageDecoder
- Direct Known Subclasses:
PgOutputMessageDecoder,PgProtoMessageDecoder
Abstract implementation of
MessageDecoder that all decoders should inherit from.- Author:
- Chris Cranford
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final Durationprivate static final org.slf4j.Loggerprivate Threads.Timer -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Closes this decoder, freeing and/or closing all resources it may potentially hold.voidprocessMessage(ByteBuffer buffer, ReplicationStream.ReplicationMessageProcessor processor, TypeRegistry typeRegistry) Process a message upon arrival from logical decoderprotected abstract voidprocessNotEmptyMessage(ByteBuffer buffer, ReplicationStream.ReplicationMessageProcessor processor, TypeRegistry typeRegistry) booleanshouldMessageBeSkipped(ByteBuffer buffer, Lsn lastReceivedLsn, Lsn startLsn, WalPositionLocator walPosition) A callback into the decoder allowing it to decide whether the supplied message should be processed by the decoder or whether it can be skipped.private booleanMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.debezium.connector.postgresql.connection.MessageDecoder
defaultOptions
-
Field Details
-
LOGGER
private static final org.slf4j.Logger LOGGER -
LOG_INTERVAL_DURATION
-
timer
-
-
Constructor Details
-
AbstractMessageDecoder
public AbstractMessageDecoder()
-
-
Method Details
-
processMessage
public void processMessage(ByteBuffer buffer, ReplicationStream.ReplicationMessageProcessor processor, TypeRegistry typeRegistry) throws SQLException, InterruptedException Description copied from interface:MessageDecoderProcess a message upon arrival from logical decoder- Specified by:
processMessagein interfaceMessageDecoder- Parameters:
buffer- - binary representation of replication messageprocessor- - message processing on arrivaltypeRegistry- - registry with known types- Throws:
SQLExceptionInterruptedException
-
processNotEmptyMessage
protected abstract void processNotEmptyMessage(ByteBuffer buffer, ReplicationStream.ReplicationMessageProcessor processor, TypeRegistry typeRegistry) throws SQLException, InterruptedException - Throws:
SQLExceptionInterruptedException
-
shouldMessageBeSkipped
public boolean shouldMessageBeSkipped(ByteBuffer buffer, Lsn lastReceivedLsn, Lsn startLsn, WalPositionLocator walPosition) Description copied from interface:MessageDecoderA callback into the decoder allowing it to decide whether the supplied message should be processed by the decoder or whether it can be skipped.- Specified by:
shouldMessageBeSkippedin interfaceMessageDecoder- Parameters:
buffer- the replication stream bufferlastReceivedLsn- the last LSN reported by the replication streamstartLsn- the starting LSN reported by the streaming producerwalPosition- wal position from which the streaming should resume- Returns:
trueif the incoming message should be skipped,falseotherwise
-
close
public void close()Description copied from interface:MessageDecoderCloses this decoder, freeing and/or closing all resources it may potentially hold.- Specified by:
closein interfaceMessageDecoder
-
timerPermitsLogging
private boolean timerPermitsLogging()
-