Class PgOutputReplicationMessage
java.lang.Object
io.debezium.connector.postgresql.connection.pgoutput.PgOutputReplicationMessage
- All Implemented Interfaces:
ReplicationMessage
- Direct Known Subclasses:
PgOutputTruncateReplicationMessage
- Author:
- Gunnar Morling, Chris Cranford
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.debezium.connector.postgresql.connection.ReplicationMessage
ReplicationMessage.Column, ReplicationMessage.ColumnTypeMetadata, ReplicationMessage.ColumnValue<T>, ReplicationMessage.NoopMessage, ReplicationMessage.Operation -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Instantprivate List<ReplicationMessage.Column>private List<ReplicationMessage.Column>private ReplicationMessage.Operationprivate Stringprivate Long -
Constructor Summary
ConstructorsConstructorDescriptionPgOutputReplicationMessage(ReplicationMessage.Operation op, String table, Instant commitTimestamp, Long transactionId, List<ReplicationMessage.Column> oldColumns, List<ReplicationMessage.Column> newColumns) -
Method Summary
Modifier and TypeMethodDescriptiongetTable()static ObjectgetValue(String columnName, PostgresType type, String fullType, String rawValue, PostgresStreamingChangeEventSource.PgConnectionSupplier connection, boolean includeUnknownDataTypes, TypeRegistry typeRegistry) Converts the value (string representation) coming from PgOutput plugin to a Java value based on the type of the column from the message.booleanbooleanMethods 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.ReplicationMessage
isTransactionalMessage
-
Field Details
-
op
-
commitTimestamp
-
transactionId
-
table
-
oldColumns
-
newColumns
-
-
Constructor Details
-
PgOutputReplicationMessage
public PgOutputReplicationMessage(ReplicationMessage.Operation op, String table, Instant commitTimestamp, Long transactionId, List<ReplicationMessage.Column> oldColumns, List<ReplicationMessage.Column> newColumns)
-
-
Method Details
-
getOperation
- Specified by:
getOperationin interfaceReplicationMessage- Returns:
- A data operation executed
-
getCommitTime
- Specified by:
getCommitTimein interfaceReplicationMessage- Returns:
- Transaction commit time for this change
-
getTransactionId
- Specified by:
getTransactionIdin interfaceReplicationMessage- Returns:
- An id of transaction to which this change belongs; will not be present for non-transactional logical decoding messages for instance
-
getTable
- Specified by:
getTablein interfaceReplicationMessage- Returns:
- Table changed
-
getOldTupleList
- Specified by:
getOldTupleListin interfaceReplicationMessage- Returns:
- Set of original values of table columns, null for INSERT
-
getNewTupleList
- Specified by:
getNewTupleListin interfaceReplicationMessage- Returns:
- Set of new values of table columns, null for DELETE
-
isLastEventForLsn
public boolean isLastEventForLsn()- Specified by:
isLastEventForLsnin interfaceReplicationMessage- Returns:
- true if this is the last message in the batch of messages with same LSN
-
shouldSchemaBeSynchronized
public boolean shouldSchemaBeSynchronized()- Specified by:
shouldSchemaBeSynchronizedin interfaceReplicationMessage- Returns:
- true if the stream producer should synchronize the schema when processing messages, false otherwise
-
getValue
public static Object getValue(String columnName, PostgresType type, String fullType, String rawValue, PostgresStreamingChangeEventSource.PgConnectionSupplier connection, boolean includeUnknownDataTypes, TypeRegistry typeRegistry) Converts the value (string representation) coming from PgOutput plugin to a Java value based on the type of the column from the message. This value will be converted later on if necessary by the connector's value converter to match whatever the Connect schema type expects. Note that the logic here is tightly coupled on the pgoutput plugin logic which writes the actual value.- Returns:
- the value; may be null
-