protected static class PostgresReplicationConnection.ReplicationConnectionBuilder extends Object implements ReplicationConnection.Builder
| Modifier and Type | Field and Description |
|---|---|
private Configuration |
config |
private boolean |
dropSlotOnClose |
private boolean |
exportSnapshot |
private PostgresConnectorConfig.LogicalDecoder |
plugin |
private String |
publicationName |
private PostgresSchema |
schema |
private String |
slotName |
private Properties |
slotStreamParams |
private Duration |
statusUpdateIntervalVal |
private TypeRegistry |
typeRegistry |
DEFAULT_DROP_SLOT_ON_CLOSE, DEFAULT_EXPORT_SNAPSHOT, DEFAULT_PUBLICATION_NAME, DEFAULT_SLOT_NAME| Modifier | Constructor and Description |
|---|---|
protected |
ReplicationConnectionBuilder(Configuration config) |
| Modifier and Type | Method and Description |
|---|---|
ReplicationConnection |
build()
Creates a new
ReplicationConnection instance |
PostgresReplicationConnection.ReplicationConnectionBuilder |
dropSlotOnClose(boolean dropSlotOnClose)
Whether or not to drop the replication slot once the replication connection closes
|
ReplicationConnection.Builder |
exportSnapshotOnCreate(boolean exportSnapshot)
Whether or not to export the snapshot when creating the slot
|
PostgresReplicationConnection.ReplicationConnectionBuilder |
statusUpdateInterval(Duration statusUpdateInterval)
The number of milli-seconds the replication connection should periodically send updates to the server.
|
PostgresReplicationConnection.ReplicationConnectionBuilder |
streamParams(String slotStreamParams)
Optional parameters to pass to the logical decoder when the stream starts.
|
PostgresReplicationConnection.ReplicationConnectionBuilder |
withPlugin(PostgresConnectorConfig.LogicalDecoder plugin)
Sets the instance for the PG logical decoding plugin
|
ReplicationConnection.Builder |
withPublication(String publicationName)
Sets the publication name for the PG logical publication
|
ReplicationConnection.Builder |
withSchema(PostgresSchema schema)
Sets the schema instance
|
PostgresReplicationConnection.ReplicationConnectionBuilder |
withSlot(String slotName)
Sets the name for the PG logical replication slot
|
ReplicationConnection.Builder |
withTypeRegistry(TypeRegistry typeRegistry) |
private final Configuration config
private String slotName
private String publicationName
private PostgresConnectorConfig.LogicalDecoder plugin
private boolean dropSlotOnClose
private Duration statusUpdateIntervalVal
private boolean exportSnapshot
private TypeRegistry typeRegistry
private PostgresSchema schema
private Properties slotStreamParams
protected ReplicationConnectionBuilder(Configuration config)
public PostgresReplicationConnection.ReplicationConnectionBuilder withSlot(String slotName)
ReplicationConnection.BuilderwithSlot in interface ReplicationConnection.BuilderslotName - the name of the slot, may not be null.ReplicationConnection.Builder.DEFAULT_SLOT_NAMEpublic ReplicationConnection.Builder withPublication(String publicationName)
ReplicationConnection.BuilderwithPublication in interface ReplicationConnection.BuilderpublicationName - the name of the publication, may not be null.ReplicationConnection.Builder.DEFAULT_PUBLICATION_NAMEpublic PostgresReplicationConnection.ReplicationConnectionBuilder withPlugin(PostgresConnectorConfig.LogicalDecoder plugin)
ReplicationConnection.BuilderwithPlugin in interface ReplicationConnection.Builder#PROTOBUF_PLUGIN_NAMEpublic PostgresReplicationConnection.ReplicationConnectionBuilder dropSlotOnClose(boolean dropSlotOnClose)
ReplicationConnection.BuilderdropSlotOnClose in interface ReplicationConnection.BuilderdropSlotOnClose - true if the slot should be dropped once the connection is closed, false otherwiseReplicationConnection.Builder.DEFAULT_DROP_SLOT_ON_CLOSEpublic PostgresReplicationConnection.ReplicationConnectionBuilder streamParams(String slotStreamParams)
ReplicationConnection.BuilderstreamParams in interface ReplicationConnection.BuilderslotStreamParams - String of key and value pairs declared with "=". Pairs are separated by ";".
Example: "add-tables=public.table,public.table2;include-lsn=true"#STREAM_PARAMSpublic PostgresReplicationConnection.ReplicationConnectionBuilder statusUpdateInterval(Duration statusUpdateInterval)
ReplicationConnection.BuilderstatusUpdateInterval in interface ReplicationConnection.BuilderstatusUpdateInterval - a duration; null or non-positive value causes Postgres' default to be appliedpublic ReplicationConnection.Builder exportSnapshotOnCreate(boolean exportSnapshot)
ReplicationConnection.BuilderexportSnapshotOnCreate in interface ReplicationConnection.BuilderexportSnapshot - true if a snapshot should be exported, false if otherwiseReplicationConnection.Builder.DEFAULT_EXPORT_SNAPSHOTpublic ReplicationConnection build()
ReplicationConnection.BuilderReplicationConnection instancebuild in interface ReplicationConnection.Builderpublic ReplicationConnection.Builder withTypeRegistry(TypeRegistry typeRegistry)
withTypeRegistry in interface ReplicationConnection.Builderpublic ReplicationConnection.Builder withSchema(PostgresSchema schema)
ReplicationConnection.BuilderwithSchema in interface ReplicationConnection.Builderschema - the schema, must not be nullCopyright © 2019 JBoss by Red Hat. All rights reserved.