Class MySqlCdcSources.Builder

java.lang.Object
com.hazelcast.jet.cdc.mysql.MySqlCdcSources.Builder
Enclosing class:
MySqlCdcSources

public static final class MySqlCdcSources.Builder extends Object
Builder for configuring a CDC source that streams change data from a MySQL database to Hazelcast Jet.
  • Method Details

    • setDatabaseAddress

      @Nonnull public MySqlCdcSources.Builder setDatabaseAddress(@Nonnull String address)
      IP address or hostname of the database server, has to be specified.
    • setDatabasePort

      @Nonnull public MySqlCdcSources.Builder setDatabasePort(int port)
      Optional port number of the database server, if unspecified defaults to the database specific default port (3306).
    • setDatabaseUser

      @Nonnull public MySqlCdcSources.Builder setDatabaseUser(@Nonnull String user)
      Database user for connecting to the database server. Has to be specified.
    • setDatabasePassword

      @Nonnull public MySqlCdcSources.Builder setDatabasePassword(@Nonnull String password)
      Database user password for connecting to the database server. Has to be specified.
    • setClusterName

      @Nonnull public MySqlCdcSources.Builder setClusterName(@Nonnull String cluster)
      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

      @Nonnull public MySqlCdcSources.Builder setDatabaseClientId(int clientId)
      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

      @Nonnull public MySqlCdcSources.Builder setDatabaseWhitelist(@Nonnull 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. By default all databases will be monitored. May not be used with database blacklist.
    • setDatabaseBlacklist

      @Nonnull public MySqlCdcSources.Builder setDatabaseBlacklist(@Nonnull 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. May not be used with database whitelist.
    • setTableWhitelist

      @Nonnull public MySqlCdcSources.Builder setTableWhitelist(@Nonnull 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. 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 with table blacklist.
    • setTableBlacklist

      @Nonnull public MySqlCdcSources.Builder setTableBlacklist(@Nonnull 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. Each identifier is of the form databaseName.tableName. May not be used with table whitelist.
    • setColumnBlacklist

      @Nonnull public MySqlCdcSources.Builder setColumnBlacklist(@Nonnull String... columnNameRegExps)
      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

      @Nonnull public MySqlCdcSources.Builder setSslMode(@Nonnull String mode)
      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

      @Nonnull public MySqlCdcSources.Builder setSslKeystoreFile(@Nonnull String file)
      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

      @Nonnull public MySqlCdcSources.Builder setSslKeystorePassword(@Nonnull String password)
      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

      @Nonnull public MySqlCdcSources.Builder setSslTruststoreFile(@Nonnull String file)
      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

      @Nonnull public MySqlCdcSources.Builder setSslTruststorePassword(@Nonnull String password)
      Password to unlock any specified truststore.

      Can be alternatively specified via the 'javax.net.ssl.trustStorePassword' system or JVM property.

    • setReconnectBehavior

      @Nonnull public MySqlCdcSources.Builder setReconnectBehavior(@Nonnull 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).

      Defaults to CdcSourceP.DEFAULT_RECONNECT_BEHAVIOR.

    • setShouldStateBeResetOnReconnect

      @Nonnull public MySqlCdcSources.Builder setShouldStateBeResetOnReconnect(boolean reset)
      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

      @Nonnull public StreamSource<ChangeRecord> build()
      Returns the source based on the properties set so far.