Merge pull request #164 from rhauch/dbz-179
DBZ-179 Changed PostgreSQL connector codebase to fix JavaDoc errors
This commit is contained in:
commit
c27009b344
2
.gitignore
vendored
2
.gitignore
vendored
@ -21,4 +21,6 @@ npm-debug.log
|
||||
.DS_Store
|
||||
phantomjsdriver.log
|
||||
|
||||
generated-sources/
|
||||
|
||||
/state/
|
||||
|
@ -102,7 +102,7 @@
|
||||
</goals>
|
||||
<configuration>
|
||||
<protocVersion>${version.com.google.protobuf}</protocVersion> <!-- 2.4.1, 2.5.0, 2.6.1, 3.0.0 -->
|
||||
<outputDirectory>${project.build.sourceDirectory}</outputDirectory>
|
||||
<outputDirectory>${protobuf.output.directory}</outputDirectory>
|
||||
<inputDirectories>
|
||||
<include>src/main/proto</include>
|
||||
</inputDirectories>
|
||||
|
@ -13,6 +13,7 @@
|
||||
import java.util.function.Function;
|
||||
import java.util.function.Predicate;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import org.apache.kafka.connect.data.Schema;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
@ -29,7 +30,7 @@
|
||||
import io.debezium.util.AvroValidator;
|
||||
|
||||
/**
|
||||
* Component that records the schema information for the {@link PostgresConnector}. The schema information contains
|
||||
* Component that records the schema information for the {@link PostgresConnector}. The schema information contains
|
||||
* the {@link Tables table definitions} and the Kafka Connect {@link #schemaFor(TableId) Schema}s for each table, where the
|
||||
* {@link Schema} excludes any columns that have been {@link PostgresConnectorConfig#COLUMN_BLACKLIST specified} in the
|
||||
* configuration.
|
||||
@ -38,28 +39,28 @@
|
||||
*/
|
||||
@NotThreadSafe
|
||||
public class PostgresSchema {
|
||||
|
||||
|
||||
protected final static String PUBLIC_SCHEMA_NAME = "public";
|
||||
private final static Logger LOGGER = LoggerFactory.getLogger(PostgresSchema.class);
|
||||
|
||||
|
||||
private final Map<TableId, TableSchema> tableSchemaByTableId = new HashMap<>();
|
||||
private final Filters filters;
|
||||
private final TableSchemaBuilder schemaBuilder;
|
||||
private final String schemaPrefix;
|
||||
private final Tables tables;
|
||||
private final Function<String, String> schemaNameValidator;
|
||||
|
||||
|
||||
private Map<String, Integer> typeInfo;
|
||||
|
||||
|
||||
/**
|
||||
* Create a schema component given the supplied {@link PostgresConnectorConfig Postgres connector configuration}.
|
||||
* @param config the connector configuration, which is presumed to be valid
|
||||
*
|
||||
* @param config the connector configuration, which is presumed to be valid
|
||||
*/
|
||||
protected PostgresSchema(PostgresConnectorConfig config) {
|
||||
this.filters = new Filters(config);
|
||||
this.tables = new Tables();
|
||||
|
||||
|
||||
PostgresValueConverter valueConverter = new PostgresValueConverter(config.adaptiveTimePrecision(), ZoneOffset.UTC);
|
||||
this.schemaNameValidator = AvroValidator.create(LOGGER)::validate;
|
||||
this.schemaBuilder = new TableSchemaBuilder(valueConverter, this.schemaNameValidator);
|
||||
@ -73,20 +74,22 @@ protected PostgresSchema(PostgresConnectorConfig config) {
|
||||
this.schemaPrefix = serverName.endsWith(".") || serverName.isEmpty() ? serverName : serverName + ".";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Initializes the content for this schema by reading all the database information from the supplied connection.
|
||||
*
|
||||
* @param connection a {@link JdbcConnection} instance, never {@code null}
|
||||
* @param printReplicaIdentityInfo whether or not to look and print out replica identity information about the tables
|
||||
* @return this object so methods can be chained together; never null
|
||||
* @throws SQLException if there is a problem obtaining the schema from the database server
|
||||
*/
|
||||
protected PostgresSchema refresh(PostgresConnection connection, boolean printReplicaIdentityInfo) throws SQLException {
|
||||
if (typeInfo == null) {
|
||||
typeInfo = connection.readTypeInfo();
|
||||
}
|
||||
|
||||
|
||||
// read all the information from the DB
|
||||
connection.readSchema(tables, null, null, filters.tableNameFilter(), null, true);
|
||||
connection.readSchema(tables, null, null, filters.tableNameFilter(), null, true);
|
||||
if (printReplicaIdentityInfo) {
|
||||
// print out all the replica identity info
|
||||
tables.tableIds().forEach(tableId -> printReplicaIdentityInfo(connection, tableId));
|
||||
@ -95,7 +98,7 @@ protected PostgresSchema refresh(PostgresConnection connection, boolean printRep
|
||||
refreshSchemas();
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
private void printReplicaIdentityInfo(PostgresConnection connection, TableId tableId) {
|
||||
try {
|
||||
ServerInfo.ReplicaIdentity replicaIdentity = connection.readReplicaIdentityInfo(tableId);
|
||||
@ -104,18 +107,19 @@ private void printReplicaIdentityInfo(PostgresConnection connection, TableId tab
|
||||
LOGGER.warn("Cannot determine REPLICA IDENTITY info for '{}'", tableId);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Refreshes this schema's content for a particular table
|
||||
* Refreshes this schema's content for a particular table
|
||||
*
|
||||
* @param connection a {@link JdbcConnection} instance, never {@code null}
|
||||
* @param tableId the table identifier; may not be null
|
||||
* @throws SQLException if there is a problem refreshing the schema from the database server
|
||||
*/
|
||||
protected void refresh(PostgresConnection connection, TableId tableId) throws SQLException {
|
||||
Tables temp = new Tables();
|
||||
Tables.TableNameFilter tableNameFilter = Tables.filterFor(Predicate.isEqual(tableId));
|
||||
connection.readSchema(temp, null, null, tableNameFilter, null, true);
|
||||
|
||||
|
||||
// we expect the refreshed table to be there
|
||||
assert temp.size() == 1;
|
||||
// overwrite (add or update) or views of the tables
|
||||
@ -144,35 +148,35 @@ public Filters filters() {
|
||||
public Table tableFor(TableId id) {
|
||||
return filters.tableFilter().test(id) ? tables.forTable(id) : null;
|
||||
}
|
||||
|
||||
|
||||
protected Table tableFor(String fqn) {
|
||||
return tableFor(TableId.parse(fqn, false));
|
||||
}
|
||||
|
||||
|
||||
protected String validateSchemaName(String name) {
|
||||
return this.schemaNameValidator.apply(name);
|
||||
}
|
||||
|
||||
|
||||
protected TableSchema schemaFor(TableId id) {
|
||||
return tableSchemaByTableId.get(id);
|
||||
}
|
||||
|
||||
|
||||
protected boolean isFilteredOut(TableId id) {
|
||||
return !filters.tableFilter().test(id);
|
||||
return !filters.tableFilter().test(id);
|
||||
}
|
||||
|
||||
protected TableSchema schemaFor(String fqn) {
|
||||
return schemaFor(TableId.parse(fqn, false));
|
||||
}
|
||||
|
||||
|
||||
protected boolean isType(String localTypeName, int jdbcType) {
|
||||
return typeInfo != null && Integer.compare(jdbcType, columnTypeNameToPgOid(localTypeName)) == 0;
|
||||
return typeInfo != null && Integer.compare(jdbcType, columnTypeNameToPgOid(localTypeName)) == 0;
|
||||
}
|
||||
|
||||
|
||||
protected int columnTypeNameToPgOid(String localTypeName) {
|
||||
return typeInfo.get(localTypeName);
|
||||
}
|
||||
|
||||
|
||||
protected Stream<TableId> tables() {
|
||||
return tables.tableIds().stream();
|
||||
}
|
||||
@ -185,7 +189,7 @@ protected void refreshSchemas() {
|
||||
// Create TableSchema instances for any existing table ...
|
||||
this.tables.tableIds().forEach(this::refreshSchema);
|
||||
}
|
||||
|
||||
|
||||
private void refreshSchema(TableId id) {
|
||||
if (LOGGER.isDebugEnabled()) {
|
||||
LOGGER.debug("refreshing DB schema for table '{}'", id);
|
||||
@ -194,13 +198,12 @@ private void refreshSchema(TableId id) {
|
||||
TableSchema schema = schemaBuilder.create(schemaPrefix, table, filters.columnFilter(), null);
|
||||
tableSchemaByTableId.put(id, schema);
|
||||
}
|
||||
|
||||
|
||||
protected static TableId parse(String table) {
|
||||
TableId tableId = TableId.parse(table, false);
|
||||
if (tableId == null) {
|
||||
return null;
|
||||
}
|
||||
return tableId.schema() == null ? new TableId(tableId.catalog(), PUBLIC_SCHEMA_NAME, tableId.table()) :
|
||||
tableId;
|
||||
return tableId.schema() == null ? new TableId(tableId.catalog(), PUBLIC_SCHEMA_NAME, tableId.table()) : tableId;
|
||||
}
|
||||
}
|
||||
|
@ -17,6 +17,7 @@
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.concurrent.atomic.AtomicReference;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
import org.apache.kafka.connect.data.Field;
|
||||
import org.apache.kafka.connect.data.Schema;
|
||||
import org.apache.kafka.connect.data.Struct;
|
||||
@ -36,8 +37,8 @@
|
||||
import io.debezium.util.LoggingContext;
|
||||
|
||||
/**
|
||||
* A {@link RecordsProducer} which creates {@link org.apache.kafka.connect.source.SourceRecord records} from a Postgres
|
||||
* streaming replication connection and {@link io.debezium.connector.postgresql.proto.PgProto messages}.
|
||||
* A {@link RecordsProducer} which creates {@link org.apache.kafka.connect.source.SourceRecord records} from a Postgres
|
||||
* streaming replication connection and {@link io.debezium.connector.postgresql.proto.PgProto messages}.
|
||||
*
|
||||
* @author Horia Chiorean (hchiorea@redhat.com)
|
||||
*/
|
||||
@ -46,7 +47,7 @@ public class RecordsStreamProducer extends RecordsProducer {
|
||||
|
||||
private static final String CONTEXT_NAME = "records-stream-producer";
|
||||
|
||||
private final ExecutorService executorService;
|
||||
private final ExecutorService executorService;
|
||||
private final ReplicationConnection replicationConnection;
|
||||
private final AtomicReference<ReplicationStream> replicationStream;
|
||||
|
||||
@ -84,20 +85,20 @@ protected void start(Consumer<SourceRecord> recordConsumer) {
|
||||
replicationStream.compareAndSet(null, replicationConnection.startStreaming());
|
||||
}
|
||||
|
||||
// refresh the schema so we have a latest view of the DB tables
|
||||
// refresh the schema so we have a latest view of the DB tables
|
||||
taskContext.refreshSchema(true);
|
||||
// the new thread will inherit it's parent MDC
|
||||
executorService.submit(() -> streamChanges(recordConsumer));
|
||||
} catch (Throwable t) {
|
||||
throw new ConnectException(t.getCause() != null ? t.getCause() : t);
|
||||
} finally {
|
||||
previousContext.restore();
|
||||
previousContext.restore();
|
||||
}
|
||||
}
|
||||
|
||||
private void streamChanges(Consumer<SourceRecord> consumer) {
|
||||
ReplicationStream stream = this.replicationStream.get();
|
||||
// run while we haven't been requested to stop
|
||||
// run while we haven't been requested to stop
|
||||
while (!Thread.currentThread().isInterrupted()) {
|
||||
try {
|
||||
// this will block until a message is available
|
||||
@ -112,7 +113,7 @@ private void streamChanges(Consumer<SourceRecord> consumer) {
|
||||
logger.error("unexpected exception while streaming logical changes", e);
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -146,7 +147,7 @@ protected synchronized void stop() {
|
||||
if (replicationConnection != null) {
|
||||
logger.debug("stopping streaming...");
|
||||
//TODO author=Horia Chiorean date=08/11/2016 description=Ideally we'd close the stream, but it's not reliable atm (see javadoc)
|
||||
//replicationStream.close();
|
||||
//replicationStream.close();
|
||||
// close the connection - this should also disconnect the current stream even if it's blocking
|
||||
replicationConnection.close();
|
||||
}
|
||||
@ -331,7 +332,7 @@ record = new SourceRecord(partition, offset, topicName, null, keySchema, key, nu
|
||||
recordConsumer.accept(record);
|
||||
}
|
||||
|
||||
private Object[] columnValues(List<PgProto.DatumMessage> messageList, TableId tableId, boolean refreshSchemaIfChanged)
|
||||
private Object[] columnValues(List<PgProto.DatumMessage> messageList, TableId tableId, boolean refreshSchemaIfChanged)
|
||||
throws SQLException {
|
||||
if (messageList == null || messageList.isEmpty()) {
|
||||
return null;
|
||||
@ -339,7 +340,7 @@ private Object[] columnValues(List<PgProto.DatumMessage> messageList, TableId ta
|
||||
Table table = schema().tableFor(tableId);
|
||||
assert table != null;
|
||||
|
||||
// check if we need to refresh our local schema due to DB schema changes for this table
|
||||
// check if we need to refresh our local schema due to DB schema changes for this table
|
||||
if (refreshSchemaIfChanged && schemaChanged(messageList, table)) {
|
||||
schema().refresh(taskContext.createConnection(), tableId);
|
||||
table = schema().tableFor(tableId);
|
||||
@ -351,7 +352,7 @@ private Object[] columnValues(List<PgProto.DatumMessage> messageList, TableId ta
|
||||
messageList.forEach(message -> {
|
||||
int position = columnNames.indexOf(message.getColumnName());
|
||||
assert position >= 0;
|
||||
values[position] = extractValueFromMessage(message);
|
||||
values[position] = extractValueFromMessage(message);
|
||||
});
|
||||
return values;
|
||||
}
|
||||
@ -360,12 +361,12 @@ private boolean schemaChanged(List<PgProto.DatumMessage> messageList, Table tabl
|
||||
List<String> columnNames = table.columnNames();
|
||||
int messagesCount = messageList.size();
|
||||
if (columnNames.size() != messagesCount) {
|
||||
// the table metadata has less or more columns than the event, which means the table structure has changed,
|
||||
// the table metadata has less or more columns than the event, which means the table structure has changed,
|
||||
// so we need to trigger a refresh...
|
||||
return true;
|
||||
}
|
||||
|
||||
// go through the list of columns from the message to figure out if any of them are new or have changed their type based
|
||||
// go through the list of columns from the message to figure out if any of them are new or have changed their type based
|
||||
// on what we have in the table metadata....
|
||||
return messageList.stream().filter(message -> {
|
||||
String columnName = message.getColumnName();
|
||||
@ -376,7 +377,7 @@ private boolean schemaChanged(List<PgProto.DatumMessage> messageList, Table tabl
|
||||
} else if (!schema().isType(column.typeName(), column.jdbcType())) {
|
||||
logger.debug("detected new type for column '{}', old type was '{}', new type is '{}'; refreshing table schema", columnName, column.jdbcType(),
|
||||
message.getColumnType());
|
||||
return true;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}).findFirst().isPresent();
|
||||
@ -406,14 +407,15 @@ private TableSchema tableSchemaFor(TableId tableId) throws SQLException {
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts the Protobuf value for a {@link io.debezium.connector.postgresql.proto.PgProto.DatumMessage plugin message} to
|
||||
* Converts the Protobuf value for a {@link io.debezium.connector.postgresql.proto.PgProto.DatumMessage plugin message} 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
|
||||
* {@link 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 Postgres plugin logic which writes the actual
|
||||
* Note that the logic here is tightly coupled (i.e. dependent) on the Postgres plugin logic which writes the actual
|
||||
* Protobuf messages.
|
||||
*
|
||||
* @param datumMessage a {@link io.debezium.connector.postgresql.proto.PgProto.DatumMessage} instance; never {@code null}
|
||||
* @return the value; may be null
|
||||
*/
|
||||
protected Object extractValueFromMessage(PgProto.DatumMessage datumMessage) {
|
||||
int columnType = (int) datumMessage.getColumnType();
|
||||
@ -451,8 +453,8 @@ protected Object extractValueFromMessage(PgProto.DatumMessage datumMessage) {
|
||||
if (!datumMessage.hasDatumInt64()) {
|
||||
return null;
|
||||
}
|
||||
// these types are sent by the plugin as LONG - microseconds since Unix Epoch
|
||||
// but we'll convert them to nanos which is the smallest unit
|
||||
// these types are sent by the plugin as LONG - microseconds since Unix Epoch
|
||||
// but we'll convert them to nanos which is the smallest unit
|
||||
return TimeUnit.NANOSECONDS.convert(datumMessage.getDatumInt64(), TimeUnit.MICROSECONDS);
|
||||
case PgOid.TIMETZ:
|
||||
if (!datumMessage.hasDatumDouble()) {
|
||||
@ -463,7 +465,7 @@ protected Object extractValueFromMessage(PgProto.DatumMessage datumMessage) {
|
||||
case PgOid.INTERVAL:
|
||||
// these are sent as doubles by the plugin since their storage is larger than 8 bytes
|
||||
return datumMessage.hasDatumDouble() ? datumMessage.getDatumDouble() : null;
|
||||
// the plugin will send back a TZ formatted string
|
||||
// the plugin will send back a TZ formatted string
|
||||
case PgOid.BYTEA:
|
||||
return datumMessage.hasDatumBytes() ? datumMessage.getDatumBytes().toByteArray() : null;
|
||||
case PgOid.POINT: {
|
||||
|
@ -12,6 +12,7 @@
|
||||
import java.sql.Statement;
|
||||
import java.util.concurrent.atomic.AtomicLong;
|
||||
import java.util.concurrent.atomic.AtomicReference;
|
||||
|
||||
import org.postgresql.replication.LogSequenceNumber;
|
||||
import org.postgresql.util.PSQLState;
|
||||
import org.slf4j.Logger;
|
||||
@ -28,38 +29,40 @@
|
||||
* @author Horia Chiorean
|
||||
*/
|
||||
public class PostgresConnection extends JdbcConnection {
|
||||
|
||||
|
||||
private static final String URL_PATTERN = "jdbc:postgresql://${" + JdbcConfiguration.HOSTNAME + "}:${"
|
||||
+ JdbcConfiguration.PORT + "}/${" + JdbcConfiguration.DATABASE + "}";
|
||||
protected static ConnectionFactory FACTORY = JdbcConnection.patternBasedFactory(URL_PATTERN,
|
||||
+ JdbcConfiguration.PORT + "}/${" + JdbcConfiguration.DATABASE + "}";
|
||||
protected static ConnectionFactory FACTORY = JdbcConnection.patternBasedFactory(URL_PATTERN,
|
||||
org.postgresql.Driver.class.getName(),
|
||||
PostgresConnection.class.getClassLoader());
|
||||
|
||||
private static Logger LOGGER = LoggerFactory.getLogger(PostgresConnection.class);
|
||||
|
||||
|
||||
/**
|
||||
* Creates a Postgres connection using the supplied configuration.
|
||||
*
|
||||
* @param config {@link Configuration} instance, may not be null.
|
||||
* Creates a Postgres connection using the supplied configuration.
|
||||
*
|
||||
* @param config {@link Configuration} instance, may not be null.
|
||||
*/
|
||||
public PostgresConnection(Configuration config) {
|
||||
super(config, FACTORY, PostgresConnection::validateServerVersion, PostgresConnection::defaultSettings);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @see #connectionString(String)
|
||||
* Returns a JDBC connection string for the current configuration.
|
||||
*
|
||||
* @return a {@code String} where the variables in {@code urlPattern} are replaced with values from the configuration
|
||||
*/
|
||||
public String connectionString() {
|
||||
return connectionString(URL_PATTERN);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Executes a series of statements without explicitly committing the connection.
|
||||
*
|
||||
* @param statements a series of statements to execute
|
||||
* @return this object so methods can be chained together; never null
|
||||
* @throws SQLException if anything fails
|
||||
*/
|
||||
public PostgresConnection executeWithoutCommitting(String...statements) throws SQLException {
|
||||
public PostgresConnection executeWithoutCommitting(String... statements) throws SQLException {
|
||||
Connection conn = connection();
|
||||
try (Statement statement = conn.createStatement()) {
|
||||
for (String stmt : statements) {
|
||||
@ -68,15 +71,19 @@ public PostgresConnection executeWithoutCommitting(String...statements) throws S
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Prints out information about the REPLICA IDENTITY status of a table.
|
||||
* This in turn determines how much information is available for UPDATE and DELETE operations for logical replication.
|
||||
*
|
||||
* @param tableId the identifier of the table
|
||||
* @return the replica identity information; never null
|
||||
* @throws SQLException if there is a problem obtaining the replica identity information for the given table
|
||||
*/
|
||||
public ServerInfo.ReplicaIdentity readReplicaIdentityInfo(TableId tableId) throws SQLException {
|
||||
String statement = "SELECT relreplident FROM pg_catalog.pg_class c " +
|
||||
"LEFT JOIN pg_catalog.pg_namespace n ON c.relnamespace=n.oid " +
|
||||
"WHERE n.nspname=? and c.relname=?";
|
||||
"LEFT JOIN pg_catalog.pg_namespace n ON c.relnamespace=n.oid " +
|
||||
"WHERE n.nspname=? and c.relname=?";
|
||||
String schema = tableId.schema() != null && tableId.schema().length() > 0 ? tableId.schema() : "public";
|
||||
StringBuilder replIdentity = new StringBuilder();
|
||||
prepareQuery(statement, stmt -> {
|
||||
@ -91,36 +98,36 @@ public ServerInfo.ReplicaIdentity readReplicaIdentityInfo(TableId tableId) throw
|
||||
});
|
||||
return ServerInfo.ReplicaIdentity.parseFromDB(replIdentity.toString());
|
||||
}
|
||||
|
||||
|
||||
protected ServerInfo.ReplicationSlot readReplicationSlotInfo(String slotName, String pluginName) throws SQLException {
|
||||
AtomicReference<ServerInfo.ReplicationSlot> replicationSlotInfo = new AtomicReference<>();
|
||||
String database = database();
|
||||
prepareQuery(
|
||||
"select * from pg_replication_slots where slot_name = ? and database = ? and plugin = ?", statement -> {
|
||||
statement.setString(1, slotName);
|
||||
statement.setString(2, database);
|
||||
statement.setString(3, pluginName);
|
||||
}, rs -> {
|
||||
if (rs.next()) {
|
||||
boolean active = rs.getBoolean("active");
|
||||
Long confirmedFlushedLSN = null;
|
||||
try {
|
||||
String confirmedFlushLSNString = rs.getString("confirmed_flush_lsn");
|
||||
confirmedFlushedLSN = LogSequenceNumber.valueOf(confirmedFlushLSNString).asLong();
|
||||
} catch (SQLException e) {
|
||||
//info not available, so we must be prior to PG 9.6
|
||||
}
|
||||
replicationSlotInfo.compareAndSet(null, new ServerInfo.ReplicationSlot(active, confirmedFlushedLSN));
|
||||
} else {
|
||||
LOGGER.debug("No replication slot '{}' is present for plugin '{}' and database '{}'", slotName,
|
||||
pluginName, database);
|
||||
replicationSlotInfo.compareAndSet(null, ServerInfo.ReplicationSlot.INVALID);
|
||||
}
|
||||
});
|
||||
|
||||
"select * from pg_replication_slots where slot_name = ? and database = ? and plugin = ?", statement -> {
|
||||
statement.setString(1, slotName);
|
||||
statement.setString(2, database);
|
||||
statement.setString(3, pluginName);
|
||||
}, rs -> {
|
||||
if (rs.next()) {
|
||||
boolean active = rs.getBoolean("active");
|
||||
Long confirmedFlushedLSN = null;
|
||||
try {
|
||||
String confirmedFlushLSNString = rs.getString("confirmed_flush_lsn");
|
||||
confirmedFlushedLSN = LogSequenceNumber.valueOf(confirmedFlushLSNString).asLong();
|
||||
} catch (SQLException e) {
|
||||
// info not available, so we must be prior to PG 9.6
|
||||
}
|
||||
replicationSlotInfo.compareAndSet(null, new ServerInfo.ReplicationSlot(active, confirmedFlushedLSN));
|
||||
} else {
|
||||
LOGGER.debug("No replication slot '{}' is present for plugin '{}' and database '{}'", slotName,
|
||||
pluginName, database);
|
||||
replicationSlotInfo.compareAndSet(null, ServerInfo.ReplicationSlot.INVALID);
|
||||
}
|
||||
});
|
||||
|
||||
return replicationSlotInfo.get();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Drops a replication slot that was created on the DB
|
||||
*
|
||||
@ -132,7 +139,7 @@ public boolean dropReplicationSlot(String slotName) {
|
||||
execute("select pg_drop_replication_slot('" + slotName + "')");
|
||||
return true;
|
||||
} catch (SQLException e) {
|
||||
//slot is active
|
||||
// slot is active
|
||||
PSQLState currentState = new PSQLState(e.getSQLState());
|
||||
if (PSQLState.OBJECT_IN_USE.equals(currentState)) {
|
||||
LOGGER.warn("Cannot drop replication slot '{}' because it's still in use", slotName);
|
||||
@ -146,7 +153,7 @@ public boolean dropReplicationSlot(String slotName) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public synchronized void close() {
|
||||
try {
|
||||
@ -155,9 +162,10 @@ public synchronized void close() {
|
||||
LOGGER.error("Unexpected error while closing Postgres connection", e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns the PG id of the current active transaction
|
||||
* Returns the PG id of the current active transaction
|
||||
*
|
||||
* @return a PG transaction identifier, or null if no tx is active
|
||||
* @throws SQLException if anything fails.
|
||||
*/
|
||||
@ -171,7 +179,7 @@ public Long currentTransactionId() throws SQLException {
|
||||
long value = txId.get();
|
||||
return value > 0 ? value : null;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns the current position in the server tx log.
|
||||
*
|
||||
@ -188,7 +196,7 @@ public long currentXLogLocation() throws SQLException {
|
||||
});
|
||||
return result.get();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns information about the PG server to which this instance is connected.
|
||||
*
|
||||
@ -205,24 +213,25 @@ public ServerInfo serverInfo() throws SQLException {
|
||||
String username = serverInfo.username();
|
||||
if (username != null) {
|
||||
query("SELECT oid, rolname, rolsuper, rolinherit, rolcreaterole, rolcreatedb, rolcanlogin, rolreplication FROM pg_roles " +
|
||||
"WHERE pg_has_role('" + username +"', oid, 'member')", rs -> {
|
||||
while (rs.next()) {
|
||||
String roleInfo = "superuser: " + rs.getBoolean(3) + ", replication: " + rs.getBoolean(8) +
|
||||
", inherit: " + rs.getBoolean(4) + ", create role: " + rs.getBoolean(5) +
|
||||
", create db: " + rs.getBoolean(6) + ", can log in: " + rs.getBoolean(7);
|
||||
String roleName = rs.getString(2);
|
||||
serverInfo.addRole(roleName, roleInfo);
|
||||
}
|
||||
});
|
||||
"WHERE pg_has_role('" + username + "', oid, 'member')",
|
||||
rs -> {
|
||||
while (rs.next()) {
|
||||
String roleInfo = "superuser: " + rs.getBoolean(3) + ", replication: " + rs.getBoolean(8) +
|
||||
", inherit: " + rs.getBoolean(4) + ", create role: " + rs.getBoolean(5) +
|
||||
", create db: " + rs.getBoolean(6) + ", can log in: " + rs.getBoolean(7);
|
||||
String roleName = rs.getString(2);
|
||||
serverInfo.addRole(roleName, roleInfo);
|
||||
}
|
||||
});
|
||||
}
|
||||
return serverInfo;
|
||||
}
|
||||
|
||||
|
||||
protected static void defaultSettings(Configuration.Builder builder) {
|
||||
// we require Postgres 9.4 as the minimum server version since that's where logical replication was first introduced
|
||||
builder.with("assumeMinServerVersion", "9.4");
|
||||
}
|
||||
|
||||
|
||||
private static void validateServerVersion(Statement statement) throws SQLException {
|
||||
DatabaseMetaData metaData = statement.getConnection().getMetaData();
|
||||
int majorVersion = metaData.getDatabaseMajorVersion();
|
||||
@ -231,5 +240,5 @@ private static void validateServerVersion(Statement statement) throws SQLExcepti
|
||||
throw new SQLException("Cannot connect to a version of Postgres lower than 9.4");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -7,6 +7,7 @@
|
||||
package io.debezium.connector.postgresql.connection;
|
||||
|
||||
import java.sql.SQLException;
|
||||
|
||||
import org.postgresql.replication.LogSequenceNumber;
|
||||
import org.postgresql.replication.PGReplicationStream;
|
||||
|
||||
@ -18,7 +19,7 @@
|
||||
* and WAL offset tracking is specific to the [database name, plugin name, slot name] triple.
|
||||
*
|
||||
* @author Horia Chiorean (hchiorea@redhat.com)
|
||||
*/
|
||||
*/
|
||||
@NotThreadSafe
|
||||
public interface ReplicationConnection extends AutoCloseable {
|
||||
|
||||
@ -32,18 +33,19 @@ public interface ReplicationConnection extends AutoCloseable {
|
||||
* </p>
|
||||
*
|
||||
* @return a {@link PGReplicationStream} from which data is read; never null
|
||||
* @throws SQLException if there is a problem obtaining the replication stream
|
||||
*/
|
||||
ReplicationStream startStreaming() throws SQLException;
|
||||
|
||||
/**
|
||||
* Opens a stream for reading logical replication changes from a given LSN position.
|
||||
* Opens a stream for reading logical replication changes from a given LSN position.
|
||||
* <p>
|
||||
* Note that it is possible for a server to have recycled old WAL segments (see the {@code wal_keep_segments} setting). If
|
||||
* that is the case, then even though a LSN number may be valid, the server will not stream back any changes because they
|
||||
* are not available.
|
||||
* </p>
|
||||
* @param offset a value representing the WAL sequence number where replication should start from; if the value
|
||||
* is {@code null} or negative, this behaves exactly like {@link #startStreaming()}.
|
||||
* is {@code null} or negative, this behaves exactly like {@link #startStreaming()}.
|
||||
* @return a {@link PGReplicationStream} from which data is read; never null
|
||||
* @see org.postgresql.replication.LogSequenceNumber
|
||||
* @throws SQLException if anything fails
|
||||
@ -61,15 +63,15 @@ public interface ReplicationConnection extends AutoCloseable {
|
||||
/**
|
||||
* Creates a new {@link Builder} instance which can be used for creating replication connections.
|
||||
*
|
||||
* @param jdbcConfig a {@link Configuration} instance that contains JDBC settings; may not be null
|
||||
* @param jdbcConfig a {@link Configuration} instance that contains JDBC settings; may not be null
|
||||
* @return a builder, never null
|
||||
*/
|
||||
static Builder builder(Configuration jdbcConfig) {
|
||||
return new PostgresReplicationConnection.ReplicationConnectionBuilder(jdbcConfig);
|
||||
return new PostgresReplicationConnection.ReplicationConnectionBuilder(jdbcConfig);
|
||||
}
|
||||
|
||||
/**
|
||||
* Formats a LSN long value as a String value which can be used for outputting user-friendly LSN values.
|
||||
* Formats a LSN long value as a String value which can be used for outputting user-friendly LSN values.
|
||||
*
|
||||
* @param lsn the LSN value
|
||||
* @return a String format of the value, never {@code null}
|
||||
|
@ -1,3640 +0,0 @@
|
||||
// Generated by the protocol buffer compiler. DO NOT EDIT!
|
||||
// source: pg_logicaldec.proto
|
||||
|
||||
package io.debezium.connector.postgresql.proto;
|
||||
|
||||
public final class PgProto {
|
||||
private PgProto() {}
|
||||
public static void registerAllExtensions(
|
||||
com.google.protobuf.ExtensionRegistry registry) {
|
||||
}
|
||||
/**
|
||||
* Protobuf enum {@code decoderbufs.Op}
|
||||
*/
|
||||
public enum Op
|
||||
implements com.google.protobuf.ProtocolMessageEnum {
|
||||
/**
|
||||
* <code>INSERT = 0;</code>
|
||||
*/
|
||||
INSERT(0, 0),
|
||||
/**
|
||||
* <code>UPDATE = 1;</code>
|
||||
*/
|
||||
UPDATE(1, 1),
|
||||
/**
|
||||
* <code>DELETE = 2;</code>
|
||||
*/
|
||||
DELETE(2, 2),
|
||||
;
|
||||
|
||||
/**
|
||||
* <code>INSERT = 0;</code>
|
||||
*/
|
||||
public static final int INSERT_VALUE = 0;
|
||||
/**
|
||||
* <code>UPDATE = 1;</code>
|
||||
*/
|
||||
public static final int UPDATE_VALUE = 1;
|
||||
/**
|
||||
* <code>DELETE = 2;</code>
|
||||
*/
|
||||
public static final int DELETE_VALUE = 2;
|
||||
|
||||
|
||||
public final int getNumber() { return value; }
|
||||
|
||||
public static Op valueOf(int value) {
|
||||
switch (value) {
|
||||
case 0: return INSERT;
|
||||
case 1: return UPDATE;
|
||||
case 2: return DELETE;
|
||||
default: return null;
|
||||
}
|
||||
}
|
||||
|
||||
public static com.google.protobuf.Internal.EnumLiteMap<Op>
|
||||
internalGetValueMap() {
|
||||
return internalValueMap;
|
||||
}
|
||||
private static com.google.protobuf.Internal.EnumLiteMap<Op>
|
||||
internalValueMap =
|
||||
new com.google.protobuf.Internal.EnumLiteMap<Op>() {
|
||||
public Op findValueByNumber(int number) {
|
||||
return Op.valueOf(number);
|
||||
}
|
||||
};
|
||||
|
||||
public final com.google.protobuf.Descriptors.EnumValueDescriptor
|
||||
getValueDescriptor() {
|
||||
return getDescriptor().getValues().get(index);
|
||||
}
|
||||
public final com.google.protobuf.Descriptors.EnumDescriptor
|
||||
getDescriptorForType() {
|
||||
return getDescriptor();
|
||||
}
|
||||
public static final com.google.protobuf.Descriptors.EnumDescriptor
|
||||
getDescriptor() {
|
||||
return io.debezium.connector.postgresql.proto.PgProto.getDescriptor().getEnumTypes().get(0);
|
||||
}
|
||||
|
||||
private static final Op[] VALUES = values();
|
||||
|
||||
public static Op valueOf(
|
||||
com.google.protobuf.Descriptors.EnumValueDescriptor desc) {
|
||||
if (desc.getType() != getDescriptor()) {
|
||||
throw new java.lang.IllegalArgumentException(
|
||||
"EnumValueDescriptor is not for this type.");
|
||||
}
|
||||
return VALUES[desc.getIndex()];
|
||||
}
|
||||
|
||||
private final int index;
|
||||
private final int value;
|
||||
|
||||
private Op(int index, int value) {
|
||||
this.index = index;
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
// @@protoc_insertion_point(enum_scope:decoderbufs.Op)
|
||||
}
|
||||
|
||||
public interface PointOrBuilder extends
|
||||
// @@protoc_insertion_point(interface_extends:decoderbufs.Point)
|
||||
com.google.protobuf.MessageOrBuilder {
|
||||
|
||||
/**
|
||||
* <code>required double x = 1;</code>
|
||||
*/
|
||||
boolean hasX();
|
||||
/**
|
||||
* <code>required double x = 1;</code>
|
||||
*/
|
||||
double getX();
|
||||
|
||||
/**
|
||||
* <code>required double y = 2;</code>
|
||||
*/
|
||||
boolean hasY();
|
||||
/**
|
||||
* <code>required double y = 2;</code>
|
||||
*/
|
||||
double getY();
|
||||
}
|
||||
/**
|
||||
* Protobuf type {@code decoderbufs.Point}
|
||||
*/
|
||||
public static final class Point extends
|
||||
com.google.protobuf.GeneratedMessage implements
|
||||
// @@protoc_insertion_point(message_implements:decoderbufs.Point)
|
||||
PointOrBuilder {
|
||||
// Use Point.newBuilder() to construct.
|
||||
private Point(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
|
||||
super(builder);
|
||||
this.unknownFields = builder.getUnknownFields();
|
||||
}
|
||||
private Point(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }
|
||||
|
||||
private static final Point defaultInstance;
|
||||
public static Point getDefaultInstance() {
|
||||
return defaultInstance;
|
||||
}
|
||||
|
||||
public Point getDefaultInstanceForType() {
|
||||
return defaultInstance;
|
||||
}
|
||||
|
||||
private final com.google.protobuf.UnknownFieldSet unknownFields;
|
||||
@java.lang.Override
|
||||
public final com.google.protobuf.UnknownFieldSet
|
||||
getUnknownFields() {
|
||||
return this.unknownFields;
|
||||
}
|
||||
private Point(
|
||||
com.google.protobuf.CodedInputStream input,
|
||||
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||
throws com.google.protobuf.InvalidProtocolBufferException {
|
||||
initFields();
|
||||
int mutable_bitField0_ = 0;
|
||||
com.google.protobuf.UnknownFieldSet.Builder unknownFields =
|
||||
com.google.protobuf.UnknownFieldSet.newBuilder();
|
||||
try {
|
||||
boolean done = false;
|
||||
while (!done) {
|
||||
int tag = input.readTag();
|
||||
switch (tag) {
|
||||
case 0:
|
||||
done = true;
|
||||
break;
|
||||
default: {
|
||||
if (!parseUnknownField(input, unknownFields,
|
||||
extensionRegistry, tag)) {
|
||||
done = true;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 9: {
|
||||
bitField0_ |= 0x00000001;
|
||||
x_ = input.readDouble();
|
||||
break;
|
||||
}
|
||||
case 17: {
|
||||
bitField0_ |= 0x00000002;
|
||||
y_ = input.readDouble();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
|
||||
throw e.setUnfinishedMessage(this);
|
||||
} catch (java.io.IOException e) {
|
||||
throw new com.google.protobuf.InvalidProtocolBufferException(
|
||||
e.getMessage()).setUnfinishedMessage(this);
|
||||
} finally {
|
||||
this.unknownFields = unknownFields.build();
|
||||
makeExtensionsImmutable();
|
||||
}
|
||||
}
|
||||
public static final com.google.protobuf.Descriptors.Descriptor
|
||||
getDescriptor() {
|
||||
return io.debezium.connector.postgresql.proto.PgProto.internal_static_decoderbufs_Point_descriptor;
|
||||
}
|
||||
|
||||
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
|
||||
internalGetFieldAccessorTable() {
|
||||
return io.debezium.connector.postgresql.proto.PgProto.internal_static_decoderbufs_Point_fieldAccessorTable
|
||||
.ensureFieldAccessorsInitialized(
|
||||
io.debezium.connector.postgresql.proto.PgProto.Point.class, io.debezium.connector.postgresql.proto.PgProto.Point.Builder.class);
|
||||
}
|
||||
|
||||
public static com.google.protobuf.Parser<Point> PARSER =
|
||||
new com.google.protobuf.AbstractParser<Point>() {
|
||||
public Point parsePartialFrom(
|
||||
com.google.protobuf.CodedInputStream input,
|
||||
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||
throws com.google.protobuf.InvalidProtocolBufferException {
|
||||
return new Point(input, extensionRegistry);
|
||||
}
|
||||
};
|
||||
|
||||
@java.lang.Override
|
||||
public com.google.protobuf.Parser<Point> getParserForType() {
|
||||
return PARSER;
|
||||
}
|
||||
|
||||
private int bitField0_;
|
||||
public static final int X_FIELD_NUMBER = 1;
|
||||
private double x_;
|
||||
/**
|
||||
* <code>required double x = 1;</code>
|
||||
*/
|
||||
public boolean hasX() {
|
||||
return ((bitField0_ & 0x00000001) == 0x00000001);
|
||||
}
|
||||
/**
|
||||
* <code>required double x = 1;</code>
|
||||
*/
|
||||
public double getX() {
|
||||
return x_;
|
||||
}
|
||||
|
||||
public static final int Y_FIELD_NUMBER = 2;
|
||||
private double y_;
|
||||
/**
|
||||
* <code>required double y = 2;</code>
|
||||
*/
|
||||
public boolean hasY() {
|
||||
return ((bitField0_ & 0x00000002) == 0x00000002);
|
||||
}
|
||||
/**
|
||||
* <code>required double y = 2;</code>
|
||||
*/
|
||||
public double getY() {
|
||||
return y_;
|
||||
}
|
||||
|
||||
private void initFields() {
|
||||
x_ = 0D;
|
||||
y_ = 0D;
|
||||
}
|
||||
private byte memoizedIsInitialized = -1;
|
||||
public final boolean isInitialized() {
|
||||
byte isInitialized = memoizedIsInitialized;
|
||||
if (isInitialized == 1) return true;
|
||||
if (isInitialized == 0) return false;
|
||||
|
||||
if (!hasX()) {
|
||||
memoizedIsInitialized = 0;
|
||||
return false;
|
||||
}
|
||||
if (!hasY()) {
|
||||
memoizedIsInitialized = 0;
|
||||
return false;
|
||||
}
|
||||
memoizedIsInitialized = 1;
|
||||
return true;
|
||||
}
|
||||
|
||||
public void writeTo(com.google.protobuf.CodedOutputStream output)
|
||||
throws java.io.IOException {
|
||||
getSerializedSize();
|
||||
if (((bitField0_ & 0x00000001) == 0x00000001)) {
|
||||
output.writeDouble(1, x_);
|
||||
}
|
||||
if (((bitField0_ & 0x00000002) == 0x00000002)) {
|
||||
output.writeDouble(2, y_);
|
||||
}
|
||||
getUnknownFields().writeTo(output);
|
||||
}
|
||||
|
||||
private int memoizedSerializedSize = -1;
|
||||
public int getSerializedSize() {
|
||||
int size = memoizedSerializedSize;
|
||||
if (size != -1) return size;
|
||||
|
||||
size = 0;
|
||||
if (((bitField0_ & 0x00000001) == 0x00000001)) {
|
||||
size += com.google.protobuf.CodedOutputStream
|
||||
.computeDoubleSize(1, x_);
|
||||
}
|
||||
if (((bitField0_ & 0x00000002) == 0x00000002)) {
|
||||
size += com.google.protobuf.CodedOutputStream
|
||||
.computeDoubleSize(2, y_);
|
||||
}
|
||||
size += getUnknownFields().getSerializedSize();
|
||||
memoizedSerializedSize = size;
|
||||
return size;
|
||||
}
|
||||
|
||||
private static final long serialVersionUID = 0L;
|
||||
@java.lang.Override
|
||||
protected java.lang.Object writeReplace()
|
||||
throws java.io.ObjectStreamException {
|
||||
return super.writeReplace();
|
||||
}
|
||||
|
||||
public static io.debezium.connector.postgresql.proto.PgProto.Point parseFrom(
|
||||
com.google.protobuf.ByteString data)
|
||||
throws com.google.protobuf.InvalidProtocolBufferException {
|
||||
return PARSER.parseFrom(data);
|
||||
}
|
||||
public static io.debezium.connector.postgresql.proto.PgProto.Point parseFrom(
|
||||
com.google.protobuf.ByteString data,
|
||||
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||
throws com.google.protobuf.InvalidProtocolBufferException {
|
||||
return PARSER.parseFrom(data, extensionRegistry);
|
||||
}
|
||||
public static io.debezium.connector.postgresql.proto.PgProto.Point parseFrom(byte[] data)
|
||||
throws com.google.protobuf.InvalidProtocolBufferException {
|
||||
return PARSER.parseFrom(data);
|
||||
}
|
||||
public static io.debezium.connector.postgresql.proto.PgProto.Point parseFrom(
|
||||
byte[] data,
|
||||
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||
throws com.google.protobuf.InvalidProtocolBufferException {
|
||||
return PARSER.parseFrom(data, extensionRegistry);
|
||||
}
|
||||
public static io.debezium.connector.postgresql.proto.PgProto.Point parseFrom(java.io.InputStream input)
|
||||
throws java.io.IOException {
|
||||
return PARSER.parseFrom(input);
|
||||
}
|
||||
public static io.debezium.connector.postgresql.proto.PgProto.Point parseFrom(
|
||||
java.io.InputStream input,
|
||||
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||
throws java.io.IOException {
|
||||
return PARSER.parseFrom(input, extensionRegistry);
|
||||
}
|
||||
public static io.debezium.connector.postgresql.proto.PgProto.Point parseDelimitedFrom(java.io.InputStream input)
|
||||
throws java.io.IOException {
|
||||
return PARSER.parseDelimitedFrom(input);
|
||||
}
|
||||
public static io.debezium.connector.postgresql.proto.PgProto.Point parseDelimitedFrom(
|
||||
java.io.InputStream input,
|
||||
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||
throws java.io.IOException {
|
||||
return PARSER.parseDelimitedFrom(input, extensionRegistry);
|
||||
}
|
||||
public static io.debezium.connector.postgresql.proto.PgProto.Point parseFrom(
|
||||
com.google.protobuf.CodedInputStream input)
|
||||
throws java.io.IOException {
|
||||
return PARSER.parseFrom(input);
|
||||
}
|
||||
public static io.debezium.connector.postgresql.proto.PgProto.Point parseFrom(
|
||||
com.google.protobuf.CodedInputStream input,
|
||||
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||
throws java.io.IOException {
|
||||
return PARSER.parseFrom(input, extensionRegistry);
|
||||
}
|
||||
|
||||
public static Builder newBuilder() { return Builder.create(); }
|
||||
public Builder newBuilderForType() { return newBuilder(); }
|
||||
public static Builder newBuilder(io.debezium.connector.postgresql.proto.PgProto.Point prototype) {
|
||||
return newBuilder().mergeFrom(prototype);
|
||||
}
|
||||
public Builder toBuilder() { return newBuilder(this); }
|
||||
|
||||
@java.lang.Override
|
||||
protected Builder newBuilderForType(
|
||||
com.google.protobuf.GeneratedMessage.BuilderParent parent) {
|
||||
Builder builder = new Builder(parent);
|
||||
return builder;
|
||||
}
|
||||
/**
|
||||
* Protobuf type {@code decoderbufs.Point}
|
||||
*/
|
||||
public static final class Builder extends
|
||||
com.google.protobuf.GeneratedMessage.Builder<Builder> implements
|
||||
// @@protoc_insertion_point(builder_implements:decoderbufs.Point)
|
||||
io.debezium.connector.postgresql.proto.PgProto.PointOrBuilder {
|
||||
public static final com.google.protobuf.Descriptors.Descriptor
|
||||
getDescriptor() {
|
||||
return io.debezium.connector.postgresql.proto.PgProto.internal_static_decoderbufs_Point_descriptor;
|
||||
}
|
||||
|
||||
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
|
||||
internalGetFieldAccessorTable() {
|
||||
return io.debezium.connector.postgresql.proto.PgProto.internal_static_decoderbufs_Point_fieldAccessorTable
|
||||
.ensureFieldAccessorsInitialized(
|
||||
io.debezium.connector.postgresql.proto.PgProto.Point.class, io.debezium.connector.postgresql.proto.PgProto.Point.Builder.class);
|
||||
}
|
||||
|
||||
// Construct using io.debezium.connector.postgresql.proto.PgProto.Point.newBuilder()
|
||||
private Builder() {
|
||||
maybeForceBuilderInitialization();
|
||||
}
|
||||
|
||||
private Builder(
|
||||
com.google.protobuf.GeneratedMessage.BuilderParent parent) {
|
||||
super(parent);
|
||||
maybeForceBuilderInitialization();
|
||||
}
|
||||
private void maybeForceBuilderInitialization() {
|
||||
if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
|
||||
}
|
||||
}
|
||||
private static Builder create() {
|
||||
return new Builder();
|
||||
}
|
||||
|
||||
public Builder clear() {
|
||||
super.clear();
|
||||
x_ = 0D;
|
||||
bitField0_ = (bitField0_ & ~0x00000001);
|
||||
y_ = 0D;
|
||||
bitField0_ = (bitField0_ & ~0x00000002);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder clone() {
|
||||
return create().mergeFrom(buildPartial());
|
||||
}
|
||||
|
||||
public com.google.protobuf.Descriptors.Descriptor
|
||||
getDescriptorForType() {
|
||||
return io.debezium.connector.postgresql.proto.PgProto.internal_static_decoderbufs_Point_descriptor;
|
||||
}
|
||||
|
||||
public io.debezium.connector.postgresql.proto.PgProto.Point getDefaultInstanceForType() {
|
||||
return io.debezium.connector.postgresql.proto.PgProto.Point.getDefaultInstance();
|
||||
}
|
||||
|
||||
public io.debezium.connector.postgresql.proto.PgProto.Point build() {
|
||||
io.debezium.connector.postgresql.proto.PgProto.Point result = buildPartial();
|
||||
if (!result.isInitialized()) {
|
||||
throw newUninitializedMessageException(result);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public io.debezium.connector.postgresql.proto.PgProto.Point buildPartial() {
|
||||
io.debezium.connector.postgresql.proto.PgProto.Point result = new io.debezium.connector.postgresql.proto.PgProto.Point(this);
|
||||
int from_bitField0_ = bitField0_;
|
||||
int to_bitField0_ = 0;
|
||||
if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
|
||||
to_bitField0_ |= 0x00000001;
|
||||
}
|
||||
result.x_ = x_;
|
||||
if (((from_bitField0_ & 0x00000002) == 0x00000002)) {
|
||||
to_bitField0_ |= 0x00000002;
|
||||
}
|
||||
result.y_ = y_;
|
||||
result.bitField0_ = to_bitField0_;
|
||||
onBuilt();
|
||||
return result;
|
||||
}
|
||||
|
||||
public Builder mergeFrom(com.google.protobuf.Message other) {
|
||||
if (other instanceof io.debezium.connector.postgresql.proto.PgProto.Point) {
|
||||
return mergeFrom((io.debezium.connector.postgresql.proto.PgProto.Point)other);
|
||||
} else {
|
||||
super.mergeFrom(other);
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
public Builder mergeFrom(io.debezium.connector.postgresql.proto.PgProto.Point other) {
|
||||
if (other == io.debezium.connector.postgresql.proto.PgProto.Point.getDefaultInstance()) return this;
|
||||
if (other.hasX()) {
|
||||
setX(other.getX());
|
||||
}
|
||||
if (other.hasY()) {
|
||||
setY(other.getY());
|
||||
}
|
||||
this.mergeUnknownFields(other.getUnknownFields());
|
||||
return this;
|
||||
}
|
||||
|
||||
public final boolean isInitialized() {
|
||||
if (!hasX()) {
|
||||
|
||||
return false;
|
||||
}
|
||||
if (!hasY()) {
|
||||
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public Builder mergeFrom(
|
||||
com.google.protobuf.CodedInputStream input,
|
||||
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||
throws java.io.IOException {
|
||||
io.debezium.connector.postgresql.proto.PgProto.Point parsedMessage = null;
|
||||
try {
|
||||
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
|
||||
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
|
||||
parsedMessage = (io.debezium.connector.postgresql.proto.PgProto.Point) e.getUnfinishedMessage();
|
||||
throw e;
|
||||
} finally {
|
||||
if (parsedMessage != null) {
|
||||
mergeFrom(parsedMessage);
|
||||
}
|
||||
}
|
||||
return this;
|
||||
}
|
||||
private int bitField0_;
|
||||
|
||||
private double x_ ;
|
||||
/**
|
||||
* <code>required double x = 1;</code>
|
||||
*/
|
||||
public boolean hasX() {
|
||||
return ((bitField0_ & 0x00000001) == 0x00000001);
|
||||
}
|
||||
/**
|
||||
* <code>required double x = 1;</code>
|
||||
*/
|
||||
public double getX() {
|
||||
return x_;
|
||||
}
|
||||
/**
|
||||
* <code>required double x = 1;</code>
|
||||
*/
|
||||
public Builder setX(double value) {
|
||||
bitField0_ |= 0x00000001;
|
||||
x_ = value;
|
||||
onChanged();
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* <code>required double x = 1;</code>
|
||||
*/
|
||||
public Builder clearX() {
|
||||
bitField0_ = (bitField0_ & ~0x00000001);
|
||||
x_ = 0D;
|
||||
onChanged();
|
||||
return this;
|
||||
}
|
||||
|
||||
private double y_ ;
|
||||
/**
|
||||
* <code>required double y = 2;</code>
|
||||
*/
|
||||
public boolean hasY() {
|
||||
return ((bitField0_ & 0x00000002) == 0x00000002);
|
||||
}
|
||||
/**
|
||||
* <code>required double y = 2;</code>
|
||||
*/
|
||||
public double getY() {
|
||||
return y_;
|
||||
}
|
||||
/**
|
||||
* <code>required double y = 2;</code>
|
||||
*/
|
||||
public Builder setY(double value) {
|
||||
bitField0_ |= 0x00000002;
|
||||
y_ = value;
|
||||
onChanged();
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* <code>required double y = 2;</code>
|
||||
*/
|
||||
public Builder clearY() {
|
||||
bitField0_ = (bitField0_ & ~0x00000002);
|
||||
y_ = 0D;
|
||||
onChanged();
|
||||
return this;
|
||||
}
|
||||
|
||||
// @@protoc_insertion_point(builder_scope:decoderbufs.Point)
|
||||
}
|
||||
|
||||
static {
|
||||
defaultInstance = new Point(true);
|
||||
defaultInstance.initFields();
|
||||
}
|
||||
|
||||
// @@protoc_insertion_point(class_scope:decoderbufs.Point)
|
||||
}
|
||||
|
||||
public interface DatumMessageOrBuilder extends
|
||||
// @@protoc_insertion_point(interface_extends:decoderbufs.DatumMessage)
|
||||
com.google.protobuf.MessageOrBuilder {
|
||||
|
||||
/**
|
||||
* <code>optional string column_name = 1;</code>
|
||||
*/
|
||||
boolean hasColumnName();
|
||||
/**
|
||||
* <code>optional string column_name = 1;</code>
|
||||
*/
|
||||
java.lang.String getColumnName();
|
||||
/**
|
||||
* <code>optional string column_name = 1;</code>
|
||||
*/
|
||||
com.google.protobuf.ByteString
|
||||
getColumnNameBytes();
|
||||
|
||||
/**
|
||||
* <code>optional int64 column_type = 2;</code>
|
||||
*/
|
||||
boolean hasColumnType();
|
||||
/**
|
||||
* <code>optional int64 column_type = 2;</code>
|
||||
*/
|
||||
long getColumnType();
|
||||
|
||||
/**
|
||||
* <code>optional int32 datum_int32 = 3;</code>
|
||||
*/
|
||||
boolean hasDatumInt32();
|
||||
/**
|
||||
* <code>optional int32 datum_int32 = 3;</code>
|
||||
*/
|
||||
int getDatumInt32();
|
||||
|
||||
/**
|
||||
* <code>optional int64 datum_int64 = 4;</code>
|
||||
*/
|
||||
boolean hasDatumInt64();
|
||||
/**
|
||||
* <code>optional int64 datum_int64 = 4;</code>
|
||||
*/
|
||||
long getDatumInt64();
|
||||
|
||||
/**
|
||||
* <code>optional float datum_float = 5;</code>
|
||||
*/
|
||||
boolean hasDatumFloat();
|
||||
/**
|
||||
* <code>optional float datum_float = 5;</code>
|
||||
*/
|
||||
float getDatumFloat();
|
||||
|
||||
/**
|
||||
* <code>optional double datum_double = 6;</code>
|
||||
*/
|
||||
boolean hasDatumDouble();
|
||||
/**
|
||||
* <code>optional double datum_double = 6;</code>
|
||||
*/
|
||||
double getDatumDouble();
|
||||
|
||||
/**
|
||||
* <code>optional bool datum_bool = 7;</code>
|
||||
*/
|
||||
boolean hasDatumBool();
|
||||
/**
|
||||
* <code>optional bool datum_bool = 7;</code>
|
||||
*/
|
||||
boolean getDatumBool();
|
||||
|
||||
/**
|
||||
* <code>optional string datum_string = 8;</code>
|
||||
*/
|
||||
boolean hasDatumString();
|
||||
/**
|
||||
* <code>optional string datum_string = 8;</code>
|
||||
*/
|
||||
java.lang.String getDatumString();
|
||||
/**
|
||||
* <code>optional string datum_string = 8;</code>
|
||||
*/
|
||||
com.google.protobuf.ByteString
|
||||
getDatumStringBytes();
|
||||
|
||||
/**
|
||||
* <code>optional bytes datum_bytes = 9;</code>
|
||||
*/
|
||||
boolean hasDatumBytes();
|
||||
/**
|
||||
* <code>optional bytes datum_bytes = 9;</code>
|
||||
*/
|
||||
com.google.protobuf.ByteString getDatumBytes();
|
||||
|
||||
/**
|
||||
* <code>optional .decoderbufs.Point datum_point = 10;</code>
|
||||
*/
|
||||
boolean hasDatumPoint();
|
||||
/**
|
||||
* <code>optional .decoderbufs.Point datum_point = 10;</code>
|
||||
*/
|
||||
io.debezium.connector.postgresql.proto.PgProto.Point getDatumPoint();
|
||||
/**
|
||||
* <code>optional .decoderbufs.Point datum_point = 10;</code>
|
||||
*/
|
||||
io.debezium.connector.postgresql.proto.PgProto.PointOrBuilder getDatumPointOrBuilder();
|
||||
}
|
||||
/**
|
||||
* Protobuf type {@code decoderbufs.DatumMessage}
|
||||
*/
|
||||
public static final class DatumMessage extends
|
||||
com.google.protobuf.GeneratedMessage implements
|
||||
// @@protoc_insertion_point(message_implements:decoderbufs.DatumMessage)
|
||||
DatumMessageOrBuilder {
|
||||
// Use DatumMessage.newBuilder() to construct.
|
||||
private DatumMessage(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
|
||||
super(builder);
|
||||
this.unknownFields = builder.getUnknownFields();
|
||||
}
|
||||
private DatumMessage(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }
|
||||
|
||||
private static final DatumMessage defaultInstance;
|
||||
public static DatumMessage getDefaultInstance() {
|
||||
return defaultInstance;
|
||||
}
|
||||
|
||||
public DatumMessage getDefaultInstanceForType() {
|
||||
return defaultInstance;
|
||||
}
|
||||
|
||||
private final com.google.protobuf.UnknownFieldSet unknownFields;
|
||||
@java.lang.Override
|
||||
public final com.google.protobuf.UnknownFieldSet
|
||||
getUnknownFields() {
|
||||
return this.unknownFields;
|
||||
}
|
||||
private DatumMessage(
|
||||
com.google.protobuf.CodedInputStream input,
|
||||
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||
throws com.google.protobuf.InvalidProtocolBufferException {
|
||||
initFields();
|
||||
int mutable_bitField0_ = 0;
|
||||
com.google.protobuf.UnknownFieldSet.Builder unknownFields =
|
||||
com.google.protobuf.UnknownFieldSet.newBuilder();
|
||||
try {
|
||||
boolean done = false;
|
||||
while (!done) {
|
||||
int tag = input.readTag();
|
||||
switch (tag) {
|
||||
case 0:
|
||||
done = true;
|
||||
break;
|
||||
default: {
|
||||
if (!parseUnknownField(input, unknownFields,
|
||||
extensionRegistry, tag)) {
|
||||
done = true;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 10: {
|
||||
com.google.protobuf.ByteString bs = input.readBytes();
|
||||
bitField0_ |= 0x00000001;
|
||||
columnName_ = bs;
|
||||
break;
|
||||
}
|
||||
case 16: {
|
||||
bitField0_ |= 0x00000002;
|
||||
columnType_ = input.readInt64();
|
||||
break;
|
||||
}
|
||||
case 24: {
|
||||
datumCase_ = 3;
|
||||
datum_ = input.readInt32();
|
||||
break;
|
||||
}
|
||||
case 32: {
|
||||
datumCase_ = 4;
|
||||
datum_ = input.readInt64();
|
||||
break;
|
||||
}
|
||||
case 45: {
|
||||
datumCase_ = 5;
|
||||
datum_ = input.readFloat();
|
||||
break;
|
||||
}
|
||||
case 49: {
|
||||
datumCase_ = 6;
|
||||
datum_ = input.readDouble();
|
||||
break;
|
||||
}
|
||||
case 56: {
|
||||
datumCase_ = 7;
|
||||
datum_ = input.readBool();
|
||||
break;
|
||||
}
|
||||
case 66: {
|
||||
com.google.protobuf.ByteString bs = input.readBytes();
|
||||
datumCase_ = 8;
|
||||
datum_ = bs;
|
||||
break;
|
||||
}
|
||||
case 74: {
|
||||
datumCase_ = 9;
|
||||
datum_ = input.readBytes();
|
||||
break;
|
||||
}
|
||||
case 82: {
|
||||
io.debezium.connector.postgresql.proto.PgProto.Point.Builder subBuilder = null;
|
||||
if (datumCase_ == 10) {
|
||||
subBuilder = ((io.debezium.connector.postgresql.proto.PgProto.Point) datum_).toBuilder();
|
||||
}
|
||||
datum_ = input.readMessage(io.debezium.connector.postgresql.proto.PgProto.Point.PARSER, extensionRegistry);
|
||||
if (subBuilder != null) {
|
||||
subBuilder.mergeFrom((io.debezium.connector.postgresql.proto.PgProto.Point) datum_);
|
||||
datum_ = subBuilder.buildPartial();
|
||||
}
|
||||
datumCase_ = 10;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
|
||||
throw e.setUnfinishedMessage(this);
|
||||
} catch (java.io.IOException e) {
|
||||
throw new com.google.protobuf.InvalidProtocolBufferException(
|
||||
e.getMessage()).setUnfinishedMessage(this);
|
||||
} finally {
|
||||
this.unknownFields = unknownFields.build();
|
||||
makeExtensionsImmutable();
|
||||
}
|
||||
}
|
||||
public static final com.google.protobuf.Descriptors.Descriptor
|
||||
getDescriptor() {
|
||||
return io.debezium.connector.postgresql.proto.PgProto.internal_static_decoderbufs_DatumMessage_descriptor;
|
||||
}
|
||||
|
||||
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
|
||||
internalGetFieldAccessorTable() {
|
||||
return io.debezium.connector.postgresql.proto.PgProto.internal_static_decoderbufs_DatumMessage_fieldAccessorTable
|
||||
.ensureFieldAccessorsInitialized(
|
||||
io.debezium.connector.postgresql.proto.PgProto.DatumMessage.class, io.debezium.connector.postgresql.proto.PgProto.DatumMessage.Builder.class);
|
||||
}
|
||||
|
||||
public static com.google.protobuf.Parser<DatumMessage> PARSER =
|
||||
new com.google.protobuf.AbstractParser<DatumMessage>() {
|
||||
public DatumMessage parsePartialFrom(
|
||||
com.google.protobuf.CodedInputStream input,
|
||||
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||
throws com.google.protobuf.InvalidProtocolBufferException {
|
||||
return new DatumMessage(input, extensionRegistry);
|
||||
}
|
||||
};
|
||||
|
||||
@java.lang.Override
|
||||
public com.google.protobuf.Parser<DatumMessage> getParserForType() {
|
||||
return PARSER;
|
||||
}
|
||||
|
||||
private int bitField0_;
|
||||
private int datumCase_ = 0;
|
||||
private java.lang.Object datum_;
|
||||
public enum DatumCase
|
||||
implements com.google.protobuf.Internal.EnumLite {
|
||||
DATUM_INT32(3),
|
||||
DATUM_INT64(4),
|
||||
DATUM_FLOAT(5),
|
||||
DATUM_DOUBLE(6),
|
||||
DATUM_BOOL(7),
|
||||
DATUM_STRING(8),
|
||||
DATUM_BYTES(9),
|
||||
DATUM_POINT(10),
|
||||
DATUM_NOT_SET(0);
|
||||
private int value = 0;
|
||||
private DatumCase(int value) {
|
||||
this.value = value;
|
||||
}
|
||||
public static DatumCase valueOf(int value) {
|
||||
switch (value) {
|
||||
case 3: return DATUM_INT32;
|
||||
case 4: return DATUM_INT64;
|
||||
case 5: return DATUM_FLOAT;
|
||||
case 6: return DATUM_DOUBLE;
|
||||
case 7: return DATUM_BOOL;
|
||||
case 8: return DATUM_STRING;
|
||||
case 9: return DATUM_BYTES;
|
||||
case 10: return DATUM_POINT;
|
||||
case 0: return DATUM_NOT_SET;
|
||||
default: throw new java.lang.IllegalArgumentException(
|
||||
"Value is undefined for this oneof enum.");
|
||||
}
|
||||
}
|
||||
public int getNumber() {
|
||||
return this.value;
|
||||
}
|
||||
};
|
||||
|
||||
public DatumCase
|
||||
getDatumCase() {
|
||||
return DatumCase.valueOf(
|
||||
datumCase_);
|
||||
}
|
||||
|
||||
public static final int COLUMN_NAME_FIELD_NUMBER = 1;
|
||||
private java.lang.Object columnName_;
|
||||
/**
|
||||
* <code>optional string column_name = 1;</code>
|
||||
*/
|
||||
public boolean hasColumnName() {
|
||||
return ((bitField0_ & 0x00000001) == 0x00000001);
|
||||
}
|
||||
/**
|
||||
* <code>optional string column_name = 1;</code>
|
||||
*/
|
||||
public java.lang.String getColumnName() {
|
||||
java.lang.Object ref = columnName_;
|
||||
if (ref instanceof java.lang.String) {
|
||||
return (java.lang.String) ref;
|
||||
} else {
|
||||
com.google.protobuf.ByteString bs =
|
||||
(com.google.protobuf.ByteString) ref;
|
||||
java.lang.String s = bs.toStringUtf8();
|
||||
if (bs.isValidUtf8()) {
|
||||
columnName_ = s;
|
||||
}
|
||||
return s;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* <code>optional string column_name = 1;</code>
|
||||
*/
|
||||
public com.google.protobuf.ByteString
|
||||
getColumnNameBytes() {
|
||||
java.lang.Object ref = columnName_;
|
||||
if (ref instanceof java.lang.String) {
|
||||
com.google.protobuf.ByteString b =
|
||||
com.google.protobuf.ByteString.copyFromUtf8(
|
||||
(java.lang.String) ref);
|
||||
columnName_ = b;
|
||||
return b;
|
||||
} else {
|
||||
return (com.google.protobuf.ByteString) ref;
|
||||
}
|
||||
}
|
||||
|
||||
public static final int COLUMN_TYPE_FIELD_NUMBER = 2;
|
||||
private long columnType_;
|
||||
/**
|
||||
* <code>optional int64 column_type = 2;</code>
|
||||
*/
|
||||
public boolean hasColumnType() {
|
||||
return ((bitField0_ & 0x00000002) == 0x00000002);
|
||||
}
|
||||
/**
|
||||
* <code>optional int64 column_type = 2;</code>
|
||||
*/
|
||||
public long getColumnType() {
|
||||
return columnType_;
|
||||
}
|
||||
|
||||
public static final int DATUM_INT32_FIELD_NUMBER = 3;
|
||||
/**
|
||||
* <code>optional int32 datum_int32 = 3;</code>
|
||||
*/
|
||||
public boolean hasDatumInt32() {
|
||||
return datumCase_ == 3;
|
||||
}
|
||||
/**
|
||||
* <code>optional int32 datum_int32 = 3;</code>
|
||||
*/
|
||||
public int getDatumInt32() {
|
||||
if (datumCase_ == 3) {
|
||||
return (java.lang.Integer) datum_;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
public static final int DATUM_INT64_FIELD_NUMBER = 4;
|
||||
/**
|
||||
* <code>optional int64 datum_int64 = 4;</code>
|
||||
*/
|
||||
public boolean hasDatumInt64() {
|
||||
return datumCase_ == 4;
|
||||
}
|
||||
/**
|
||||
* <code>optional int64 datum_int64 = 4;</code>
|
||||
*/
|
||||
public long getDatumInt64() {
|
||||
if (datumCase_ == 4) {
|
||||
return (java.lang.Long) datum_;
|
||||
}
|
||||
return 0L;
|
||||
}
|
||||
|
||||
public static final int DATUM_FLOAT_FIELD_NUMBER = 5;
|
||||
/**
|
||||
* <code>optional float datum_float = 5;</code>
|
||||
*/
|
||||
public boolean hasDatumFloat() {
|
||||
return datumCase_ == 5;
|
||||
}
|
||||
/**
|
||||
* <code>optional float datum_float = 5;</code>
|
||||
*/
|
||||
public float getDatumFloat() {
|
||||
if (datumCase_ == 5) {
|
||||
return (java.lang.Float) datum_;
|
||||
}
|
||||
return 0F;
|
||||
}
|
||||
|
||||
public static final int DATUM_DOUBLE_FIELD_NUMBER = 6;
|
||||
/**
|
||||
* <code>optional double datum_double = 6;</code>
|
||||
*/
|
||||
public boolean hasDatumDouble() {
|
||||
return datumCase_ == 6;
|
||||
}
|
||||
/**
|
||||
* <code>optional double datum_double = 6;</code>
|
||||
*/
|
||||
public double getDatumDouble() {
|
||||
if (datumCase_ == 6) {
|
||||
return (java.lang.Double) datum_;
|
||||
}
|
||||
return 0D;
|
||||
}
|
||||
|
||||
public static final int DATUM_BOOL_FIELD_NUMBER = 7;
|
||||
/**
|
||||
* <code>optional bool datum_bool = 7;</code>
|
||||
*/
|
||||
public boolean hasDatumBool() {
|
||||
return datumCase_ == 7;
|
||||
}
|
||||
/**
|
||||
* <code>optional bool datum_bool = 7;</code>
|
||||
*/
|
||||
public boolean getDatumBool() {
|
||||
if (datumCase_ == 7) {
|
||||
return (java.lang.Boolean) datum_;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static final int DATUM_STRING_FIELD_NUMBER = 8;
|
||||
/**
|
||||
* <code>optional string datum_string = 8;</code>
|
||||
*/
|
||||
public boolean hasDatumString() {
|
||||
return datumCase_ == 8;
|
||||
}
|
||||
/**
|
||||
* <code>optional string datum_string = 8;</code>
|
||||
*/
|
||||
public java.lang.String getDatumString() {
|
||||
java.lang.Object ref = "";
|
||||
if (datumCase_ == 8) {
|
||||
ref = datum_;
|
||||
}
|
||||
if (ref instanceof java.lang.String) {
|
||||
return (java.lang.String) ref;
|
||||
} else {
|
||||
com.google.protobuf.ByteString bs =
|
||||
(com.google.protobuf.ByteString) ref;
|
||||
java.lang.String s = bs.toStringUtf8();
|
||||
if (bs.isValidUtf8() && (datumCase_ == 8)) {
|
||||
datum_ = s;
|
||||
}
|
||||
return s;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* <code>optional string datum_string = 8;</code>
|
||||
*/
|
||||
public com.google.protobuf.ByteString
|
||||
getDatumStringBytes() {
|
||||
java.lang.Object ref = "";
|
||||
if (datumCase_ == 8) {
|
||||
ref = datum_;
|
||||
}
|
||||
if (ref instanceof java.lang.String) {
|
||||
com.google.protobuf.ByteString b =
|
||||
com.google.protobuf.ByteString.copyFromUtf8(
|
||||
(java.lang.String) ref);
|
||||
if (datumCase_ == 8) {
|
||||
datum_ = b;
|
||||
}
|
||||
return b;
|
||||
} else {
|
||||
return (com.google.protobuf.ByteString) ref;
|
||||
}
|
||||
}
|
||||
|
||||
public static final int DATUM_BYTES_FIELD_NUMBER = 9;
|
||||
/**
|
||||
* <code>optional bytes datum_bytes = 9;</code>
|
||||
*/
|
||||
public boolean hasDatumBytes() {
|
||||
return datumCase_ == 9;
|
||||
}
|
||||
/**
|
||||
* <code>optional bytes datum_bytes = 9;</code>
|
||||
*/
|
||||
public com.google.protobuf.ByteString getDatumBytes() {
|
||||
if (datumCase_ == 9) {
|
||||
return (com.google.protobuf.ByteString) datum_;
|
||||
}
|
||||
return com.google.protobuf.ByteString.EMPTY;
|
||||
}
|
||||
|
||||
public static final int DATUM_POINT_FIELD_NUMBER = 10;
|
||||
/**
|
||||
* <code>optional .decoderbufs.Point datum_point = 10;</code>
|
||||
*/
|
||||
public boolean hasDatumPoint() {
|
||||
return datumCase_ == 10;
|
||||
}
|
||||
/**
|
||||
* <code>optional .decoderbufs.Point datum_point = 10;</code>
|
||||
*/
|
||||
public io.debezium.connector.postgresql.proto.PgProto.Point getDatumPoint() {
|
||||
if (datumCase_ == 10) {
|
||||
return (io.debezium.connector.postgresql.proto.PgProto.Point) datum_;
|
||||
}
|
||||
return io.debezium.connector.postgresql.proto.PgProto.Point.getDefaultInstance();
|
||||
}
|
||||
/**
|
||||
* <code>optional .decoderbufs.Point datum_point = 10;</code>
|
||||
*/
|
||||
public io.debezium.connector.postgresql.proto.PgProto.PointOrBuilder getDatumPointOrBuilder() {
|
||||
if (datumCase_ == 10) {
|
||||
return (io.debezium.connector.postgresql.proto.PgProto.Point) datum_;
|
||||
}
|
||||
return io.debezium.connector.postgresql.proto.PgProto.Point.getDefaultInstance();
|
||||
}
|
||||
|
||||
private void initFields() {
|
||||
columnName_ = "";
|
||||
columnType_ = 0L;
|
||||
}
|
||||
private byte memoizedIsInitialized = -1;
|
||||
public final boolean isInitialized() {
|
||||
byte isInitialized = memoizedIsInitialized;
|
||||
if (isInitialized == 1) return true;
|
||||
if (isInitialized == 0) return false;
|
||||
|
||||
if (hasDatumPoint()) {
|
||||
if (!getDatumPoint().isInitialized()) {
|
||||
memoizedIsInitialized = 0;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
memoizedIsInitialized = 1;
|
||||
return true;
|
||||
}
|
||||
|
||||
public void writeTo(com.google.protobuf.CodedOutputStream output)
|
||||
throws java.io.IOException {
|
||||
getSerializedSize();
|
||||
if (((bitField0_ & 0x00000001) == 0x00000001)) {
|
||||
output.writeBytes(1, getColumnNameBytes());
|
||||
}
|
||||
if (((bitField0_ & 0x00000002) == 0x00000002)) {
|
||||
output.writeInt64(2, columnType_);
|
||||
}
|
||||
if (datumCase_ == 3) {
|
||||
output.writeInt32(
|
||||
3, (int)((java.lang.Integer) datum_));
|
||||
}
|
||||
if (datumCase_ == 4) {
|
||||
output.writeInt64(
|
||||
4, (long)((java.lang.Long) datum_));
|
||||
}
|
||||
if (datumCase_ == 5) {
|
||||
output.writeFloat(
|
||||
5, (float)((java.lang.Float) datum_));
|
||||
}
|
||||
if (datumCase_ == 6) {
|
||||
output.writeDouble(
|
||||
6, (double)((java.lang.Double) datum_));
|
||||
}
|
||||
if (datumCase_ == 7) {
|
||||
output.writeBool(
|
||||
7, (boolean)((java.lang.Boolean) datum_));
|
||||
}
|
||||
if (datumCase_ == 8) {
|
||||
output.writeBytes(8, getDatumStringBytes());
|
||||
}
|
||||
if (datumCase_ == 9) {
|
||||
output.writeBytes(
|
||||
9, (com.google.protobuf.ByteString)((com.google.protobuf.ByteString) datum_));
|
||||
}
|
||||
if (datumCase_ == 10) {
|
||||
output.writeMessage(10, (io.debezium.connector.postgresql.proto.PgProto.Point) datum_);
|
||||
}
|
||||
getUnknownFields().writeTo(output);
|
||||
}
|
||||
|
||||
private int memoizedSerializedSize = -1;
|
||||
public int getSerializedSize() {
|
||||
int size = memoizedSerializedSize;
|
||||
if (size != -1) return size;
|
||||
|
||||
size = 0;
|
||||
if (((bitField0_ & 0x00000001) == 0x00000001)) {
|
||||
size += com.google.protobuf.CodedOutputStream
|
||||
.computeBytesSize(1, getColumnNameBytes());
|
||||
}
|
||||
if (((bitField0_ & 0x00000002) == 0x00000002)) {
|
||||
size += com.google.protobuf.CodedOutputStream
|
||||
.computeInt64Size(2, columnType_);
|
||||
}
|
||||
if (datumCase_ == 3) {
|
||||
size += com.google.protobuf.CodedOutputStream
|
||||
.computeInt32Size(
|
||||
3, (int)((java.lang.Integer) datum_));
|
||||
}
|
||||
if (datumCase_ == 4) {
|
||||
size += com.google.protobuf.CodedOutputStream
|
||||
.computeInt64Size(
|
||||
4, (long)((java.lang.Long) datum_));
|
||||
}
|
||||
if (datumCase_ == 5) {
|
||||
size += com.google.protobuf.CodedOutputStream
|
||||
.computeFloatSize(
|
||||
5, (float)((java.lang.Float) datum_));
|
||||
}
|
||||
if (datumCase_ == 6) {
|
||||
size += com.google.protobuf.CodedOutputStream
|
||||
.computeDoubleSize(
|
||||
6, (double)((java.lang.Double) datum_));
|
||||
}
|
||||
if (datumCase_ == 7) {
|
||||
size += com.google.protobuf.CodedOutputStream
|
||||
.computeBoolSize(
|
||||
7, (boolean)((java.lang.Boolean) datum_));
|
||||
}
|
||||
if (datumCase_ == 8) {
|
||||
size += com.google.protobuf.CodedOutputStream
|
||||
.computeBytesSize(8, getDatumStringBytes());
|
||||
}
|
||||
if (datumCase_ == 9) {
|
||||
size += com.google.protobuf.CodedOutputStream
|
||||
.computeBytesSize(
|
||||
9, (com.google.protobuf.ByteString)((com.google.protobuf.ByteString) datum_));
|
||||
}
|
||||
if (datumCase_ == 10) {
|
||||
size += com.google.protobuf.CodedOutputStream
|
||||
.computeMessageSize(10, (io.debezium.connector.postgresql.proto.PgProto.Point) datum_);
|
||||
}
|
||||
size += getUnknownFields().getSerializedSize();
|
||||
memoizedSerializedSize = size;
|
||||
return size;
|
||||
}
|
||||
|
||||
private static final long serialVersionUID = 0L;
|
||||
@java.lang.Override
|
||||
protected java.lang.Object writeReplace()
|
||||
throws java.io.ObjectStreamException {
|
||||
return super.writeReplace();
|
||||
}
|
||||
|
||||
public static io.debezium.connector.postgresql.proto.PgProto.DatumMessage parseFrom(
|
||||
com.google.protobuf.ByteString data)
|
||||
throws com.google.protobuf.InvalidProtocolBufferException {
|
||||
return PARSER.parseFrom(data);
|
||||
}
|
||||
public static io.debezium.connector.postgresql.proto.PgProto.DatumMessage parseFrom(
|
||||
com.google.protobuf.ByteString data,
|
||||
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||
throws com.google.protobuf.InvalidProtocolBufferException {
|
||||
return PARSER.parseFrom(data, extensionRegistry);
|
||||
}
|
||||
public static io.debezium.connector.postgresql.proto.PgProto.DatumMessage parseFrom(byte[] data)
|
||||
throws com.google.protobuf.InvalidProtocolBufferException {
|
||||
return PARSER.parseFrom(data);
|
||||
}
|
||||
public static io.debezium.connector.postgresql.proto.PgProto.DatumMessage parseFrom(
|
||||
byte[] data,
|
||||
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||
throws com.google.protobuf.InvalidProtocolBufferException {
|
||||
return PARSER.parseFrom(data, extensionRegistry);
|
||||
}
|
||||
public static io.debezium.connector.postgresql.proto.PgProto.DatumMessage parseFrom(java.io.InputStream input)
|
||||
throws java.io.IOException {
|
||||
return PARSER.parseFrom(input);
|
||||
}
|
||||
public static io.debezium.connector.postgresql.proto.PgProto.DatumMessage parseFrom(
|
||||
java.io.InputStream input,
|
||||
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||
throws java.io.IOException {
|
||||
return PARSER.parseFrom(input, extensionRegistry);
|
||||
}
|
||||
public static io.debezium.connector.postgresql.proto.PgProto.DatumMessage parseDelimitedFrom(java.io.InputStream input)
|
||||
throws java.io.IOException {
|
||||
return PARSER.parseDelimitedFrom(input);
|
||||
}
|
||||
public static io.debezium.connector.postgresql.proto.PgProto.DatumMessage parseDelimitedFrom(
|
||||
java.io.InputStream input,
|
||||
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||
throws java.io.IOException {
|
||||
return PARSER.parseDelimitedFrom(input, extensionRegistry);
|
||||
}
|
||||
public static io.debezium.connector.postgresql.proto.PgProto.DatumMessage parseFrom(
|
||||
com.google.protobuf.CodedInputStream input)
|
||||
throws java.io.IOException {
|
||||
return PARSER.parseFrom(input);
|
||||
}
|
||||
public static io.debezium.connector.postgresql.proto.PgProto.DatumMessage parseFrom(
|
||||
com.google.protobuf.CodedInputStream input,
|
||||
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||
throws java.io.IOException {
|
||||
return PARSER.parseFrom(input, extensionRegistry);
|
||||
}
|
||||
|
||||
public static Builder newBuilder() { return Builder.create(); }
|
||||
public Builder newBuilderForType() { return newBuilder(); }
|
||||
public static Builder newBuilder(io.debezium.connector.postgresql.proto.PgProto.DatumMessage prototype) {
|
||||
return newBuilder().mergeFrom(prototype);
|
||||
}
|
||||
public Builder toBuilder() { return newBuilder(this); }
|
||||
|
||||
@java.lang.Override
|
||||
protected Builder newBuilderForType(
|
||||
com.google.protobuf.GeneratedMessage.BuilderParent parent) {
|
||||
Builder builder = new Builder(parent);
|
||||
return builder;
|
||||
}
|
||||
/**
|
||||
* Protobuf type {@code decoderbufs.DatumMessage}
|
||||
*/
|
||||
public static final class Builder extends
|
||||
com.google.protobuf.GeneratedMessage.Builder<Builder> implements
|
||||
// @@protoc_insertion_point(builder_implements:decoderbufs.DatumMessage)
|
||||
io.debezium.connector.postgresql.proto.PgProto.DatumMessageOrBuilder {
|
||||
public static final com.google.protobuf.Descriptors.Descriptor
|
||||
getDescriptor() {
|
||||
return io.debezium.connector.postgresql.proto.PgProto.internal_static_decoderbufs_DatumMessage_descriptor;
|
||||
}
|
||||
|
||||
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
|
||||
internalGetFieldAccessorTable() {
|
||||
return io.debezium.connector.postgresql.proto.PgProto.internal_static_decoderbufs_DatumMessage_fieldAccessorTable
|
||||
.ensureFieldAccessorsInitialized(
|
||||
io.debezium.connector.postgresql.proto.PgProto.DatumMessage.class, io.debezium.connector.postgresql.proto.PgProto.DatumMessage.Builder.class);
|
||||
}
|
||||
|
||||
// Construct using io.debezium.connector.postgresql.proto.PgProto.DatumMessage.newBuilder()
|
||||
private Builder() {
|
||||
maybeForceBuilderInitialization();
|
||||
}
|
||||
|
||||
private Builder(
|
||||
com.google.protobuf.GeneratedMessage.BuilderParent parent) {
|
||||
super(parent);
|
||||
maybeForceBuilderInitialization();
|
||||
}
|
||||
private void maybeForceBuilderInitialization() {
|
||||
if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
|
||||
}
|
||||
}
|
||||
private static Builder create() {
|
||||
return new Builder();
|
||||
}
|
||||
|
||||
public Builder clear() {
|
||||
super.clear();
|
||||
columnName_ = "";
|
||||
bitField0_ = (bitField0_ & ~0x00000001);
|
||||
columnType_ = 0L;
|
||||
bitField0_ = (bitField0_ & ~0x00000002);
|
||||
datumCase_ = 0;
|
||||
datum_ = null;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder clone() {
|
||||
return create().mergeFrom(buildPartial());
|
||||
}
|
||||
|
||||
public com.google.protobuf.Descriptors.Descriptor
|
||||
getDescriptorForType() {
|
||||
return io.debezium.connector.postgresql.proto.PgProto.internal_static_decoderbufs_DatumMessage_descriptor;
|
||||
}
|
||||
|
||||
public io.debezium.connector.postgresql.proto.PgProto.DatumMessage getDefaultInstanceForType() {
|
||||
return io.debezium.connector.postgresql.proto.PgProto.DatumMessage.getDefaultInstance();
|
||||
}
|
||||
|
||||
public io.debezium.connector.postgresql.proto.PgProto.DatumMessage build() {
|
||||
io.debezium.connector.postgresql.proto.PgProto.DatumMessage result = buildPartial();
|
||||
if (!result.isInitialized()) {
|
||||
throw newUninitializedMessageException(result);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public io.debezium.connector.postgresql.proto.PgProto.DatumMessage buildPartial() {
|
||||
io.debezium.connector.postgresql.proto.PgProto.DatumMessage result = new io.debezium.connector.postgresql.proto.PgProto.DatumMessage(this);
|
||||
int from_bitField0_ = bitField0_;
|
||||
int to_bitField0_ = 0;
|
||||
if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
|
||||
to_bitField0_ |= 0x00000001;
|
||||
}
|
||||
result.columnName_ = columnName_;
|
||||
if (((from_bitField0_ & 0x00000002) == 0x00000002)) {
|
||||
to_bitField0_ |= 0x00000002;
|
||||
}
|
||||
result.columnType_ = columnType_;
|
||||
if (datumCase_ == 3) {
|
||||
result.datum_ = datum_;
|
||||
}
|
||||
if (datumCase_ == 4) {
|
||||
result.datum_ = datum_;
|
||||
}
|
||||
if (datumCase_ == 5) {
|
||||
result.datum_ = datum_;
|
||||
}
|
||||
if (datumCase_ == 6) {
|
||||
result.datum_ = datum_;
|
||||
}
|
||||
if (datumCase_ == 7) {
|
||||
result.datum_ = datum_;
|
||||
}
|
||||
if (datumCase_ == 8) {
|
||||
result.datum_ = datum_;
|
||||
}
|
||||
if (datumCase_ == 9) {
|
||||
result.datum_ = datum_;
|
||||
}
|
||||
if (datumCase_ == 10) {
|
||||
if (datumPointBuilder_ == null) {
|
||||
result.datum_ = datum_;
|
||||
} else {
|
||||
result.datum_ = datumPointBuilder_.build();
|
||||
}
|
||||
}
|
||||
result.bitField0_ = to_bitField0_;
|
||||
result.datumCase_ = datumCase_;
|
||||
onBuilt();
|
||||
return result;
|
||||
}
|
||||
|
||||
public Builder mergeFrom(com.google.protobuf.Message other) {
|
||||
if (other instanceof io.debezium.connector.postgresql.proto.PgProto.DatumMessage) {
|
||||
return mergeFrom((io.debezium.connector.postgresql.proto.PgProto.DatumMessage)other);
|
||||
} else {
|
||||
super.mergeFrom(other);
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
public Builder mergeFrom(io.debezium.connector.postgresql.proto.PgProto.DatumMessage other) {
|
||||
if (other == io.debezium.connector.postgresql.proto.PgProto.DatumMessage.getDefaultInstance()) return this;
|
||||
if (other.hasColumnName()) {
|
||||
bitField0_ |= 0x00000001;
|
||||
columnName_ = other.columnName_;
|
||||
onChanged();
|
||||
}
|
||||
if (other.hasColumnType()) {
|
||||
setColumnType(other.getColumnType());
|
||||
}
|
||||
switch (other.getDatumCase()) {
|
||||
case DATUM_INT32: {
|
||||
setDatumInt32(other.getDatumInt32());
|
||||
break;
|
||||
}
|
||||
case DATUM_INT64: {
|
||||
setDatumInt64(other.getDatumInt64());
|
||||
break;
|
||||
}
|
||||
case DATUM_FLOAT: {
|
||||
setDatumFloat(other.getDatumFloat());
|
||||
break;
|
||||
}
|
||||
case DATUM_DOUBLE: {
|
||||
setDatumDouble(other.getDatumDouble());
|
||||
break;
|
||||
}
|
||||
case DATUM_BOOL: {
|
||||
setDatumBool(other.getDatumBool());
|
||||
break;
|
||||
}
|
||||
case DATUM_STRING: {
|
||||
datumCase_ = 8;
|
||||
datum_ = other.datum_;
|
||||
onChanged();
|
||||
break;
|
||||
}
|
||||
case DATUM_BYTES: {
|
||||
setDatumBytes(other.getDatumBytes());
|
||||
break;
|
||||
}
|
||||
case DATUM_POINT: {
|
||||
mergeDatumPoint(other.getDatumPoint());
|
||||
break;
|
||||
}
|
||||
case DATUM_NOT_SET: {
|
||||
break;
|
||||
}
|
||||
}
|
||||
this.mergeUnknownFields(other.getUnknownFields());
|
||||
return this;
|
||||
}
|
||||
|
||||
public final boolean isInitialized() {
|
||||
if (hasDatumPoint()) {
|
||||
if (!getDatumPoint().isInitialized()) {
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public Builder mergeFrom(
|
||||
com.google.protobuf.CodedInputStream input,
|
||||
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||
throws java.io.IOException {
|
||||
io.debezium.connector.postgresql.proto.PgProto.DatumMessage parsedMessage = null;
|
||||
try {
|
||||
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
|
||||
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
|
||||
parsedMessage = (io.debezium.connector.postgresql.proto.PgProto.DatumMessage) e.getUnfinishedMessage();
|
||||
throw e;
|
||||
} finally {
|
||||
if (parsedMessage != null) {
|
||||
mergeFrom(parsedMessage);
|
||||
}
|
||||
}
|
||||
return this;
|
||||
}
|
||||
private int datumCase_ = 0;
|
||||
private java.lang.Object datum_;
|
||||
public DatumCase
|
||||
getDatumCase() {
|
||||
return DatumCase.valueOf(
|
||||
datumCase_);
|
||||
}
|
||||
|
||||
public Builder clearDatum() {
|
||||
datumCase_ = 0;
|
||||
datum_ = null;
|
||||
onChanged();
|
||||
return this;
|
||||
}
|
||||
|
||||
private int bitField0_;
|
||||
|
||||
private java.lang.Object columnName_ = "";
|
||||
/**
|
||||
* <code>optional string column_name = 1;</code>
|
||||
*/
|
||||
public boolean hasColumnName() {
|
||||
return ((bitField0_ & 0x00000001) == 0x00000001);
|
||||
}
|
||||
/**
|
||||
* <code>optional string column_name = 1;</code>
|
||||
*/
|
||||
public java.lang.String getColumnName() {
|
||||
java.lang.Object ref = columnName_;
|
||||
if (!(ref instanceof java.lang.String)) {
|
||||
com.google.protobuf.ByteString bs =
|
||||
(com.google.protobuf.ByteString) ref;
|
||||
java.lang.String s = bs.toStringUtf8();
|
||||
if (bs.isValidUtf8()) {
|
||||
columnName_ = s;
|
||||
}
|
||||
return s;
|
||||
} else {
|
||||
return (java.lang.String) ref;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* <code>optional string column_name = 1;</code>
|
||||
*/
|
||||
public com.google.protobuf.ByteString
|
||||
getColumnNameBytes() {
|
||||
java.lang.Object ref = columnName_;
|
||||
if (ref instanceof String) {
|
||||
com.google.protobuf.ByteString b =
|
||||
com.google.protobuf.ByteString.copyFromUtf8(
|
||||
(java.lang.String) ref);
|
||||
columnName_ = b;
|
||||
return b;
|
||||
} else {
|
||||
return (com.google.protobuf.ByteString) ref;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* <code>optional string column_name = 1;</code>
|
||||
*/
|
||||
public Builder setColumnName(
|
||||
java.lang.String value) {
|
||||
if (value == null) {
|
||||
throw new NullPointerException();
|
||||
}
|
||||
bitField0_ |= 0x00000001;
|
||||
columnName_ = value;
|
||||
onChanged();
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* <code>optional string column_name = 1;</code>
|
||||
*/
|
||||
public Builder clearColumnName() {
|
||||
bitField0_ = (bitField0_ & ~0x00000001);
|
||||
columnName_ = getDefaultInstance().getColumnName();
|
||||
onChanged();
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* <code>optional string column_name = 1;</code>
|
||||
*/
|
||||
public Builder setColumnNameBytes(
|
||||
com.google.protobuf.ByteString value) {
|
||||
if (value == null) {
|
||||
throw new NullPointerException();
|
||||
}
|
||||
bitField0_ |= 0x00000001;
|
||||
columnName_ = value;
|
||||
onChanged();
|
||||
return this;
|
||||
}
|
||||
|
||||
private long columnType_ ;
|
||||
/**
|
||||
* <code>optional int64 column_type = 2;</code>
|
||||
*/
|
||||
public boolean hasColumnType() {
|
||||
return ((bitField0_ & 0x00000002) == 0x00000002);
|
||||
}
|
||||
/**
|
||||
* <code>optional int64 column_type = 2;</code>
|
||||
*/
|
||||
public long getColumnType() {
|
||||
return columnType_;
|
||||
}
|
||||
/**
|
||||
* <code>optional int64 column_type = 2;</code>
|
||||
*/
|
||||
public Builder setColumnType(long value) {
|
||||
bitField0_ |= 0x00000002;
|
||||
columnType_ = value;
|
||||
onChanged();
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* <code>optional int64 column_type = 2;</code>
|
||||
*/
|
||||
public Builder clearColumnType() {
|
||||
bitField0_ = (bitField0_ & ~0x00000002);
|
||||
columnType_ = 0L;
|
||||
onChanged();
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* <code>optional int32 datum_int32 = 3;</code>
|
||||
*/
|
||||
public boolean hasDatumInt32() {
|
||||
return datumCase_ == 3;
|
||||
}
|
||||
/**
|
||||
* <code>optional int32 datum_int32 = 3;</code>
|
||||
*/
|
||||
public int getDatumInt32() {
|
||||
if (datumCase_ == 3) {
|
||||
return (java.lang.Integer) datum_;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
/**
|
||||
* <code>optional int32 datum_int32 = 3;</code>
|
||||
*/
|
||||
public Builder setDatumInt32(int value) {
|
||||
datumCase_ = 3;
|
||||
datum_ = value;
|
||||
onChanged();
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* <code>optional int32 datum_int32 = 3;</code>
|
||||
*/
|
||||
public Builder clearDatumInt32() {
|
||||
if (datumCase_ == 3) {
|
||||
datumCase_ = 0;
|
||||
datum_ = null;
|
||||
onChanged();
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* <code>optional int64 datum_int64 = 4;</code>
|
||||
*/
|
||||
public boolean hasDatumInt64() {
|
||||
return datumCase_ == 4;
|
||||
}
|
||||
/**
|
||||
* <code>optional int64 datum_int64 = 4;</code>
|
||||
*/
|
||||
public long getDatumInt64() {
|
||||
if (datumCase_ == 4) {
|
||||
return (java.lang.Long) datum_;
|
||||
}
|
||||
return 0L;
|
||||
}
|
||||
/**
|
||||
* <code>optional int64 datum_int64 = 4;</code>
|
||||
*/
|
||||
public Builder setDatumInt64(long value) {
|
||||
datumCase_ = 4;
|
||||
datum_ = value;
|
||||
onChanged();
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* <code>optional int64 datum_int64 = 4;</code>
|
||||
*/
|
||||
public Builder clearDatumInt64() {
|
||||
if (datumCase_ == 4) {
|
||||
datumCase_ = 0;
|
||||
datum_ = null;
|
||||
onChanged();
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* <code>optional float datum_float = 5;</code>
|
||||
*/
|
||||
public boolean hasDatumFloat() {
|
||||
return datumCase_ == 5;
|
||||
}
|
||||
/**
|
||||
* <code>optional float datum_float = 5;</code>
|
||||
*/
|
||||
public float getDatumFloat() {
|
||||
if (datumCase_ == 5) {
|
||||
return (java.lang.Float) datum_;
|
||||
}
|
||||
return 0F;
|
||||
}
|
||||
/**
|
||||
* <code>optional float datum_float = 5;</code>
|
||||
*/
|
||||
public Builder setDatumFloat(float value) {
|
||||
datumCase_ = 5;
|
||||
datum_ = value;
|
||||
onChanged();
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* <code>optional float datum_float = 5;</code>
|
||||
*/
|
||||
public Builder clearDatumFloat() {
|
||||
if (datumCase_ == 5) {
|
||||
datumCase_ = 0;
|
||||
datum_ = null;
|
||||
onChanged();
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* <code>optional double datum_double = 6;</code>
|
||||
*/
|
||||
public boolean hasDatumDouble() {
|
||||
return datumCase_ == 6;
|
||||
}
|
||||
/**
|
||||
* <code>optional double datum_double = 6;</code>
|
||||
*/
|
||||
public double getDatumDouble() {
|
||||
if (datumCase_ == 6) {
|
||||
return (java.lang.Double) datum_;
|
||||
}
|
||||
return 0D;
|
||||
}
|
||||
/**
|
||||
* <code>optional double datum_double = 6;</code>
|
||||
*/
|
||||
public Builder setDatumDouble(double value) {
|
||||
datumCase_ = 6;
|
||||
datum_ = value;
|
||||
onChanged();
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* <code>optional double datum_double = 6;</code>
|
||||
*/
|
||||
public Builder clearDatumDouble() {
|
||||
if (datumCase_ == 6) {
|
||||
datumCase_ = 0;
|
||||
datum_ = null;
|
||||
onChanged();
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* <code>optional bool datum_bool = 7;</code>
|
||||
*/
|
||||
public boolean hasDatumBool() {
|
||||
return datumCase_ == 7;
|
||||
}
|
||||
/**
|
||||
* <code>optional bool datum_bool = 7;</code>
|
||||
*/
|
||||
public boolean getDatumBool() {
|
||||
if (datumCase_ == 7) {
|
||||
return (java.lang.Boolean) datum_;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
/**
|
||||
* <code>optional bool datum_bool = 7;</code>
|
||||
*/
|
||||
public Builder setDatumBool(boolean value) {
|
||||
datumCase_ = 7;
|
||||
datum_ = value;
|
||||
onChanged();
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* <code>optional bool datum_bool = 7;</code>
|
||||
*/
|
||||
public Builder clearDatumBool() {
|
||||
if (datumCase_ == 7) {
|
||||
datumCase_ = 0;
|
||||
datum_ = null;
|
||||
onChanged();
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* <code>optional string datum_string = 8;</code>
|
||||
*/
|
||||
public boolean hasDatumString() {
|
||||
return datumCase_ == 8;
|
||||
}
|
||||
/**
|
||||
* <code>optional string datum_string = 8;</code>
|
||||
*/
|
||||
public java.lang.String getDatumString() {
|
||||
java.lang.Object ref = "";
|
||||
if (datumCase_ == 8) {
|
||||
ref = datum_;
|
||||
}
|
||||
if (!(ref instanceof java.lang.String)) {
|
||||
com.google.protobuf.ByteString bs =
|
||||
(com.google.protobuf.ByteString) ref;
|
||||
java.lang.String s = bs.toStringUtf8();
|
||||
if (datumCase_ == 8) {
|
||||
if (bs.isValidUtf8()) {
|
||||
datum_ = s;
|
||||
}
|
||||
}
|
||||
return s;
|
||||
} else {
|
||||
return (java.lang.String) ref;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* <code>optional string datum_string = 8;</code>
|
||||
*/
|
||||
public com.google.protobuf.ByteString
|
||||
getDatumStringBytes() {
|
||||
java.lang.Object ref = "";
|
||||
if (datumCase_ == 8) {
|
||||
ref = datum_;
|
||||
}
|
||||
if (ref instanceof String) {
|
||||
com.google.protobuf.ByteString b =
|
||||
com.google.protobuf.ByteString.copyFromUtf8(
|
||||
(java.lang.String) ref);
|
||||
if (datumCase_ == 8) {
|
||||
datum_ = b;
|
||||
}
|
||||
return b;
|
||||
} else {
|
||||
return (com.google.protobuf.ByteString) ref;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* <code>optional string datum_string = 8;</code>
|
||||
*/
|
||||
public Builder setDatumString(
|
||||
java.lang.String value) {
|
||||
if (value == null) {
|
||||
throw new NullPointerException();
|
||||
}
|
||||
datumCase_ = 8;
|
||||
datum_ = value;
|
||||
onChanged();
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* <code>optional string datum_string = 8;</code>
|
||||
*/
|
||||
public Builder clearDatumString() {
|
||||
if (datumCase_ == 8) {
|
||||
datumCase_ = 0;
|
||||
datum_ = null;
|
||||
onChanged();
|
||||
}
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* <code>optional string datum_string = 8;</code>
|
||||
*/
|
||||
public Builder setDatumStringBytes(
|
||||
com.google.protobuf.ByteString value) {
|
||||
if (value == null) {
|
||||
throw new NullPointerException();
|
||||
}
|
||||
datumCase_ = 8;
|
||||
datum_ = value;
|
||||
onChanged();
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* <code>optional bytes datum_bytes = 9;</code>
|
||||
*/
|
||||
public boolean hasDatumBytes() {
|
||||
return datumCase_ == 9;
|
||||
}
|
||||
/**
|
||||
* <code>optional bytes datum_bytes = 9;</code>
|
||||
*/
|
||||
public com.google.protobuf.ByteString getDatumBytes() {
|
||||
if (datumCase_ == 9) {
|
||||
return (com.google.protobuf.ByteString) datum_;
|
||||
}
|
||||
return com.google.protobuf.ByteString.EMPTY;
|
||||
}
|
||||
/**
|
||||
* <code>optional bytes datum_bytes = 9;</code>
|
||||
*/
|
||||
public Builder setDatumBytes(com.google.protobuf.ByteString value) {
|
||||
if (value == null) {
|
||||
throw new NullPointerException();
|
||||
}
|
||||
datumCase_ = 9;
|
||||
datum_ = value;
|
||||
onChanged();
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* <code>optional bytes datum_bytes = 9;</code>
|
||||
*/
|
||||
public Builder clearDatumBytes() {
|
||||
if (datumCase_ == 9) {
|
||||
datumCase_ = 0;
|
||||
datum_ = null;
|
||||
onChanged();
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
private com.google.protobuf.SingleFieldBuilder<
|
||||
io.debezium.connector.postgresql.proto.PgProto.Point, io.debezium.connector.postgresql.proto.PgProto.Point.Builder, io.debezium.connector.postgresql.proto.PgProto.PointOrBuilder> datumPointBuilder_;
|
||||
/**
|
||||
* <code>optional .decoderbufs.Point datum_point = 10;</code>
|
||||
*/
|
||||
public boolean hasDatumPoint() {
|
||||
return datumCase_ == 10;
|
||||
}
|
||||
/**
|
||||
* <code>optional .decoderbufs.Point datum_point = 10;</code>
|
||||
*/
|
||||
public io.debezium.connector.postgresql.proto.PgProto.Point getDatumPoint() {
|
||||
if (datumPointBuilder_ == null) {
|
||||
if (datumCase_ == 10) {
|
||||
return (io.debezium.connector.postgresql.proto.PgProto.Point) datum_;
|
||||
}
|
||||
return io.debezium.connector.postgresql.proto.PgProto.Point.getDefaultInstance();
|
||||
} else {
|
||||
if (datumCase_ == 10) {
|
||||
return datumPointBuilder_.getMessage();
|
||||
}
|
||||
return io.debezium.connector.postgresql.proto.PgProto.Point.getDefaultInstance();
|
||||
}
|
||||
}
|
||||
/**
|
||||
* <code>optional .decoderbufs.Point datum_point = 10;</code>
|
||||
*/
|
||||
public Builder setDatumPoint(io.debezium.connector.postgresql.proto.PgProto.Point value) {
|
||||
if (datumPointBuilder_ == null) {
|
||||
if (value == null) {
|
||||
throw new NullPointerException();
|
||||
}
|
||||
datum_ = value;
|
||||
onChanged();
|
||||
} else {
|
||||
datumPointBuilder_.setMessage(value);
|
||||
}
|
||||
datumCase_ = 10;
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* <code>optional .decoderbufs.Point datum_point = 10;</code>
|
||||
*/
|
||||
public Builder setDatumPoint(
|
||||
io.debezium.connector.postgresql.proto.PgProto.Point.Builder builderForValue) {
|
||||
if (datumPointBuilder_ == null) {
|
||||
datum_ = builderForValue.build();
|
||||
onChanged();
|
||||
} else {
|
||||
datumPointBuilder_.setMessage(builderForValue.build());
|
||||
}
|
||||
datumCase_ = 10;
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* <code>optional .decoderbufs.Point datum_point = 10;</code>
|
||||
*/
|
||||
public Builder mergeDatumPoint(io.debezium.connector.postgresql.proto.PgProto.Point value) {
|
||||
if (datumPointBuilder_ == null) {
|
||||
if (datumCase_ == 10 &&
|
||||
datum_ != io.debezium.connector.postgresql.proto.PgProto.Point.getDefaultInstance()) {
|
||||
datum_ = io.debezium.connector.postgresql.proto.PgProto.Point.newBuilder((io.debezium.connector.postgresql.proto.PgProto.Point) datum_)
|
||||
.mergeFrom(value).buildPartial();
|
||||
} else {
|
||||
datum_ = value;
|
||||
}
|
||||
onChanged();
|
||||
} else {
|
||||
if (datumCase_ == 10) {
|
||||
datumPointBuilder_.mergeFrom(value);
|
||||
}
|
||||
datumPointBuilder_.setMessage(value);
|
||||
}
|
||||
datumCase_ = 10;
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* <code>optional .decoderbufs.Point datum_point = 10;</code>
|
||||
*/
|
||||
public Builder clearDatumPoint() {
|
||||
if (datumPointBuilder_ == null) {
|
||||
if (datumCase_ == 10) {
|
||||
datumCase_ = 0;
|
||||
datum_ = null;
|
||||
onChanged();
|
||||
}
|
||||
} else {
|
||||
if (datumCase_ == 10) {
|
||||
datumCase_ = 0;
|
||||
datum_ = null;
|
||||
}
|
||||
datumPointBuilder_.clear();
|
||||
}
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* <code>optional .decoderbufs.Point datum_point = 10;</code>
|
||||
*/
|
||||
public io.debezium.connector.postgresql.proto.PgProto.Point.Builder getDatumPointBuilder() {
|
||||
return getDatumPointFieldBuilder().getBuilder();
|
||||
}
|
||||
/**
|
||||
* <code>optional .decoderbufs.Point datum_point = 10;</code>
|
||||
*/
|
||||
public io.debezium.connector.postgresql.proto.PgProto.PointOrBuilder getDatumPointOrBuilder() {
|
||||
if ((datumCase_ == 10) && (datumPointBuilder_ != null)) {
|
||||
return datumPointBuilder_.getMessageOrBuilder();
|
||||
} else {
|
||||
if (datumCase_ == 10) {
|
||||
return (io.debezium.connector.postgresql.proto.PgProto.Point) datum_;
|
||||
}
|
||||
return io.debezium.connector.postgresql.proto.PgProto.Point.getDefaultInstance();
|
||||
}
|
||||
}
|
||||
/**
|
||||
* <code>optional .decoderbufs.Point datum_point = 10;</code>
|
||||
*/
|
||||
private com.google.protobuf.SingleFieldBuilder<
|
||||
io.debezium.connector.postgresql.proto.PgProto.Point, io.debezium.connector.postgresql.proto.PgProto.Point.Builder, io.debezium.connector.postgresql.proto.PgProto.PointOrBuilder>
|
||||
getDatumPointFieldBuilder() {
|
||||
if (datumPointBuilder_ == null) {
|
||||
if (!(datumCase_ == 10)) {
|
||||
datum_ = io.debezium.connector.postgresql.proto.PgProto.Point.getDefaultInstance();
|
||||
}
|
||||
datumPointBuilder_ = new com.google.protobuf.SingleFieldBuilder<
|
||||
io.debezium.connector.postgresql.proto.PgProto.Point, io.debezium.connector.postgresql.proto.PgProto.Point.Builder, io.debezium.connector.postgresql.proto.PgProto.PointOrBuilder>(
|
||||
(io.debezium.connector.postgresql.proto.PgProto.Point) datum_,
|
||||
getParentForChildren(),
|
||||
isClean());
|
||||
datum_ = null;
|
||||
}
|
||||
datumCase_ = 10;
|
||||
return datumPointBuilder_;
|
||||
}
|
||||
|
||||
// @@protoc_insertion_point(builder_scope:decoderbufs.DatumMessage)
|
||||
}
|
||||
|
||||
static {
|
||||
defaultInstance = new DatumMessage(true);
|
||||
defaultInstance.initFields();
|
||||
}
|
||||
|
||||
// @@protoc_insertion_point(class_scope:decoderbufs.DatumMessage)
|
||||
}
|
||||
|
||||
public interface RowMessageOrBuilder extends
|
||||
// @@protoc_insertion_point(interface_extends:decoderbufs.RowMessage)
|
||||
com.google.protobuf.MessageOrBuilder {
|
||||
|
||||
/**
|
||||
* <code>optional uint32 transaction_id = 1;</code>
|
||||
*/
|
||||
boolean hasTransactionId();
|
||||
/**
|
||||
* <code>optional uint32 transaction_id = 1;</code>
|
||||
*/
|
||||
int getTransactionId();
|
||||
|
||||
/**
|
||||
* <code>optional uint64 commit_time = 2;</code>
|
||||
*/
|
||||
boolean hasCommitTime();
|
||||
/**
|
||||
* <code>optional uint64 commit_time = 2;</code>
|
||||
*/
|
||||
long getCommitTime();
|
||||
|
||||
/**
|
||||
* <code>optional string table = 3;</code>
|
||||
*/
|
||||
boolean hasTable();
|
||||
/**
|
||||
* <code>optional string table = 3;</code>
|
||||
*/
|
||||
java.lang.String getTable();
|
||||
/**
|
||||
* <code>optional string table = 3;</code>
|
||||
*/
|
||||
com.google.protobuf.ByteString
|
||||
getTableBytes();
|
||||
|
||||
/**
|
||||
* <code>optional .decoderbufs.Op op = 4;</code>
|
||||
*/
|
||||
boolean hasOp();
|
||||
/**
|
||||
* <code>optional .decoderbufs.Op op = 4;</code>
|
||||
*/
|
||||
io.debezium.connector.postgresql.proto.PgProto.Op getOp();
|
||||
|
||||
/**
|
||||
* <code>repeated .decoderbufs.DatumMessage new_tuple = 5;</code>
|
||||
*/
|
||||
java.util.List<io.debezium.connector.postgresql.proto.PgProto.DatumMessage>
|
||||
getNewTupleList();
|
||||
/**
|
||||
* <code>repeated .decoderbufs.DatumMessage new_tuple = 5;</code>
|
||||
*/
|
||||
io.debezium.connector.postgresql.proto.PgProto.DatumMessage getNewTuple(int index);
|
||||
/**
|
||||
* <code>repeated .decoderbufs.DatumMessage new_tuple = 5;</code>
|
||||
*/
|
||||
int getNewTupleCount();
|
||||
/**
|
||||
* <code>repeated .decoderbufs.DatumMessage new_tuple = 5;</code>
|
||||
*/
|
||||
java.util.List<? extends io.debezium.connector.postgresql.proto.PgProto.DatumMessageOrBuilder>
|
||||
getNewTupleOrBuilderList();
|
||||
/**
|
||||
* <code>repeated .decoderbufs.DatumMessage new_tuple = 5;</code>
|
||||
*/
|
||||
io.debezium.connector.postgresql.proto.PgProto.DatumMessageOrBuilder getNewTupleOrBuilder(
|
||||
int index);
|
||||
|
||||
/**
|
||||
* <code>repeated .decoderbufs.DatumMessage old_tuple = 6;</code>
|
||||
*/
|
||||
java.util.List<io.debezium.connector.postgresql.proto.PgProto.DatumMessage>
|
||||
getOldTupleList();
|
||||
/**
|
||||
* <code>repeated .decoderbufs.DatumMessage old_tuple = 6;</code>
|
||||
*/
|
||||
io.debezium.connector.postgresql.proto.PgProto.DatumMessage getOldTuple(int index);
|
||||
/**
|
||||
* <code>repeated .decoderbufs.DatumMessage old_tuple = 6;</code>
|
||||
*/
|
||||
int getOldTupleCount();
|
||||
/**
|
||||
* <code>repeated .decoderbufs.DatumMessage old_tuple = 6;</code>
|
||||
*/
|
||||
java.util.List<? extends io.debezium.connector.postgresql.proto.PgProto.DatumMessageOrBuilder>
|
||||
getOldTupleOrBuilderList();
|
||||
/**
|
||||
* <code>repeated .decoderbufs.DatumMessage old_tuple = 6;</code>
|
||||
*/
|
||||
io.debezium.connector.postgresql.proto.PgProto.DatumMessageOrBuilder getOldTupleOrBuilder(
|
||||
int index);
|
||||
}
|
||||
/**
|
||||
* Protobuf type {@code decoderbufs.RowMessage}
|
||||
*/
|
||||
public static final class RowMessage extends
|
||||
com.google.protobuf.GeneratedMessage implements
|
||||
// @@protoc_insertion_point(message_implements:decoderbufs.RowMessage)
|
||||
RowMessageOrBuilder {
|
||||
// Use RowMessage.newBuilder() to construct.
|
||||
private RowMessage(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
|
||||
super(builder);
|
||||
this.unknownFields = builder.getUnknownFields();
|
||||
}
|
||||
private RowMessage(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }
|
||||
|
||||
private static final RowMessage defaultInstance;
|
||||
public static RowMessage getDefaultInstance() {
|
||||
return defaultInstance;
|
||||
}
|
||||
|
||||
public RowMessage getDefaultInstanceForType() {
|
||||
return defaultInstance;
|
||||
}
|
||||
|
||||
private final com.google.protobuf.UnknownFieldSet unknownFields;
|
||||
@java.lang.Override
|
||||
public final com.google.protobuf.UnknownFieldSet
|
||||
getUnknownFields() {
|
||||
return this.unknownFields;
|
||||
}
|
||||
private RowMessage(
|
||||
com.google.protobuf.CodedInputStream input,
|
||||
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||
throws com.google.protobuf.InvalidProtocolBufferException {
|
||||
initFields();
|
||||
int mutable_bitField0_ = 0;
|
||||
com.google.protobuf.UnknownFieldSet.Builder unknownFields =
|
||||
com.google.protobuf.UnknownFieldSet.newBuilder();
|
||||
try {
|
||||
boolean done = false;
|
||||
while (!done) {
|
||||
int tag = input.readTag();
|
||||
switch (tag) {
|
||||
case 0:
|
||||
done = true;
|
||||
break;
|
||||
default: {
|
||||
if (!parseUnknownField(input, unknownFields,
|
||||
extensionRegistry, tag)) {
|
||||
done = true;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 8: {
|
||||
bitField0_ |= 0x00000001;
|
||||
transactionId_ = input.readUInt32();
|
||||
break;
|
||||
}
|
||||
case 16: {
|
||||
bitField0_ |= 0x00000002;
|
||||
commitTime_ = input.readUInt64();
|
||||
break;
|
||||
}
|
||||
case 26: {
|
||||
com.google.protobuf.ByteString bs = input.readBytes();
|
||||
bitField0_ |= 0x00000004;
|
||||
table_ = bs;
|
||||
break;
|
||||
}
|
||||
case 32: {
|
||||
int rawValue = input.readEnum();
|
||||
io.debezium.connector.postgresql.proto.PgProto.Op value = io.debezium.connector.postgresql.proto.PgProto.Op.valueOf(rawValue);
|
||||
if (value == null) {
|
||||
unknownFields.mergeVarintField(4, rawValue);
|
||||
} else {
|
||||
bitField0_ |= 0x00000008;
|
||||
op_ = value;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 42: {
|
||||
if (!((mutable_bitField0_ & 0x00000010) == 0x00000010)) {
|
||||
newTuple_ = new java.util.ArrayList<io.debezium.connector.postgresql.proto.PgProto.DatumMessage>();
|
||||
mutable_bitField0_ |= 0x00000010;
|
||||
}
|
||||
newTuple_.add(input.readMessage(io.debezium.connector.postgresql.proto.PgProto.DatumMessage.PARSER, extensionRegistry));
|
||||
break;
|
||||
}
|
||||
case 50: {
|
||||
if (!((mutable_bitField0_ & 0x00000020) == 0x00000020)) {
|
||||
oldTuple_ = new java.util.ArrayList<io.debezium.connector.postgresql.proto.PgProto.DatumMessage>();
|
||||
mutable_bitField0_ |= 0x00000020;
|
||||
}
|
||||
oldTuple_.add(input.readMessage(io.debezium.connector.postgresql.proto.PgProto.DatumMessage.PARSER, extensionRegistry));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
|
||||
throw e.setUnfinishedMessage(this);
|
||||
} catch (java.io.IOException e) {
|
||||
throw new com.google.protobuf.InvalidProtocolBufferException(
|
||||
e.getMessage()).setUnfinishedMessage(this);
|
||||
} finally {
|
||||
if (((mutable_bitField0_ & 0x00000010) == 0x00000010)) {
|
||||
newTuple_ = java.util.Collections.unmodifiableList(newTuple_);
|
||||
}
|
||||
if (((mutable_bitField0_ & 0x00000020) == 0x00000020)) {
|
||||
oldTuple_ = java.util.Collections.unmodifiableList(oldTuple_);
|
||||
}
|
||||
this.unknownFields = unknownFields.build();
|
||||
makeExtensionsImmutable();
|
||||
}
|
||||
}
|
||||
public static final com.google.protobuf.Descriptors.Descriptor
|
||||
getDescriptor() {
|
||||
return io.debezium.connector.postgresql.proto.PgProto.internal_static_decoderbufs_RowMessage_descriptor;
|
||||
}
|
||||
|
||||
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
|
||||
internalGetFieldAccessorTable() {
|
||||
return io.debezium.connector.postgresql.proto.PgProto.internal_static_decoderbufs_RowMessage_fieldAccessorTable
|
||||
.ensureFieldAccessorsInitialized(
|
||||
io.debezium.connector.postgresql.proto.PgProto.RowMessage.class, io.debezium.connector.postgresql.proto.PgProto.RowMessage.Builder.class);
|
||||
}
|
||||
|
||||
public static com.google.protobuf.Parser<RowMessage> PARSER =
|
||||
new com.google.protobuf.AbstractParser<RowMessage>() {
|
||||
public RowMessage parsePartialFrom(
|
||||
com.google.protobuf.CodedInputStream input,
|
||||
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||
throws com.google.protobuf.InvalidProtocolBufferException {
|
||||
return new RowMessage(input, extensionRegistry);
|
||||
}
|
||||
};
|
||||
|
||||
@java.lang.Override
|
||||
public com.google.protobuf.Parser<RowMessage> getParserForType() {
|
||||
return PARSER;
|
||||
}
|
||||
|
||||
private int bitField0_;
|
||||
public static final int TRANSACTION_ID_FIELD_NUMBER = 1;
|
||||
private int transactionId_;
|
||||
/**
|
||||
* <code>optional uint32 transaction_id = 1;</code>
|
||||
*/
|
||||
public boolean hasTransactionId() {
|
||||
return ((bitField0_ & 0x00000001) == 0x00000001);
|
||||
}
|
||||
/**
|
||||
* <code>optional uint32 transaction_id = 1;</code>
|
||||
*/
|
||||
public int getTransactionId() {
|
||||
return transactionId_;
|
||||
}
|
||||
|
||||
public static final int COMMIT_TIME_FIELD_NUMBER = 2;
|
||||
private long commitTime_;
|
||||
/**
|
||||
* <code>optional uint64 commit_time = 2;</code>
|
||||
*/
|
||||
public boolean hasCommitTime() {
|
||||
return ((bitField0_ & 0x00000002) == 0x00000002);
|
||||
}
|
||||
/**
|
||||
* <code>optional uint64 commit_time = 2;</code>
|
||||
*/
|
||||
public long getCommitTime() {
|
||||
return commitTime_;
|
||||
}
|
||||
|
||||
public static final int TABLE_FIELD_NUMBER = 3;
|
||||
private java.lang.Object table_;
|
||||
/**
|
||||
* <code>optional string table = 3;</code>
|
||||
*/
|
||||
public boolean hasTable() {
|
||||
return ((bitField0_ & 0x00000004) == 0x00000004);
|
||||
}
|
||||
/**
|
||||
* <code>optional string table = 3;</code>
|
||||
*/
|
||||
public java.lang.String getTable() {
|
||||
java.lang.Object ref = table_;
|
||||
if (ref instanceof java.lang.String) {
|
||||
return (java.lang.String) ref;
|
||||
} else {
|
||||
com.google.protobuf.ByteString bs =
|
||||
(com.google.protobuf.ByteString) ref;
|
||||
java.lang.String s = bs.toStringUtf8();
|
||||
if (bs.isValidUtf8()) {
|
||||
table_ = s;
|
||||
}
|
||||
return s;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* <code>optional string table = 3;</code>
|
||||
*/
|
||||
public com.google.protobuf.ByteString
|
||||
getTableBytes() {
|
||||
java.lang.Object ref = table_;
|
||||
if (ref instanceof java.lang.String) {
|
||||
com.google.protobuf.ByteString b =
|
||||
com.google.protobuf.ByteString.copyFromUtf8(
|
||||
(java.lang.String) ref);
|
||||
table_ = b;
|
||||
return b;
|
||||
} else {
|
||||
return (com.google.protobuf.ByteString) ref;
|
||||
}
|
||||
}
|
||||
|
||||
public static final int OP_FIELD_NUMBER = 4;
|
||||
private io.debezium.connector.postgresql.proto.PgProto.Op op_;
|
||||
/**
|
||||
* <code>optional .decoderbufs.Op op = 4;</code>
|
||||
*/
|
||||
public boolean hasOp() {
|
||||
return ((bitField0_ & 0x00000008) == 0x00000008);
|
||||
}
|
||||
/**
|
||||
* <code>optional .decoderbufs.Op op = 4;</code>
|
||||
*/
|
||||
public io.debezium.connector.postgresql.proto.PgProto.Op getOp() {
|
||||
return op_;
|
||||
}
|
||||
|
||||
public static final int NEW_TUPLE_FIELD_NUMBER = 5;
|
||||
private java.util.List<io.debezium.connector.postgresql.proto.PgProto.DatumMessage> newTuple_;
|
||||
/**
|
||||
* <code>repeated .decoderbufs.DatumMessage new_tuple = 5;</code>
|
||||
*/
|
||||
public java.util.List<io.debezium.connector.postgresql.proto.PgProto.DatumMessage> getNewTupleList() {
|
||||
return newTuple_;
|
||||
}
|
||||
/**
|
||||
* <code>repeated .decoderbufs.DatumMessage new_tuple = 5;</code>
|
||||
*/
|
||||
public java.util.List<? extends io.debezium.connector.postgresql.proto.PgProto.DatumMessageOrBuilder>
|
||||
getNewTupleOrBuilderList() {
|
||||
return newTuple_;
|
||||
}
|
||||
/**
|
||||
* <code>repeated .decoderbufs.DatumMessage new_tuple = 5;</code>
|
||||
*/
|
||||
public int getNewTupleCount() {
|
||||
return newTuple_.size();
|
||||
}
|
||||
/**
|
||||
* <code>repeated .decoderbufs.DatumMessage new_tuple = 5;</code>
|
||||
*/
|
||||
public io.debezium.connector.postgresql.proto.PgProto.DatumMessage getNewTuple(int index) {
|
||||
return newTuple_.get(index);
|
||||
}
|
||||
/**
|
||||
* <code>repeated .decoderbufs.DatumMessage new_tuple = 5;</code>
|
||||
*/
|
||||
public io.debezium.connector.postgresql.proto.PgProto.DatumMessageOrBuilder getNewTupleOrBuilder(
|
||||
int index) {
|
||||
return newTuple_.get(index);
|
||||
}
|
||||
|
||||
public static final int OLD_TUPLE_FIELD_NUMBER = 6;
|
||||
private java.util.List<io.debezium.connector.postgresql.proto.PgProto.DatumMessage> oldTuple_;
|
||||
/**
|
||||
* <code>repeated .decoderbufs.DatumMessage old_tuple = 6;</code>
|
||||
*/
|
||||
public java.util.List<io.debezium.connector.postgresql.proto.PgProto.DatumMessage> getOldTupleList() {
|
||||
return oldTuple_;
|
||||
}
|
||||
/**
|
||||
* <code>repeated .decoderbufs.DatumMessage old_tuple = 6;</code>
|
||||
*/
|
||||
public java.util.List<? extends io.debezium.connector.postgresql.proto.PgProto.DatumMessageOrBuilder>
|
||||
getOldTupleOrBuilderList() {
|
||||
return oldTuple_;
|
||||
}
|
||||
/**
|
||||
* <code>repeated .decoderbufs.DatumMessage old_tuple = 6;</code>
|
||||
*/
|
||||
public int getOldTupleCount() {
|
||||
return oldTuple_.size();
|
||||
}
|
||||
/**
|
||||
* <code>repeated .decoderbufs.DatumMessage old_tuple = 6;</code>
|
||||
*/
|
||||
public io.debezium.connector.postgresql.proto.PgProto.DatumMessage getOldTuple(int index) {
|
||||
return oldTuple_.get(index);
|
||||
}
|
||||
/**
|
||||
* <code>repeated .decoderbufs.DatumMessage old_tuple = 6;</code>
|
||||
*/
|
||||
public io.debezium.connector.postgresql.proto.PgProto.DatumMessageOrBuilder getOldTupleOrBuilder(
|
||||
int index) {
|
||||
return oldTuple_.get(index);
|
||||
}
|
||||
|
||||
private void initFields() {
|
||||
transactionId_ = 0;
|
||||
commitTime_ = 0L;
|
||||
table_ = "";
|
||||
op_ = io.debezium.connector.postgresql.proto.PgProto.Op.INSERT;
|
||||
newTuple_ = java.util.Collections.emptyList();
|
||||
oldTuple_ = java.util.Collections.emptyList();
|
||||
}
|
||||
private byte memoizedIsInitialized = -1;
|
||||
public final boolean isInitialized() {
|
||||
byte isInitialized = memoizedIsInitialized;
|
||||
if (isInitialized == 1) return true;
|
||||
if (isInitialized == 0) return false;
|
||||
|
||||
for (int i = 0; i < getNewTupleCount(); i++) {
|
||||
if (!getNewTuple(i).isInitialized()) {
|
||||
memoizedIsInitialized = 0;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
for (int i = 0; i < getOldTupleCount(); i++) {
|
||||
if (!getOldTuple(i).isInitialized()) {
|
||||
memoizedIsInitialized = 0;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
memoizedIsInitialized = 1;
|
||||
return true;
|
||||
}
|
||||
|
||||
public void writeTo(com.google.protobuf.CodedOutputStream output)
|
||||
throws java.io.IOException {
|
||||
getSerializedSize();
|
||||
if (((bitField0_ & 0x00000001) == 0x00000001)) {
|
||||
output.writeUInt32(1, transactionId_);
|
||||
}
|
||||
if (((bitField0_ & 0x00000002) == 0x00000002)) {
|
||||
output.writeUInt64(2, commitTime_);
|
||||
}
|
||||
if (((bitField0_ & 0x00000004) == 0x00000004)) {
|
||||
output.writeBytes(3, getTableBytes());
|
||||
}
|
||||
if (((bitField0_ & 0x00000008) == 0x00000008)) {
|
||||
output.writeEnum(4, op_.getNumber());
|
||||
}
|
||||
for (int i = 0; i < newTuple_.size(); i++) {
|
||||
output.writeMessage(5, newTuple_.get(i));
|
||||
}
|
||||
for (int i = 0; i < oldTuple_.size(); i++) {
|
||||
output.writeMessage(6, oldTuple_.get(i));
|
||||
}
|
||||
getUnknownFields().writeTo(output);
|
||||
}
|
||||
|
||||
private int memoizedSerializedSize = -1;
|
||||
public int getSerializedSize() {
|
||||
int size = memoizedSerializedSize;
|
||||
if (size != -1) return size;
|
||||
|
||||
size = 0;
|
||||
if (((bitField0_ & 0x00000001) == 0x00000001)) {
|
||||
size += com.google.protobuf.CodedOutputStream
|
||||
.computeUInt32Size(1, transactionId_);
|
||||
}
|
||||
if (((bitField0_ & 0x00000002) == 0x00000002)) {
|
||||
size += com.google.protobuf.CodedOutputStream
|
||||
.computeUInt64Size(2, commitTime_);
|
||||
}
|
||||
if (((bitField0_ & 0x00000004) == 0x00000004)) {
|
||||
size += com.google.protobuf.CodedOutputStream
|
||||
.computeBytesSize(3, getTableBytes());
|
||||
}
|
||||
if (((bitField0_ & 0x00000008) == 0x00000008)) {
|
||||
size += com.google.protobuf.CodedOutputStream
|
||||
.computeEnumSize(4, op_.getNumber());
|
||||
}
|
||||
for (int i = 0; i < newTuple_.size(); i++) {
|
||||
size += com.google.protobuf.CodedOutputStream
|
||||
.computeMessageSize(5, newTuple_.get(i));
|
||||
}
|
||||
for (int i = 0; i < oldTuple_.size(); i++) {
|
||||
size += com.google.protobuf.CodedOutputStream
|
||||
.computeMessageSize(6, oldTuple_.get(i));
|
||||
}
|
||||
size += getUnknownFields().getSerializedSize();
|
||||
memoizedSerializedSize = size;
|
||||
return size;
|
||||
}
|
||||
|
||||
private static final long serialVersionUID = 0L;
|
||||
@java.lang.Override
|
||||
protected java.lang.Object writeReplace()
|
||||
throws java.io.ObjectStreamException {
|
||||
return super.writeReplace();
|
||||
}
|
||||
|
||||
public static io.debezium.connector.postgresql.proto.PgProto.RowMessage parseFrom(
|
||||
com.google.protobuf.ByteString data)
|
||||
throws com.google.protobuf.InvalidProtocolBufferException {
|
||||
return PARSER.parseFrom(data);
|
||||
}
|
||||
public static io.debezium.connector.postgresql.proto.PgProto.RowMessage parseFrom(
|
||||
com.google.protobuf.ByteString data,
|
||||
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||
throws com.google.protobuf.InvalidProtocolBufferException {
|
||||
return PARSER.parseFrom(data, extensionRegistry);
|
||||
}
|
||||
public static io.debezium.connector.postgresql.proto.PgProto.RowMessage parseFrom(byte[] data)
|
||||
throws com.google.protobuf.InvalidProtocolBufferException {
|
||||
return PARSER.parseFrom(data);
|
||||
}
|
||||
public static io.debezium.connector.postgresql.proto.PgProto.RowMessage parseFrom(
|
||||
byte[] data,
|
||||
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||
throws com.google.protobuf.InvalidProtocolBufferException {
|
||||
return PARSER.parseFrom(data, extensionRegistry);
|
||||
}
|
||||
public static io.debezium.connector.postgresql.proto.PgProto.RowMessage parseFrom(java.io.InputStream input)
|
||||
throws java.io.IOException {
|
||||
return PARSER.parseFrom(input);
|
||||
}
|
||||
public static io.debezium.connector.postgresql.proto.PgProto.RowMessage parseFrom(
|
||||
java.io.InputStream input,
|
||||
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||
throws java.io.IOException {
|
||||
return PARSER.parseFrom(input, extensionRegistry);
|
||||
}
|
||||
public static io.debezium.connector.postgresql.proto.PgProto.RowMessage parseDelimitedFrom(java.io.InputStream input)
|
||||
throws java.io.IOException {
|
||||
return PARSER.parseDelimitedFrom(input);
|
||||
}
|
||||
public static io.debezium.connector.postgresql.proto.PgProto.RowMessage parseDelimitedFrom(
|
||||
java.io.InputStream input,
|
||||
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||
throws java.io.IOException {
|
||||
return PARSER.parseDelimitedFrom(input, extensionRegistry);
|
||||
}
|
||||
public static io.debezium.connector.postgresql.proto.PgProto.RowMessage parseFrom(
|
||||
com.google.protobuf.CodedInputStream input)
|
||||
throws java.io.IOException {
|
||||
return PARSER.parseFrom(input);
|
||||
}
|
||||
public static io.debezium.connector.postgresql.proto.PgProto.RowMessage parseFrom(
|
||||
com.google.protobuf.CodedInputStream input,
|
||||
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||
throws java.io.IOException {
|
||||
return PARSER.parseFrom(input, extensionRegistry);
|
||||
}
|
||||
|
||||
public static Builder newBuilder() { return Builder.create(); }
|
||||
public Builder newBuilderForType() { return newBuilder(); }
|
||||
public static Builder newBuilder(io.debezium.connector.postgresql.proto.PgProto.RowMessage prototype) {
|
||||
return newBuilder().mergeFrom(prototype);
|
||||
}
|
||||
public Builder toBuilder() { return newBuilder(this); }
|
||||
|
||||
@java.lang.Override
|
||||
protected Builder newBuilderForType(
|
||||
com.google.protobuf.GeneratedMessage.BuilderParent parent) {
|
||||
Builder builder = new Builder(parent);
|
||||
return builder;
|
||||
}
|
||||
/**
|
||||
* Protobuf type {@code decoderbufs.RowMessage}
|
||||
*/
|
||||
public static final class Builder extends
|
||||
com.google.protobuf.GeneratedMessage.Builder<Builder> implements
|
||||
// @@protoc_insertion_point(builder_implements:decoderbufs.RowMessage)
|
||||
io.debezium.connector.postgresql.proto.PgProto.RowMessageOrBuilder {
|
||||
public static final com.google.protobuf.Descriptors.Descriptor
|
||||
getDescriptor() {
|
||||
return io.debezium.connector.postgresql.proto.PgProto.internal_static_decoderbufs_RowMessage_descriptor;
|
||||
}
|
||||
|
||||
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
|
||||
internalGetFieldAccessorTable() {
|
||||
return io.debezium.connector.postgresql.proto.PgProto.internal_static_decoderbufs_RowMessage_fieldAccessorTable
|
||||
.ensureFieldAccessorsInitialized(
|
||||
io.debezium.connector.postgresql.proto.PgProto.RowMessage.class, io.debezium.connector.postgresql.proto.PgProto.RowMessage.Builder.class);
|
||||
}
|
||||
|
||||
// Construct using io.debezium.connector.postgresql.proto.PgProto.RowMessage.newBuilder()
|
||||
private Builder() {
|
||||
maybeForceBuilderInitialization();
|
||||
}
|
||||
|
||||
private Builder(
|
||||
com.google.protobuf.GeneratedMessage.BuilderParent parent) {
|
||||
super(parent);
|
||||
maybeForceBuilderInitialization();
|
||||
}
|
||||
private void maybeForceBuilderInitialization() {
|
||||
if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
|
||||
getNewTupleFieldBuilder();
|
||||
getOldTupleFieldBuilder();
|
||||
}
|
||||
}
|
||||
private static Builder create() {
|
||||
return new Builder();
|
||||
}
|
||||
|
||||
public Builder clear() {
|
||||
super.clear();
|
||||
transactionId_ = 0;
|
||||
bitField0_ = (bitField0_ & ~0x00000001);
|
||||
commitTime_ = 0L;
|
||||
bitField0_ = (bitField0_ & ~0x00000002);
|
||||
table_ = "";
|
||||
bitField0_ = (bitField0_ & ~0x00000004);
|
||||
op_ = io.debezium.connector.postgresql.proto.PgProto.Op.INSERT;
|
||||
bitField0_ = (bitField0_ & ~0x00000008);
|
||||
if (newTupleBuilder_ == null) {
|
||||
newTuple_ = java.util.Collections.emptyList();
|
||||
bitField0_ = (bitField0_ & ~0x00000010);
|
||||
} else {
|
||||
newTupleBuilder_.clear();
|
||||
}
|
||||
if (oldTupleBuilder_ == null) {
|
||||
oldTuple_ = java.util.Collections.emptyList();
|
||||
bitField0_ = (bitField0_ & ~0x00000020);
|
||||
} else {
|
||||
oldTupleBuilder_.clear();
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder clone() {
|
||||
return create().mergeFrom(buildPartial());
|
||||
}
|
||||
|
||||
public com.google.protobuf.Descriptors.Descriptor
|
||||
getDescriptorForType() {
|
||||
return io.debezium.connector.postgresql.proto.PgProto.internal_static_decoderbufs_RowMessage_descriptor;
|
||||
}
|
||||
|
||||
public io.debezium.connector.postgresql.proto.PgProto.RowMessage getDefaultInstanceForType() {
|
||||
return io.debezium.connector.postgresql.proto.PgProto.RowMessage.getDefaultInstance();
|
||||
}
|
||||
|
||||
public io.debezium.connector.postgresql.proto.PgProto.RowMessage build() {
|
||||
io.debezium.connector.postgresql.proto.PgProto.RowMessage result = buildPartial();
|
||||
if (!result.isInitialized()) {
|
||||
throw newUninitializedMessageException(result);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public io.debezium.connector.postgresql.proto.PgProto.RowMessage buildPartial() {
|
||||
io.debezium.connector.postgresql.proto.PgProto.RowMessage result = new io.debezium.connector.postgresql.proto.PgProto.RowMessage(this);
|
||||
int from_bitField0_ = bitField0_;
|
||||
int to_bitField0_ = 0;
|
||||
if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
|
||||
to_bitField0_ |= 0x00000001;
|
||||
}
|
||||
result.transactionId_ = transactionId_;
|
||||
if (((from_bitField0_ & 0x00000002) == 0x00000002)) {
|
||||
to_bitField0_ |= 0x00000002;
|
||||
}
|
||||
result.commitTime_ = commitTime_;
|
||||
if (((from_bitField0_ & 0x00000004) == 0x00000004)) {
|
||||
to_bitField0_ |= 0x00000004;
|
||||
}
|
||||
result.table_ = table_;
|
||||
if (((from_bitField0_ & 0x00000008) == 0x00000008)) {
|
||||
to_bitField0_ |= 0x00000008;
|
||||
}
|
||||
result.op_ = op_;
|
||||
if (newTupleBuilder_ == null) {
|
||||
if (((bitField0_ & 0x00000010) == 0x00000010)) {
|
||||
newTuple_ = java.util.Collections.unmodifiableList(newTuple_);
|
||||
bitField0_ = (bitField0_ & ~0x00000010);
|
||||
}
|
||||
result.newTuple_ = newTuple_;
|
||||
} else {
|
||||
result.newTuple_ = newTupleBuilder_.build();
|
||||
}
|
||||
if (oldTupleBuilder_ == null) {
|
||||
if (((bitField0_ & 0x00000020) == 0x00000020)) {
|
||||
oldTuple_ = java.util.Collections.unmodifiableList(oldTuple_);
|
||||
bitField0_ = (bitField0_ & ~0x00000020);
|
||||
}
|
||||
result.oldTuple_ = oldTuple_;
|
||||
} else {
|
||||
result.oldTuple_ = oldTupleBuilder_.build();
|
||||
}
|
||||
result.bitField0_ = to_bitField0_;
|
||||
onBuilt();
|
||||
return result;
|
||||
}
|
||||
|
||||
public Builder mergeFrom(com.google.protobuf.Message other) {
|
||||
if (other instanceof io.debezium.connector.postgresql.proto.PgProto.RowMessage) {
|
||||
return mergeFrom((io.debezium.connector.postgresql.proto.PgProto.RowMessage)other);
|
||||
} else {
|
||||
super.mergeFrom(other);
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
public Builder mergeFrom(io.debezium.connector.postgresql.proto.PgProto.RowMessage other) {
|
||||
if (other == io.debezium.connector.postgresql.proto.PgProto.RowMessage.getDefaultInstance()) return this;
|
||||
if (other.hasTransactionId()) {
|
||||
setTransactionId(other.getTransactionId());
|
||||
}
|
||||
if (other.hasCommitTime()) {
|
||||
setCommitTime(other.getCommitTime());
|
||||
}
|
||||
if (other.hasTable()) {
|
||||
bitField0_ |= 0x00000004;
|
||||
table_ = other.table_;
|
||||
onChanged();
|
||||
}
|
||||
if (other.hasOp()) {
|
||||
setOp(other.getOp());
|
||||
}
|
||||
if (newTupleBuilder_ == null) {
|
||||
if (!other.newTuple_.isEmpty()) {
|
||||
if (newTuple_.isEmpty()) {
|
||||
newTuple_ = other.newTuple_;
|
||||
bitField0_ = (bitField0_ & ~0x00000010);
|
||||
} else {
|
||||
ensureNewTupleIsMutable();
|
||||
newTuple_.addAll(other.newTuple_);
|
||||
}
|
||||
onChanged();
|
||||
}
|
||||
} else {
|
||||
if (!other.newTuple_.isEmpty()) {
|
||||
if (newTupleBuilder_.isEmpty()) {
|
||||
newTupleBuilder_.dispose();
|
||||
newTupleBuilder_ = null;
|
||||
newTuple_ = other.newTuple_;
|
||||
bitField0_ = (bitField0_ & ~0x00000010);
|
||||
newTupleBuilder_ =
|
||||
com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ?
|
||||
getNewTupleFieldBuilder() : null;
|
||||
} else {
|
||||
newTupleBuilder_.addAllMessages(other.newTuple_);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (oldTupleBuilder_ == null) {
|
||||
if (!other.oldTuple_.isEmpty()) {
|
||||
if (oldTuple_.isEmpty()) {
|
||||
oldTuple_ = other.oldTuple_;
|
||||
bitField0_ = (bitField0_ & ~0x00000020);
|
||||
} else {
|
||||
ensureOldTupleIsMutable();
|
||||
oldTuple_.addAll(other.oldTuple_);
|
||||
}
|
||||
onChanged();
|
||||
}
|
||||
} else {
|
||||
if (!other.oldTuple_.isEmpty()) {
|
||||
if (oldTupleBuilder_.isEmpty()) {
|
||||
oldTupleBuilder_.dispose();
|
||||
oldTupleBuilder_ = null;
|
||||
oldTuple_ = other.oldTuple_;
|
||||
bitField0_ = (bitField0_ & ~0x00000020);
|
||||
oldTupleBuilder_ =
|
||||
com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ?
|
||||
getOldTupleFieldBuilder() : null;
|
||||
} else {
|
||||
oldTupleBuilder_.addAllMessages(other.oldTuple_);
|
||||
}
|
||||
}
|
||||
}
|
||||
this.mergeUnknownFields(other.getUnknownFields());
|
||||
return this;
|
||||
}
|
||||
|
||||
public final boolean isInitialized() {
|
||||
for (int i = 0; i < getNewTupleCount(); i++) {
|
||||
if (!getNewTuple(i).isInitialized()) {
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
for (int i = 0; i < getOldTupleCount(); i++) {
|
||||
if (!getOldTuple(i).isInitialized()) {
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public Builder mergeFrom(
|
||||
com.google.protobuf.CodedInputStream input,
|
||||
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||
throws java.io.IOException {
|
||||
io.debezium.connector.postgresql.proto.PgProto.RowMessage parsedMessage = null;
|
||||
try {
|
||||
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
|
||||
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
|
||||
parsedMessage = (io.debezium.connector.postgresql.proto.PgProto.RowMessage) e.getUnfinishedMessage();
|
||||
throw e;
|
||||
} finally {
|
||||
if (parsedMessage != null) {
|
||||
mergeFrom(parsedMessage);
|
||||
}
|
||||
}
|
||||
return this;
|
||||
}
|
||||
private int bitField0_;
|
||||
|
||||
private int transactionId_ ;
|
||||
/**
|
||||
* <code>optional uint32 transaction_id = 1;</code>
|
||||
*/
|
||||
public boolean hasTransactionId() {
|
||||
return ((bitField0_ & 0x00000001) == 0x00000001);
|
||||
}
|
||||
/**
|
||||
* <code>optional uint32 transaction_id = 1;</code>
|
||||
*/
|
||||
public int getTransactionId() {
|
||||
return transactionId_;
|
||||
}
|
||||
/**
|
||||
* <code>optional uint32 transaction_id = 1;</code>
|
||||
*/
|
||||
public Builder setTransactionId(int value) {
|
||||
bitField0_ |= 0x00000001;
|
||||
transactionId_ = value;
|
||||
onChanged();
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* <code>optional uint32 transaction_id = 1;</code>
|
||||
*/
|
||||
public Builder clearTransactionId() {
|
||||
bitField0_ = (bitField0_ & ~0x00000001);
|
||||
transactionId_ = 0;
|
||||
onChanged();
|
||||
return this;
|
||||
}
|
||||
|
||||
private long commitTime_ ;
|
||||
/**
|
||||
* <code>optional uint64 commit_time = 2;</code>
|
||||
*/
|
||||
public boolean hasCommitTime() {
|
||||
return ((bitField0_ & 0x00000002) == 0x00000002);
|
||||
}
|
||||
/**
|
||||
* <code>optional uint64 commit_time = 2;</code>
|
||||
*/
|
||||
public long getCommitTime() {
|
||||
return commitTime_;
|
||||
}
|
||||
/**
|
||||
* <code>optional uint64 commit_time = 2;</code>
|
||||
*/
|
||||
public Builder setCommitTime(long value) {
|
||||
bitField0_ |= 0x00000002;
|
||||
commitTime_ = value;
|
||||
onChanged();
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* <code>optional uint64 commit_time = 2;</code>
|
||||
*/
|
||||
public Builder clearCommitTime() {
|
||||
bitField0_ = (bitField0_ & ~0x00000002);
|
||||
commitTime_ = 0L;
|
||||
onChanged();
|
||||
return this;
|
||||
}
|
||||
|
||||
private java.lang.Object table_ = "";
|
||||
/**
|
||||
* <code>optional string table = 3;</code>
|
||||
*/
|
||||
public boolean hasTable() {
|
||||
return ((bitField0_ & 0x00000004) == 0x00000004);
|
||||
}
|
||||
/**
|
||||
* <code>optional string table = 3;</code>
|
||||
*/
|
||||
public java.lang.String getTable() {
|
||||
java.lang.Object ref = table_;
|
||||
if (!(ref instanceof java.lang.String)) {
|
||||
com.google.protobuf.ByteString bs =
|
||||
(com.google.protobuf.ByteString) ref;
|
||||
java.lang.String s = bs.toStringUtf8();
|
||||
if (bs.isValidUtf8()) {
|
||||
table_ = s;
|
||||
}
|
||||
return s;
|
||||
} else {
|
||||
return (java.lang.String) ref;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* <code>optional string table = 3;</code>
|
||||
*/
|
||||
public com.google.protobuf.ByteString
|
||||
getTableBytes() {
|
||||
java.lang.Object ref = table_;
|
||||
if (ref instanceof String) {
|
||||
com.google.protobuf.ByteString b =
|
||||
com.google.protobuf.ByteString.copyFromUtf8(
|
||||
(java.lang.String) ref);
|
||||
table_ = b;
|
||||
return b;
|
||||
} else {
|
||||
return (com.google.protobuf.ByteString) ref;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* <code>optional string table = 3;</code>
|
||||
*/
|
||||
public Builder setTable(
|
||||
java.lang.String value) {
|
||||
if (value == null) {
|
||||
throw new NullPointerException();
|
||||
}
|
||||
bitField0_ |= 0x00000004;
|
||||
table_ = value;
|
||||
onChanged();
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* <code>optional string table = 3;</code>
|
||||
*/
|
||||
public Builder clearTable() {
|
||||
bitField0_ = (bitField0_ & ~0x00000004);
|
||||
table_ = getDefaultInstance().getTable();
|
||||
onChanged();
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* <code>optional string table = 3;</code>
|
||||
*/
|
||||
public Builder setTableBytes(
|
||||
com.google.protobuf.ByteString value) {
|
||||
if (value == null) {
|
||||
throw new NullPointerException();
|
||||
}
|
||||
bitField0_ |= 0x00000004;
|
||||
table_ = value;
|
||||
onChanged();
|
||||
return this;
|
||||
}
|
||||
|
||||
private io.debezium.connector.postgresql.proto.PgProto.Op op_ = io.debezium.connector.postgresql.proto.PgProto.Op.INSERT;
|
||||
/**
|
||||
* <code>optional .decoderbufs.Op op = 4;</code>
|
||||
*/
|
||||
public boolean hasOp() {
|
||||
return ((bitField0_ & 0x00000008) == 0x00000008);
|
||||
}
|
||||
/**
|
||||
* <code>optional .decoderbufs.Op op = 4;</code>
|
||||
*/
|
||||
public io.debezium.connector.postgresql.proto.PgProto.Op getOp() {
|
||||
return op_;
|
||||
}
|
||||
/**
|
||||
* <code>optional .decoderbufs.Op op = 4;</code>
|
||||
*/
|
||||
public Builder setOp(io.debezium.connector.postgresql.proto.PgProto.Op value) {
|
||||
if (value == null) {
|
||||
throw new NullPointerException();
|
||||
}
|
||||
bitField0_ |= 0x00000008;
|
||||
op_ = value;
|
||||
onChanged();
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* <code>optional .decoderbufs.Op op = 4;</code>
|
||||
*/
|
||||
public Builder clearOp() {
|
||||
bitField0_ = (bitField0_ & ~0x00000008);
|
||||
op_ = io.debezium.connector.postgresql.proto.PgProto.Op.INSERT;
|
||||
onChanged();
|
||||
return this;
|
||||
}
|
||||
|
||||
private java.util.List<io.debezium.connector.postgresql.proto.PgProto.DatumMessage> newTuple_ =
|
||||
java.util.Collections.emptyList();
|
||||
private void ensureNewTupleIsMutable() {
|
||||
if (!((bitField0_ & 0x00000010) == 0x00000010)) {
|
||||
newTuple_ = new java.util.ArrayList<io.debezium.connector.postgresql.proto.PgProto.DatumMessage>(newTuple_);
|
||||
bitField0_ |= 0x00000010;
|
||||
}
|
||||
}
|
||||
|
||||
private com.google.protobuf.RepeatedFieldBuilder<
|
||||
io.debezium.connector.postgresql.proto.PgProto.DatumMessage, io.debezium.connector.postgresql.proto.PgProto.DatumMessage.Builder, io.debezium.connector.postgresql.proto.PgProto.DatumMessageOrBuilder> newTupleBuilder_;
|
||||
|
||||
/**
|
||||
* <code>repeated .decoderbufs.DatumMessage new_tuple = 5;</code>
|
||||
*/
|
||||
public java.util.List<io.debezium.connector.postgresql.proto.PgProto.DatumMessage> getNewTupleList() {
|
||||
if (newTupleBuilder_ == null) {
|
||||
return java.util.Collections.unmodifiableList(newTuple_);
|
||||
} else {
|
||||
return newTupleBuilder_.getMessageList();
|
||||
}
|
||||
}
|
||||
/**
|
||||
* <code>repeated .decoderbufs.DatumMessage new_tuple = 5;</code>
|
||||
*/
|
||||
public int getNewTupleCount() {
|
||||
if (newTupleBuilder_ == null) {
|
||||
return newTuple_.size();
|
||||
} else {
|
||||
return newTupleBuilder_.getCount();
|
||||
}
|
||||
}
|
||||
/**
|
||||
* <code>repeated .decoderbufs.DatumMessage new_tuple = 5;</code>
|
||||
*/
|
||||
public io.debezium.connector.postgresql.proto.PgProto.DatumMessage getNewTuple(int index) {
|
||||
if (newTupleBuilder_ == null) {
|
||||
return newTuple_.get(index);
|
||||
} else {
|
||||
return newTupleBuilder_.getMessage(index);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* <code>repeated .decoderbufs.DatumMessage new_tuple = 5;</code>
|
||||
*/
|
||||
public Builder setNewTuple(
|
||||
int index, io.debezium.connector.postgresql.proto.PgProto.DatumMessage value) {
|
||||
if (newTupleBuilder_ == null) {
|
||||
if (value == null) {
|
||||
throw new NullPointerException();
|
||||
}
|
||||
ensureNewTupleIsMutable();
|
||||
newTuple_.set(index, value);
|
||||
onChanged();
|
||||
} else {
|
||||
newTupleBuilder_.setMessage(index, value);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* <code>repeated .decoderbufs.DatumMessage new_tuple = 5;</code>
|
||||
*/
|
||||
public Builder setNewTuple(
|
||||
int index, io.debezium.connector.postgresql.proto.PgProto.DatumMessage.Builder builderForValue) {
|
||||
if (newTupleBuilder_ == null) {
|
||||
ensureNewTupleIsMutable();
|
||||
newTuple_.set(index, builderForValue.build());
|
||||
onChanged();
|
||||
} else {
|
||||
newTupleBuilder_.setMessage(index, builderForValue.build());
|
||||
}
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* <code>repeated .decoderbufs.DatumMessage new_tuple = 5;</code>
|
||||
*/
|
||||
public Builder addNewTuple(io.debezium.connector.postgresql.proto.PgProto.DatumMessage value) {
|
||||
if (newTupleBuilder_ == null) {
|
||||
if (value == null) {
|
||||
throw new NullPointerException();
|
||||
}
|
||||
ensureNewTupleIsMutable();
|
||||
newTuple_.add(value);
|
||||
onChanged();
|
||||
} else {
|
||||
newTupleBuilder_.addMessage(value);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* <code>repeated .decoderbufs.DatumMessage new_tuple = 5;</code>
|
||||
*/
|
||||
public Builder addNewTuple(
|
||||
int index, io.debezium.connector.postgresql.proto.PgProto.DatumMessage value) {
|
||||
if (newTupleBuilder_ == null) {
|
||||
if (value == null) {
|
||||
throw new NullPointerException();
|
||||
}
|
||||
ensureNewTupleIsMutable();
|
||||
newTuple_.add(index, value);
|
||||
onChanged();
|
||||
} else {
|
||||
newTupleBuilder_.addMessage(index, value);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* <code>repeated .decoderbufs.DatumMessage new_tuple = 5;</code>
|
||||
*/
|
||||
public Builder addNewTuple(
|
||||
io.debezium.connector.postgresql.proto.PgProto.DatumMessage.Builder builderForValue) {
|
||||
if (newTupleBuilder_ == null) {
|
||||
ensureNewTupleIsMutable();
|
||||
newTuple_.add(builderForValue.build());
|
||||
onChanged();
|
||||
} else {
|
||||
newTupleBuilder_.addMessage(builderForValue.build());
|
||||
}
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* <code>repeated .decoderbufs.DatumMessage new_tuple = 5;</code>
|
||||
*/
|
||||
public Builder addNewTuple(
|
||||
int index, io.debezium.connector.postgresql.proto.PgProto.DatumMessage.Builder builderForValue) {
|
||||
if (newTupleBuilder_ == null) {
|
||||
ensureNewTupleIsMutable();
|
||||
newTuple_.add(index, builderForValue.build());
|
||||
onChanged();
|
||||
} else {
|
||||
newTupleBuilder_.addMessage(index, builderForValue.build());
|
||||
}
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* <code>repeated .decoderbufs.DatumMessage new_tuple = 5;</code>
|
||||
*/
|
||||
public Builder addAllNewTuple(
|
||||
java.lang.Iterable<? extends io.debezium.connector.postgresql.proto.PgProto.DatumMessage> values) {
|
||||
if (newTupleBuilder_ == null) {
|
||||
ensureNewTupleIsMutable();
|
||||
com.google.protobuf.AbstractMessageLite.Builder.addAll(
|
||||
values, newTuple_);
|
||||
onChanged();
|
||||
} else {
|
||||
newTupleBuilder_.addAllMessages(values);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* <code>repeated .decoderbufs.DatumMessage new_tuple = 5;</code>
|
||||
*/
|
||||
public Builder clearNewTuple() {
|
||||
if (newTupleBuilder_ == null) {
|
||||
newTuple_ = java.util.Collections.emptyList();
|
||||
bitField0_ = (bitField0_ & ~0x00000010);
|
||||
onChanged();
|
||||
} else {
|
||||
newTupleBuilder_.clear();
|
||||
}
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* <code>repeated .decoderbufs.DatumMessage new_tuple = 5;</code>
|
||||
*/
|
||||
public Builder removeNewTuple(int index) {
|
||||
if (newTupleBuilder_ == null) {
|
||||
ensureNewTupleIsMutable();
|
||||
newTuple_.remove(index);
|
||||
onChanged();
|
||||
} else {
|
||||
newTupleBuilder_.remove(index);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* <code>repeated .decoderbufs.DatumMessage new_tuple = 5;</code>
|
||||
*/
|
||||
public io.debezium.connector.postgresql.proto.PgProto.DatumMessage.Builder getNewTupleBuilder(
|
||||
int index) {
|
||||
return getNewTupleFieldBuilder().getBuilder(index);
|
||||
}
|
||||
/**
|
||||
* <code>repeated .decoderbufs.DatumMessage new_tuple = 5;</code>
|
||||
*/
|
||||
public io.debezium.connector.postgresql.proto.PgProto.DatumMessageOrBuilder getNewTupleOrBuilder(
|
||||
int index) {
|
||||
if (newTupleBuilder_ == null) {
|
||||
return newTuple_.get(index); } else {
|
||||
return newTupleBuilder_.getMessageOrBuilder(index);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* <code>repeated .decoderbufs.DatumMessage new_tuple = 5;</code>
|
||||
*/
|
||||
public java.util.List<? extends io.debezium.connector.postgresql.proto.PgProto.DatumMessageOrBuilder>
|
||||
getNewTupleOrBuilderList() {
|
||||
if (newTupleBuilder_ != null) {
|
||||
return newTupleBuilder_.getMessageOrBuilderList();
|
||||
} else {
|
||||
return java.util.Collections.unmodifiableList(newTuple_);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* <code>repeated .decoderbufs.DatumMessage new_tuple = 5;</code>
|
||||
*/
|
||||
public io.debezium.connector.postgresql.proto.PgProto.DatumMessage.Builder addNewTupleBuilder() {
|
||||
return getNewTupleFieldBuilder().addBuilder(
|
||||
io.debezium.connector.postgresql.proto.PgProto.DatumMessage.getDefaultInstance());
|
||||
}
|
||||
/**
|
||||
* <code>repeated .decoderbufs.DatumMessage new_tuple = 5;</code>
|
||||
*/
|
||||
public io.debezium.connector.postgresql.proto.PgProto.DatumMessage.Builder addNewTupleBuilder(
|
||||
int index) {
|
||||
return getNewTupleFieldBuilder().addBuilder(
|
||||
index, io.debezium.connector.postgresql.proto.PgProto.DatumMessage.getDefaultInstance());
|
||||
}
|
||||
/**
|
||||
* <code>repeated .decoderbufs.DatumMessage new_tuple = 5;</code>
|
||||
*/
|
||||
public java.util.List<io.debezium.connector.postgresql.proto.PgProto.DatumMessage.Builder>
|
||||
getNewTupleBuilderList() {
|
||||
return getNewTupleFieldBuilder().getBuilderList();
|
||||
}
|
||||
private com.google.protobuf.RepeatedFieldBuilder<
|
||||
io.debezium.connector.postgresql.proto.PgProto.DatumMessage, io.debezium.connector.postgresql.proto.PgProto.DatumMessage.Builder, io.debezium.connector.postgresql.proto.PgProto.DatumMessageOrBuilder>
|
||||
getNewTupleFieldBuilder() {
|
||||
if (newTupleBuilder_ == null) {
|
||||
newTupleBuilder_ = new com.google.protobuf.RepeatedFieldBuilder<
|
||||
io.debezium.connector.postgresql.proto.PgProto.DatumMessage, io.debezium.connector.postgresql.proto.PgProto.DatumMessage.Builder, io.debezium.connector.postgresql.proto.PgProto.DatumMessageOrBuilder>(
|
||||
newTuple_,
|
||||
((bitField0_ & 0x00000010) == 0x00000010),
|
||||
getParentForChildren(),
|
||||
isClean());
|
||||
newTuple_ = null;
|
||||
}
|
||||
return newTupleBuilder_;
|
||||
}
|
||||
|
||||
private java.util.List<io.debezium.connector.postgresql.proto.PgProto.DatumMessage> oldTuple_ =
|
||||
java.util.Collections.emptyList();
|
||||
private void ensureOldTupleIsMutable() {
|
||||
if (!((bitField0_ & 0x00000020) == 0x00000020)) {
|
||||
oldTuple_ = new java.util.ArrayList<io.debezium.connector.postgresql.proto.PgProto.DatumMessage>(oldTuple_);
|
||||
bitField0_ |= 0x00000020;
|
||||
}
|
||||
}
|
||||
|
||||
private com.google.protobuf.RepeatedFieldBuilder<
|
||||
io.debezium.connector.postgresql.proto.PgProto.DatumMessage, io.debezium.connector.postgresql.proto.PgProto.DatumMessage.Builder, io.debezium.connector.postgresql.proto.PgProto.DatumMessageOrBuilder> oldTupleBuilder_;
|
||||
|
||||
/**
|
||||
* <code>repeated .decoderbufs.DatumMessage old_tuple = 6;</code>
|
||||
*/
|
||||
public java.util.List<io.debezium.connector.postgresql.proto.PgProto.DatumMessage> getOldTupleList() {
|
||||
if (oldTupleBuilder_ == null) {
|
||||
return java.util.Collections.unmodifiableList(oldTuple_);
|
||||
} else {
|
||||
return oldTupleBuilder_.getMessageList();
|
||||
}
|
||||
}
|
||||
/**
|
||||
* <code>repeated .decoderbufs.DatumMessage old_tuple = 6;</code>
|
||||
*/
|
||||
public int getOldTupleCount() {
|
||||
if (oldTupleBuilder_ == null) {
|
||||
return oldTuple_.size();
|
||||
} else {
|
||||
return oldTupleBuilder_.getCount();
|
||||
}
|
||||
}
|
||||
/**
|
||||
* <code>repeated .decoderbufs.DatumMessage old_tuple = 6;</code>
|
||||
*/
|
||||
public io.debezium.connector.postgresql.proto.PgProto.DatumMessage getOldTuple(int index) {
|
||||
if (oldTupleBuilder_ == null) {
|
||||
return oldTuple_.get(index);
|
||||
} else {
|
||||
return oldTupleBuilder_.getMessage(index);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* <code>repeated .decoderbufs.DatumMessage old_tuple = 6;</code>
|
||||
*/
|
||||
public Builder setOldTuple(
|
||||
int index, io.debezium.connector.postgresql.proto.PgProto.DatumMessage value) {
|
||||
if (oldTupleBuilder_ == null) {
|
||||
if (value == null) {
|
||||
throw new NullPointerException();
|
||||
}
|
||||
ensureOldTupleIsMutable();
|
||||
oldTuple_.set(index, value);
|
||||
onChanged();
|
||||
} else {
|
||||
oldTupleBuilder_.setMessage(index, value);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* <code>repeated .decoderbufs.DatumMessage old_tuple = 6;</code>
|
||||
*/
|
||||
public Builder setOldTuple(
|
||||
int index, io.debezium.connector.postgresql.proto.PgProto.DatumMessage.Builder builderForValue) {
|
||||
if (oldTupleBuilder_ == null) {
|
||||
ensureOldTupleIsMutable();
|
||||
oldTuple_.set(index, builderForValue.build());
|
||||
onChanged();
|
||||
} else {
|
||||
oldTupleBuilder_.setMessage(index, builderForValue.build());
|
||||
}
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* <code>repeated .decoderbufs.DatumMessage old_tuple = 6;</code>
|
||||
*/
|
||||
public Builder addOldTuple(io.debezium.connector.postgresql.proto.PgProto.DatumMessage value) {
|
||||
if (oldTupleBuilder_ == null) {
|
||||
if (value == null) {
|
||||
throw new NullPointerException();
|
||||
}
|
||||
ensureOldTupleIsMutable();
|
||||
oldTuple_.add(value);
|
||||
onChanged();
|
||||
} else {
|
||||
oldTupleBuilder_.addMessage(value);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* <code>repeated .decoderbufs.DatumMessage old_tuple = 6;</code>
|
||||
*/
|
||||
public Builder addOldTuple(
|
||||
int index, io.debezium.connector.postgresql.proto.PgProto.DatumMessage value) {
|
||||
if (oldTupleBuilder_ == null) {
|
||||
if (value == null) {
|
||||
throw new NullPointerException();
|
||||
}
|
||||
ensureOldTupleIsMutable();
|
||||
oldTuple_.add(index, value);
|
||||
onChanged();
|
||||
} else {
|
||||
oldTupleBuilder_.addMessage(index, value);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* <code>repeated .decoderbufs.DatumMessage old_tuple = 6;</code>
|
||||
*/
|
||||
public Builder addOldTuple(
|
||||
io.debezium.connector.postgresql.proto.PgProto.DatumMessage.Builder builderForValue) {
|
||||
if (oldTupleBuilder_ == null) {
|
||||
ensureOldTupleIsMutable();
|
||||
oldTuple_.add(builderForValue.build());
|
||||
onChanged();
|
||||
} else {
|
||||
oldTupleBuilder_.addMessage(builderForValue.build());
|
||||
}
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* <code>repeated .decoderbufs.DatumMessage old_tuple = 6;</code>
|
||||
*/
|
||||
public Builder addOldTuple(
|
||||
int index, io.debezium.connector.postgresql.proto.PgProto.DatumMessage.Builder builderForValue) {
|
||||
if (oldTupleBuilder_ == null) {
|
||||
ensureOldTupleIsMutable();
|
||||
oldTuple_.add(index, builderForValue.build());
|
||||
onChanged();
|
||||
} else {
|
||||
oldTupleBuilder_.addMessage(index, builderForValue.build());
|
||||
}
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* <code>repeated .decoderbufs.DatumMessage old_tuple = 6;</code>
|
||||
*/
|
||||
public Builder addAllOldTuple(
|
||||
java.lang.Iterable<? extends io.debezium.connector.postgresql.proto.PgProto.DatumMessage> values) {
|
||||
if (oldTupleBuilder_ == null) {
|
||||
ensureOldTupleIsMutable();
|
||||
com.google.protobuf.AbstractMessageLite.Builder.addAll(
|
||||
values, oldTuple_);
|
||||
onChanged();
|
||||
} else {
|
||||
oldTupleBuilder_.addAllMessages(values);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* <code>repeated .decoderbufs.DatumMessage old_tuple = 6;</code>
|
||||
*/
|
||||
public Builder clearOldTuple() {
|
||||
if (oldTupleBuilder_ == null) {
|
||||
oldTuple_ = java.util.Collections.emptyList();
|
||||
bitField0_ = (bitField0_ & ~0x00000020);
|
||||
onChanged();
|
||||
} else {
|
||||
oldTupleBuilder_.clear();
|
||||
}
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* <code>repeated .decoderbufs.DatumMessage old_tuple = 6;</code>
|
||||
*/
|
||||
public Builder removeOldTuple(int index) {
|
||||
if (oldTupleBuilder_ == null) {
|
||||
ensureOldTupleIsMutable();
|
||||
oldTuple_.remove(index);
|
||||
onChanged();
|
||||
} else {
|
||||
oldTupleBuilder_.remove(index);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* <code>repeated .decoderbufs.DatumMessage old_tuple = 6;</code>
|
||||
*/
|
||||
public io.debezium.connector.postgresql.proto.PgProto.DatumMessage.Builder getOldTupleBuilder(
|
||||
int index) {
|
||||
return getOldTupleFieldBuilder().getBuilder(index);
|
||||
}
|
||||
/**
|
||||
* <code>repeated .decoderbufs.DatumMessage old_tuple = 6;</code>
|
||||
*/
|
||||
public io.debezium.connector.postgresql.proto.PgProto.DatumMessageOrBuilder getOldTupleOrBuilder(
|
||||
int index) {
|
||||
if (oldTupleBuilder_ == null) {
|
||||
return oldTuple_.get(index); } else {
|
||||
return oldTupleBuilder_.getMessageOrBuilder(index);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* <code>repeated .decoderbufs.DatumMessage old_tuple = 6;</code>
|
||||
*/
|
||||
public java.util.List<? extends io.debezium.connector.postgresql.proto.PgProto.DatumMessageOrBuilder>
|
||||
getOldTupleOrBuilderList() {
|
||||
if (oldTupleBuilder_ != null) {
|
||||
return oldTupleBuilder_.getMessageOrBuilderList();
|
||||
} else {
|
||||
return java.util.Collections.unmodifiableList(oldTuple_);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* <code>repeated .decoderbufs.DatumMessage old_tuple = 6;</code>
|
||||
*/
|
||||
public io.debezium.connector.postgresql.proto.PgProto.DatumMessage.Builder addOldTupleBuilder() {
|
||||
return getOldTupleFieldBuilder().addBuilder(
|
||||
io.debezium.connector.postgresql.proto.PgProto.DatumMessage.getDefaultInstance());
|
||||
}
|
||||
/**
|
||||
* <code>repeated .decoderbufs.DatumMessage old_tuple = 6;</code>
|
||||
*/
|
||||
public io.debezium.connector.postgresql.proto.PgProto.DatumMessage.Builder addOldTupleBuilder(
|
||||
int index) {
|
||||
return getOldTupleFieldBuilder().addBuilder(
|
||||
index, io.debezium.connector.postgresql.proto.PgProto.DatumMessage.getDefaultInstance());
|
||||
}
|
||||
/**
|
||||
* <code>repeated .decoderbufs.DatumMessage old_tuple = 6;</code>
|
||||
*/
|
||||
public java.util.List<io.debezium.connector.postgresql.proto.PgProto.DatumMessage.Builder>
|
||||
getOldTupleBuilderList() {
|
||||
return getOldTupleFieldBuilder().getBuilderList();
|
||||
}
|
||||
private com.google.protobuf.RepeatedFieldBuilder<
|
||||
io.debezium.connector.postgresql.proto.PgProto.DatumMessage, io.debezium.connector.postgresql.proto.PgProto.DatumMessage.Builder, io.debezium.connector.postgresql.proto.PgProto.DatumMessageOrBuilder>
|
||||
getOldTupleFieldBuilder() {
|
||||
if (oldTupleBuilder_ == null) {
|
||||
oldTupleBuilder_ = new com.google.protobuf.RepeatedFieldBuilder<
|
||||
io.debezium.connector.postgresql.proto.PgProto.DatumMessage, io.debezium.connector.postgresql.proto.PgProto.DatumMessage.Builder, io.debezium.connector.postgresql.proto.PgProto.DatumMessageOrBuilder>(
|
||||
oldTuple_,
|
||||
((bitField0_ & 0x00000020) == 0x00000020),
|
||||
getParentForChildren(),
|
||||
isClean());
|
||||
oldTuple_ = null;
|
||||
}
|
||||
return oldTupleBuilder_;
|
||||
}
|
||||
|
||||
// @@protoc_insertion_point(builder_scope:decoderbufs.RowMessage)
|
||||
}
|
||||
|
||||
static {
|
||||
defaultInstance = new RowMessage(true);
|
||||
defaultInstance.initFields();
|
||||
}
|
||||
|
||||
// @@protoc_insertion_point(class_scope:decoderbufs.RowMessage)
|
||||
}
|
||||
|
||||
private static final com.google.protobuf.Descriptors.Descriptor
|
||||
internal_static_decoderbufs_Point_descriptor;
|
||||
private static
|
||||
com.google.protobuf.GeneratedMessage.FieldAccessorTable
|
||||
internal_static_decoderbufs_Point_fieldAccessorTable;
|
||||
private static final com.google.protobuf.Descriptors.Descriptor
|
||||
internal_static_decoderbufs_DatumMessage_descriptor;
|
||||
private static
|
||||
com.google.protobuf.GeneratedMessage.FieldAccessorTable
|
||||
internal_static_decoderbufs_DatumMessage_fieldAccessorTable;
|
||||
private static final com.google.protobuf.Descriptors.Descriptor
|
||||
internal_static_decoderbufs_RowMessage_descriptor;
|
||||
private static
|
||||
com.google.protobuf.GeneratedMessage.FieldAccessorTable
|
||||
internal_static_decoderbufs_RowMessage_fieldAccessorTable;
|
||||
|
||||
public static com.google.protobuf.Descriptors.FileDescriptor
|
||||
getDescriptor() {
|
||||
return descriptor;
|
||||
}
|
||||
private static com.google.protobuf.Descriptors.FileDescriptor
|
||||
descriptor;
|
||||
static {
|
||||
java.lang.String[] descriptorData = {
|
||||
"\n\023pg_logicaldec.proto\022\013decoderbufs\"\035\n\005Po" +
|
||||
"int\022\t\n\001x\030\001 \002(\001\022\t\n\001y\030\002 \002(\001\"\216\002\n\014DatumMessa" +
|
||||
"ge\022\023\n\013column_name\030\001 \001(\t\022\023\n\013column_type\030\002" +
|
||||
" \001(\003\022\025\n\013datum_int32\030\003 \001(\005H\000\022\025\n\013datum_int" +
|
||||
"64\030\004 \001(\003H\000\022\025\n\013datum_float\030\005 \001(\002H\000\022\026\n\014dat" +
|
||||
"um_double\030\006 \001(\001H\000\022\024\n\ndatum_bool\030\007 \001(\010H\000\022" +
|
||||
"\026\n\014datum_string\030\010 \001(\tH\000\022\025\n\013datum_bytes\030\t" +
|
||||
" \001(\014H\000\022)\n\013datum_point\030\n \001(\0132\022.decoderbuf" +
|
||||
"s.PointH\000B\007\n\005datum\"\301\001\n\nRowMessage\022\026\n\016tra" +
|
||||
"nsaction_id\030\001 \001(\r\022\023\n\013commit_time\030\002 \001(\004\022\r",
|
||||
"\n\005table\030\003 \001(\t\022\033\n\002op\030\004 \001(\0162\017.decoderbufs." +
|
||||
"Op\022,\n\tnew_tuple\030\005 \003(\0132\031.decoderbufs.Datu" +
|
||||
"mMessage\022,\n\told_tuple\030\006 \003(\0132\031.decoderbuf" +
|
||||
"s.DatumMessage*(\n\002Op\022\n\n\006INSERT\020\000\022\n\n\006UPDA" +
|
||||
"TE\020\001\022\n\n\006DELETE\020\002B3\n&io.debezium.connecto" +
|
||||
"r.postgresql.protoB\007PgProtoH\001"
|
||||
};
|
||||
com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner =
|
||||
new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() {
|
||||
public com.google.protobuf.ExtensionRegistry assignDescriptors(
|
||||
com.google.protobuf.Descriptors.FileDescriptor root) {
|
||||
descriptor = root;
|
||||
return null;
|
||||
}
|
||||
};
|
||||
com.google.protobuf.Descriptors.FileDescriptor
|
||||
.internalBuildGeneratedFileFrom(descriptorData,
|
||||
new com.google.protobuf.Descriptors.FileDescriptor[] {
|
||||
}, assigner);
|
||||
internal_static_decoderbufs_Point_descriptor =
|
||||
getDescriptor().getMessageTypes().get(0);
|
||||
internal_static_decoderbufs_Point_fieldAccessorTable = new
|
||||
com.google.protobuf.GeneratedMessage.FieldAccessorTable(
|
||||
internal_static_decoderbufs_Point_descriptor,
|
||||
new java.lang.String[] { "X", "Y", });
|
||||
internal_static_decoderbufs_DatumMessage_descriptor =
|
||||
getDescriptor().getMessageTypes().get(1);
|
||||
internal_static_decoderbufs_DatumMessage_fieldAccessorTable = new
|
||||
com.google.protobuf.GeneratedMessage.FieldAccessorTable(
|
||||
internal_static_decoderbufs_DatumMessage_descriptor,
|
||||
new java.lang.String[] { "ColumnName", "ColumnType", "DatumInt32", "DatumInt64", "DatumFloat", "DatumDouble", "DatumBool", "DatumString", "DatumBytes", "DatumPoint", "Datum", });
|
||||
internal_static_decoderbufs_RowMessage_descriptor =
|
||||
getDescriptor().getMessageTypes().get(2);
|
||||
internal_static_decoderbufs_RowMessage_fieldAccessorTable = new
|
||||
com.google.protobuf.GeneratedMessage.FieldAccessorTable(
|
||||
internal_static_decoderbufs_RowMessage_descriptor,
|
||||
new java.lang.String[] { "TransactionId", "CommitTime", "Table", "Op", "NewTuple", "OldTuple", });
|
||||
}
|
||||
|
||||
// @@protoc_insertion_point(outer_class_scope)
|
||||
}
|
@ -39,7 +39,9 @@ private TestHelper() {
|
||||
* Obtain a replication connection instance for the given slot name.
|
||||
*
|
||||
* @param slotName the name of the logical decoding slot
|
||||
* @param dropOnClose true if the slot should be dropped upon close
|
||||
* @return the PostgresConnection instance; never null
|
||||
* @throws SQLException if there is a problem obtaining a replication connection
|
||||
*/
|
||||
public static ReplicationConnection createForReplication(String slotName, boolean dropOnClose) throws SQLException {
|
||||
return ReplicationConnection.builder(defaultJdbcConfig())
|
||||
@ -58,7 +60,7 @@ public static PostgresConnection create() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Executes a JDBC statement using the default jdbc config without autocommitting the connection
|
||||
* Executes a JDBC statement using the default jdbc config without autocommitting the connection
|
||||
*
|
||||
* @param statement an array of statement
|
||||
*/
|
||||
@ -116,7 +118,7 @@ protected static Configuration.Builder defaultConfig() {
|
||||
jdbcConfiguration.forEach((field, value) -> builder.with(PostgresConnectorConfig.DATABASE_CONFIG_PREFIX + field, value));
|
||||
return builder.with(PostgresConnectorConfig.SERVER_NAME, TEST_SERVER)
|
||||
.with(PostgresConnectorConfig.DROP_SLOT_ON_STOP, true);
|
||||
}
|
||||
}
|
||||
|
||||
protected static void executeDDL(String ddlFile) throws Exception {
|
||||
URL ddlTestFile = TestHelper.class.getClassLoader().getResource(ddlFile);
|
||||
|
@ -16,19 +16,19 @@
|
||||
*/
|
||||
public final class JdbcConnectionException extends RuntimeException {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
|
||||
private final String sqlState;
|
||||
private final int errorCode;
|
||||
|
||||
|
||||
/**
|
||||
* Creates a new exception instance, wrapping the supplied SQLException
|
||||
*
|
||||
* @param e a {@link SQLException} instance, may not be null
|
||||
*/
|
||||
public JdbcConnectionException(SQLException e) {
|
||||
this(e.getMessage(), e);
|
||||
this(e.getMessage(), e);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Creates a new exception instance, wrapping the supplied SQLException with a custom message
|
||||
*
|
||||
@ -40,20 +40,22 @@ public JdbcConnectionException(String message, SQLException e) {
|
||||
this.sqlState = e.getSQLState();
|
||||
this.errorCode = e.getErrorCode();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns the SQL state from the original exception
|
||||
*
|
||||
* @return the SQL state string
|
||||
* @see SQLException#getSQLState()
|
||||
*/
|
||||
public String getSqlState() {
|
||||
return sqlState;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns the SQL error code from the original exception
|
||||
*
|
||||
* @see SQLException#getErrorCode()
|
||||
* @return the SQL error code
|
||||
* @see SQLException#getErrorCode()
|
||||
*/
|
||||
public int getErrorCode() {
|
||||
return errorCode;
|
||||
|
22
pom.xml
22
pom.xml
@ -88,6 +88,10 @@
|
||||
<!-- Dockerfiles -->
|
||||
<docker.maintainer>Debezium community</docker.maintainer>
|
||||
|
||||
<!-- Protobuf compiler options -->
|
||||
<protobuf.input.directory>${project.basedir}/src/main/proto</protobuf.input.directory>
|
||||
<protobuf.output.directory>${project.basedir}/generated-sources</protobuf.output.directory>
|
||||
|
||||
<!--Skip long running tests by default-->
|
||||
<skipLongRunningTests>true</skipLongRunningTests>
|
||||
|
||||
@ -478,6 +482,24 @@
|
||||
<encoding>${project.build.sourceEncoding}</encoding>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>build-helper-maven-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>add-classes</id>
|
||||
<phase>generate-sources</phase>
|
||||
<goals>
|
||||
<goal>add-source</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<sources>
|
||||
<source>${protobuf.output.directory}</source>
|
||||
</sources>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-resources-plugin</artifactId>
|
||||
|
Loading…
Reference in New Issue
Block a user