Class PgOutputReplicationMessage
- java.lang.Object
-
- io.debezium.connector.postgresql.connection.pgoutput.PgOutputReplicationMessage
-
- All Implemented Interfaces:
ReplicationMessage
- Direct Known Subclasses:
PgOutputTruncateReplicationMessage
public class PgOutputReplicationMessage extends Object implements ReplicationMessage
- 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, ReplicationMessage.TransactionMessage
-
-
Field Summary
Fields Modifier and Type Field Description private InstantcommitTimestampprivate List<ReplicationMessage.Column>newColumnsprivate List<ReplicationMessage.Column>oldColumnsprivate ReplicationMessage.Operationopprivate Stringtableprivate longtransactionId
-
Constructor Summary
Constructors Constructor Description PgOutputReplicationMessage(ReplicationMessage.Operation op, String table, Instant commitTimestamp, long transactionId, List<ReplicationMessage.Column> oldColumns, List<ReplicationMessage.Column> newColumns)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description InstantgetCommitTime()List<ReplicationMessage.Column>getNewTupleList()List<ReplicationMessage.Column>getOldTupleList()ReplicationMessage.OperationgetOperation()StringgetTable()longgetTransactionId()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.booleanhasTypeMetadata()booleanisLastEventForLsn()booleanshouldSchemaBeSynchronized()-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.debezium.connector.postgresql.connection.ReplicationMessage
isTransactionalMessage
-
-
-
-
Field Detail
-
op
private ReplicationMessage.Operation op
-
commitTimestamp
private Instant commitTimestamp
-
transactionId
private long transactionId
-
table
private String table
-
oldColumns
private List<ReplicationMessage.Column> oldColumns
-
newColumns
private List<ReplicationMessage.Column> newColumns
-
-
Constructor Detail
-
PgOutputReplicationMessage
public PgOutputReplicationMessage(ReplicationMessage.Operation op, String table, Instant commitTimestamp, long transactionId, List<ReplicationMessage.Column> oldColumns, List<ReplicationMessage.Column> newColumns)
-
-
Method Detail
-
getOperation
public ReplicationMessage.Operation getOperation()
- Specified by:
getOperationin interfaceReplicationMessage- Returns:
- A data operation executed
-
getCommitTime
public Instant getCommitTime()
- Specified by:
getCommitTimein interfaceReplicationMessage- Returns:
- Transaction commit time for this change
-
getTransactionId
public long getTransactionId()
- Specified by:
getTransactionIdin interfaceReplicationMessage- Returns:
- An id of transaction to which this change belongs
-
getTable
public String getTable()
- Specified by:
getTablein interfaceReplicationMessage- Returns:
- Table changed
-
getOldTupleList
public List<ReplicationMessage.Column> getOldTupleList()
- Specified by:
getOldTupleListin interfaceReplicationMessage- Returns:
- Set of original values of table columns, null for INSERT
-
getNewTupleList
public List<ReplicationMessage.Column> getNewTupleList()
- Specified by:
getNewTupleListin interfaceReplicationMessage- Returns:
- Set of new values of table columns, null for DELETE
-
hasTypeMetadata
public boolean hasTypeMetadata()
- Specified by:
hasTypeMetadatain interfaceReplicationMessage- Returns:
- true if type metadata are passed as a part of message
-
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
-
-