Class MySqlCdcSources.Builder
- Enclosing class:
- MySqlCdcSources
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Returns the source based on the properties set so far.setClusterName
(String cluster) Logical name that identifies and provides a namespace for the particular database server/cluster being monitored.setColumnBlacklist
(String... columnNameRegExps) Optional regular expressions that match the fully-qualified names of columns that should be excluded from change event message values.setCustomProperty
(String key, String value) Can be used to set any property not explicitly covered by other methods or to override internal properties.setDatabaseAddress
(String address) IP address or hostname of the database server, has to be specified.setDatabaseBlacklist
(String... dbNameRegExps) Optional regular expressions that match database names to be excluded from monitoring; any database name not included in the blacklist will be monitored.setDatabaseClientId
(int clientId) A numeric ID of this database client, which must be unique across all currently-running database processes in the MySQL cluster.setDatabasePassword
(String password) Database user password for connecting to the database server.setDatabasePort
(int port) Optional port number of the database server, if unspecified defaults to the database specific default port (3306).setDatabaseUser
(String user) Database user for connecting to the database server.setDatabaseWhitelist
(String... dbNameRegExps) Optional regular expressions that match database names to be monitored; any database name not included in the whitelist will be excluded from monitoring.setReconnectBehavior
(RetryStrategy retryStrategy) Specifies how the source should behave when it detects that the backing database has been shut down (read class javadoc for details and special cases).setShouldStateBeResetOnReconnect
(boolean reset) Specifies if the source's state should be kept or discarded during reconnect attempts to the database.setSslKeystoreFile
(String file) Specifies the (path to the) Java keystore file containing the database client certificate and private key.setSslKeystorePassword
(String password) Password to access the private key from any specified keystore files.setSslMode
(String mode) Specifies whether to use an encrypted connection to the database.setSslTruststoreFile
(String file) Specifies the (path to the) Java truststore file containing the collection of trusted CA certificates.setSslTruststorePassword
(String password) Password to unlock any specified truststore.setTableBlacklist
(String... tableNameRegExps) Optional regular expressions that match fully-qualified table identifiers for tables to be excluded from monitoring; any table not included in the blacklist will be monitored.setTableWhitelist
(String... tableNameRegExps) Optional regular expressions that match fully-qualified table identifiers for tables to be monitored; any table not included in the whitelist will be excluded from monitoring.
-
Method Details
-
setDatabaseAddress
IP address or hostname of the database server, has to be specified. -
setDatabasePort
Optional port number of the database server, if unspecified defaults to the database specific default port (3306). -
setDatabaseUser
Database user for connecting to the database server. Has to be specified. -
setDatabasePassword
Database user password for connecting to the database server. Has to be specified. -
setClusterName
Logical name that identifies and provides a namespace for the particular database server/cluster being monitored. The logical name should be unique across all other connectors. Only alphanumeric characters and underscores should be used. Has to be specified. -
setDatabaseClientId
A numeric ID of this database client, which must be unique across all currently-running database processes in the MySQL cluster. This connector joins the MySQL database cluster as another server (with this unique ID) so it can read the binlog. By default, a random number is generated between 5400 and 6400, though we recommend setting an explicit value. -
setDatabaseWhitelist
Optional regular expressions that match database names to be monitored; any database name not included in the whitelist will be excluded from monitoring. By default all databases will be monitored. May not be used withdatabase blacklist
. -
setDatabaseBlacklist
Optional regular expressions that match database names to be excluded from monitoring; any database name not included in the blacklist will be monitored. May not be used withdatabase whitelist
. -
setTableWhitelist
Optional regular expressions that match fully-qualified table identifiers for tables to be monitored; any table not included in the whitelist will be excluded from monitoring. Each identifier is of the form databaseName.tableName. By default the connector will monitor every non-system table in each monitored database. May not be used withtable blacklist
. -
setTableBlacklist
Optional regular expressions that match fully-qualified table identifiers for tables to be excluded from monitoring; any table not included in the blacklist will be monitored. Each identifier is of the form databaseName.tableName. May not be used withtable whitelist
. -
setColumnBlacklist
Optional regular expressions that match the fully-qualified names of columns that should be excluded from change event message values. Fully-qualified names for columns are of the form databaseName.tableName.columnName, or databaseName.schemaName.tableName.columnName. -
setSslMode
Specifies whether to use an encrypted connection to the database. The default is disabled, and specifies to use an unencrypted connection.The preferred option establishes an encrypted connection if the server supports secure connections but falls back to an unencrypted connection otherwise.
The required option establishes an encrypted connection but will fail if one cannot be made for any reason.
The verify_ca option behaves like required but additionally it verifies the server TLS certificate against the configured Certificate Authority (CA) certificates and will fail if it doesn’t match any valid CA certificates.
The verify_identity option behaves like verify_ca but additionally verifies that the server certificate matches the host of the remote connection.
-
setSslKeystoreFile
Specifies the (path to the) Java keystore file containing the database client certificate and private key.Can be alternatively specified via the 'javax.net.ssl.keyStore' system or JVM property.
-
setSslKeystorePassword
Password to access the private key from any specified keystore files.This password is used to unlock the keystore file (store password), and to decrypt the private key stored in the keystore (key password)."
Can be alternatively specified via the 'javax.net.ssl.keyStorePassword' system or JVM property.
-
setSslTruststoreFile
Specifies the (path to the) Java truststore file containing the collection of trusted CA certificates.Can be alternatively specified via the 'javax.net.ssl.trustStore' system or JVM property.
-
setSslTruststorePassword
Password to unlock any specified truststore.Can be alternatively specified via the 'javax.net.ssl.trustStorePassword' system or JVM property.
-
setReconnectBehavior
Specifies how the source should behave when it detects that the backing database has been shut down (read class javadoc for details and special cases).Defaults to
CdcSourceP.DEFAULT_RECONNECT_BEHAVIOR
. -
setShouldStateBeResetOnReconnect
Specifies if the source's state should be kept or discarded during reconnect attempts to the database. If the state is kept, then database snapshotting should not be repeated and streaming the binlog should resume at the position where it left off. If the state is reset, then the source will behave as if it were its initial start, so will do a database snapshot and will start tailing the binlog where it syncs with the database snapshot's end. -
setCustomProperty
@Nonnull public MySqlCdcSources.Builder setCustomProperty(@Nonnull String key, @Nonnull String value) Can be used to set any property not explicitly covered by other methods or to override internal properties. -
build
Returns the source based on the properties set so far.
-