class Wal2JsonReplicationMessage extends Object implements ReplicationMessage
ReplicationMessage.Column, ReplicationMessage.ColumnTypeMetadata, ReplicationMessage.ColumnValue<T>, ReplicationMessage.NoopMessage, ReplicationMessage.Operation, ReplicationMessage.TransactionMessage| Modifier and Type | Field and Description |
|---|---|
private Instant |
commitTime |
private boolean |
hasMetadata |
private boolean |
lastEventForLsn |
private static org.slf4j.Logger |
LOGGER |
private Document |
rawMessage |
private long |
txId |
private TypeRegistry |
typeRegistry |
| Constructor and Description |
|---|
Wal2JsonReplicationMessage(long txId,
Instant commitTime,
Document rawMessage,
boolean hasMetadata,
boolean lastEventForLsn,
TypeRegistry typeRegistry) |
| Modifier and Type | Method and Description |
|---|---|
Instant |
getCommitTime() |
List<ReplicationMessage.Column> |
getNewTupleList() |
List<ReplicationMessage.Column> |
getOldTupleList() |
ReplicationMessage.Operation |
getOperation() |
String |
getTable() |
long |
getTransactionId() |
Object |
getValue(String columnName,
PostgresType type,
String fullType,
Value rawValue,
PostgresStreamingChangeEventSource.PgConnectionSupplier connection,
boolean includeUnknownDatatypes)
Converts the value (string representation) coming from wal2json plugin to
a Java value based on the type of the column from the message.
|
boolean |
hasTypeMetadata() |
boolean |
isLastEventForLsn() |
private String |
parseType(String columnName,
String typeWithModifiers) |
private List<ReplicationMessage.Column> |
transform(Document data,
String nameField,
String typeField,
String valueField,
String optionalsField) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitisTransactionalMessage, shouldSchemaBeSynchronizedprivate static final org.slf4j.Logger LOGGER
private final long txId
private final Instant commitTime
private final Document rawMessage
private final boolean hasMetadata
private final boolean lastEventForLsn
private final TypeRegistry typeRegistry
public Wal2JsonReplicationMessage(long txId,
Instant commitTime,
Document rawMessage,
boolean hasMetadata,
boolean lastEventForLsn,
TypeRegistry typeRegistry)
public ReplicationMessage.Operation getOperation()
getOperation in interface ReplicationMessagepublic Instant getCommitTime()
getCommitTime in interface ReplicationMessagepublic long getTransactionId()
getTransactionId in interface ReplicationMessagepublic String getTable()
getTable in interface ReplicationMessagepublic List<ReplicationMessage.Column> getOldTupleList()
getOldTupleList in interface ReplicationMessagepublic List<ReplicationMessage.Column> getNewTupleList()
getNewTupleList in interface ReplicationMessagepublic boolean hasTypeMetadata()
hasTypeMetadata in interface ReplicationMessageprivate List<ReplicationMessage.Column> transform(Document data, String nameField, String typeField, String valueField, String optionalsField)
public Object getValue(String columnName, PostgresType type, String fullType, Value rawValue, PostgresStreamingChangeEventSource.PgConnectionSupplier connection, boolean includeUnknownDatatypes)
PostgresValueConverter.converter(Column, Field) instance to match whatever the Connect schema type expects.
Note that the logic here is tightly coupled (i.e. dependent) on the wal2json plugin logic which writes the actual
JSON messages.a - supplier to get a connection to Postgres instance for array handlingpublic boolean isLastEventForLsn()
isLastEventForLsn in interface ReplicationMessageCopyright © 2021 JBoss by Red Hat. All rights reserved.