protected static class PostgresReplicationConnection.ReplicationConnectionBuilder extends Object implements ReplicationConnection.Builder
| Modifier and Type | Field and Description |
|---|---|
private Configuration |
config |
private boolean |
doSnapshot |
private boolean |
dropSlotOnClose |
private boolean |
exportSnapshot |
private PostgresConnectorConfig.LogicalDecoder |
plugin |
private PostgresConnectorConfig.AutoCreateMode |
publicationAutocreateMode |
private String |
publicationName |
private PostgresSchema |
schema |
private String |
slotName |
private Properties |
slotStreamParams |
private Duration |
statusUpdateIntervalVal |
private RelationalTableFilters |
tableFilter |
private PostgresConnectorConfig.TruncateHandlingMode |
truncateHandlingMode |
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 |
ReplicationConnection.Builder |
doSnapshot(boolean doSnapshot)
Whether or not the snapshot is executed
|
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 |
withPublicationAutocreateMode(PostgresConnectorConfig.AutoCreateMode publicationAutocreateMode)
Sets the publication autocreate mode 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 |
withTableFilter(RelationalTableFilters tableFilter)
Sets the publication tables to watch for the PG logical publication
|
ReplicationConnection.Builder |
withTruncateHandlingMode(PostgresConnectorConfig.TruncateHandlingMode truncateHandlingMode)
Sets the instance for the Truncate handling mode
|
ReplicationConnection.Builder |
withTypeRegistry(TypeRegistry typeRegistry) |
private final Configuration config
private String slotName
private String publicationName
private RelationalTableFilters tableFilter
private PostgresConnectorConfig.AutoCreateMode publicationAutocreateMode
private PostgresConnectorConfig.LogicalDecoder plugin
private PostgresConnectorConfig.TruncateHandlingMode truncateHandlingMode
private boolean dropSlotOnClose
private Duration statusUpdateIntervalVal
private boolean exportSnapshot
private boolean doSnapshot
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 ReplicationConnection.Builder withTableFilter(RelationalTableFilters tableFilter)
ReplicationConnection.BuilderwithTableFilter in interface ReplicationConnection.BuildertableFilter - the configured table filters#config.getTableFilters()public ReplicationConnection.Builder withPublicationAutocreateMode(PostgresConnectorConfig.AutoCreateMode publicationAutocreateMode)
ReplicationConnection.BuilderwithPublicationAutocreateMode in interface ReplicationConnection.BuilderpublicationAutocreateMode - the name of the publication, may not be null.#PostgresConnectorConfig.PublicationAutocreateMode.ALL_TABLESpublic PostgresReplicationConnection.ReplicationConnectionBuilder withPlugin(PostgresConnectorConfig.LogicalDecoder plugin)
ReplicationConnection.BuilderwithPlugin in interface ReplicationConnection.Builder#PROTOBUF_PLUGIN_NAMEpublic ReplicationConnection.Builder withTruncateHandlingMode(PostgresConnectorConfig.TruncateHandlingMode truncateHandlingMode)
ReplicationConnection.BuilderwithTruncateHandlingMode in interface ReplicationConnection.BuildertruncateHandlingMode - Truncate handling mode, may not be null.PostgresConnectorConfig.TruncateHandlingModepublic 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.Builder doSnapshot(boolean doSnapshot)
ReplicationConnection.BuilderdoSnapshot in interface ReplicationConnection.BuilderdoSnapshot - true if a snapshot is going to be executed, false if otherwisepublic 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 © 2021 JBoss by Red Hat. All rights reserved.