Class Db2SourceBuilder<T>
- java.lang.Object
-
- org.apache.flink.cdc.connectors.db2.source.Db2SourceBuilder<T>
-
@PublicEvolving public class Db2SourceBuilder<T> extends Object
The builder class forDb2SourceBuilder.Db2IncrementalSourceto make it easier for the users to construct aDb2SourceBuilder.Db2IncrementalSource.Check the Java docs of each individual method to learn more about the settings to build a
Db2SourceBuilder.Db2IncrementalSource.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classDb2SourceBuilder.Db2IncrementalSource<T>TheJdbcIncrementalSourceimplementation for Db2.
-
Constructor Summary
Constructors Constructor Description Db2SourceBuilder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Db2SourceBuilder<T>assignUnboundedChunkFirst(boolean assignUnboundedChunkFirst)Whether theDb2SourceBuilder.Db2IncrementalSourceshould assign the unbounded chunks first or not during snapshot reading phase.Db2SourceBuilder.Db2IncrementalSource<T>build()Build theDb2SourceBuilder.Db2IncrementalSource.Db2SourceBuilder<T>chunkKeyColumn(String chunkKeyColumn)The chunk key of table snapshot, captured tables are split into multiple chunks by the chunk key column when read the snapshot of table.Db2SourceBuilder<T>closeIdleReaders(boolean closeIdleReaders)Whether to close idle readers at the end of the snapshot phase.Db2SourceBuilder<T>connectionPoolSize(int connectionPoolSize)The connection pool size.Db2SourceBuilder<T>connectMaxRetries(int connectMaxRetries)The max retry times to get connection.Db2SourceBuilder<T>connectTimeout(java.time.Duration connectTimeout)The maximum time that the connector should wait after trying to connect to the Db2 database server before timing out.Db2SourceBuilder<T>databaseList(String... databaseList)A required list of regular expressions that match database names to be monitored; any database name not included in the whitelist will be excluded from monitoring.Db2SourceBuilder<T>debeziumProperties(Properties properties)The Debezium Db2 connector properties.Db2SourceBuilder<T>deserializer(DebeziumDeserializationSchema<T> deserializer)The deserializer used to convert from consumedSourceRecord.Db2SourceBuilder<T>distributionFactorLower(double distributionFactorLower)The lower bound of split key evenly distribution factor, the factor is used to determine whether the table is evenly distribution or not.Db2SourceBuilder<T>distributionFactorUpper(double distributionFactorUpper)The upper bound of split key evenly distribution factor, the factor is used to determine whether the table is evenly distribution or not.Db2SourceBuilder<T>fetchSize(int fetchSize)The maximum fetch size for per poll when read table snapshot.Db2SourceBuilder<T>hostname(String hostname)Hostname of the Db2 database server.Db2SourceBuilder<T>includeSchemaChanges(boolean includeSchemaChanges)Whether theDb2SourceBuilder.Db2IncrementalSourceshould output the schema changes or not.Db2SourceBuilder<T>password(String password)Password to use when connecting to the Db2 database server.Db2SourceBuilder<T>port(int port)Integer port number of the Db2 database server.Db2SourceBuilder<T>releaseSnapshotMetadataEnabled(boolean releaseSnapshotMetadataEnabled)Whether to release the finished snapshot split metadata from the coordinator after entering the stream phase, to reduce JobManager memory pressure (FLINK-40697).Db2SourceBuilder<T>serverTimeZone(String timeZone)The session time zone in database server, e.g.Db2SourceBuilder<T>skipSnapshotBackfill(boolean skipSnapshotBackfill)Whether to skip backfill in snapshot reading phase.Db2SourceBuilder<T>splitMetaGroupSize(int splitMetaGroupSize)The group size of split meta, if the meta size exceeds the group size, the meta will be will be divided into multiple groups.Db2SourceBuilder<T>splitSize(int splitSize)The split size (number of rows) of table snapshot, captured tables are split into multiple splits when read the snapshot of table.Db2SourceBuilder<T>startupOptions(StartupOptions startupOptions)Specifies the startup options.Db2SourceBuilder<T>tableList(String... tableList)A required list of regular expressions that match fully-qualified table identifiers for tables to be monitored; any table not included in the list will be excluded from monitoring.Db2SourceBuilder<T>username(String username)Name of the Db2 database to use when connecting to the Db2 database server.
-
-
-
Method Detail
-
hostname
public Db2SourceBuilder<T> hostname(String hostname)
Hostname of the Db2 database server.
-
port
public Db2SourceBuilder<T> port(int port)
Integer port number of the Db2 database server.
-
databaseList
public Db2SourceBuilder<T> databaseList(String... databaseList)
A required list of regular expressions that match database names to be monitored; any database name not included in the whitelist will be excluded from monitoring.
-
tableList
public Db2SourceBuilder<T> tableList(String... tableList)
A required list of regular expressions that match fully-qualified table identifiers for tables to be monitored; any table not included in the list will be excluded from monitoring. Each identifier is of the form<schemaName>.<tableName>.
-
username
public Db2SourceBuilder<T> username(String username)
Name of the Db2 database to use when connecting to the Db2 database server.
-
password
public Db2SourceBuilder<T> password(String password)
Password to use when connecting to the Db2 database server.
-
serverTimeZone
public Db2SourceBuilder<T> serverTimeZone(String timeZone)
The session time zone in database server, e.g. "America/Los_Angeles". It controls how the TIMESTAMP type in Db2 converted to STRING. See more https://debezium.io/documentation/reference/1.9/connectors/db2.html#db2-temporal-types
-
splitSize
public Db2SourceBuilder<T> splitSize(int splitSize)
The split size (number of rows) of table snapshot, captured tables are split into multiple splits when read the snapshot of table.
-
splitMetaGroupSize
public Db2SourceBuilder<T> splitMetaGroupSize(int splitMetaGroupSize)
The group size of split meta, if the meta size exceeds the group size, the meta will be will be divided into multiple groups.
-
distributionFactorUpper
public Db2SourceBuilder<T> distributionFactorUpper(double distributionFactorUpper)
The upper bound of split key evenly distribution factor, the factor is used to determine whether the table is evenly distribution or not.
-
distributionFactorLower
public Db2SourceBuilder<T> distributionFactorLower(double distributionFactorLower)
The lower bound of split key evenly distribution factor, the factor is used to determine whether the table is evenly distribution or not.
-
fetchSize
public Db2SourceBuilder<T> fetchSize(int fetchSize)
The maximum fetch size for per poll when read table snapshot.
-
connectTimeout
public Db2SourceBuilder<T> connectTimeout(java.time.Duration connectTimeout)
The maximum time that the connector should wait after trying to connect to the Db2 database server before timing out.
-
connectMaxRetries
public Db2SourceBuilder<T> connectMaxRetries(int connectMaxRetries)
The max retry times to get connection.
-
connectionPoolSize
public Db2SourceBuilder<T> connectionPoolSize(int connectionPoolSize)
The connection pool size.
-
includeSchemaChanges
public Db2SourceBuilder<T> includeSchemaChanges(boolean includeSchemaChanges)
Whether theDb2SourceBuilder.Db2IncrementalSourceshould output the schema changes or not.
-
startupOptions
public Db2SourceBuilder<T> startupOptions(StartupOptions startupOptions)
Specifies the startup options.
-
chunkKeyColumn
public Db2SourceBuilder<T> chunkKeyColumn(String chunkKeyColumn)
The chunk key of table snapshot, captured tables are split into multiple chunks by the chunk key column when read the snapshot of table.
-
debeziumProperties
public Db2SourceBuilder<T> debeziumProperties(Properties properties)
The Debezium Db2 connector properties. For example, "snapshot.mode".
-
deserializer
public Db2SourceBuilder<T> deserializer(DebeziumDeserializationSchema<T> deserializer)
The deserializer used to convert from consumedSourceRecord.
-
closeIdleReaders
public Db2SourceBuilder<T> closeIdleReaders(boolean closeIdleReaders)
Whether to close idle readers at the end of the snapshot phase. This feature depends on FLIP-147: Support Checkpoints After Tasks Finished. The flink version is required to be greater than or equal to 1.14, and the configuration'execution.checkpointing.checkpoints-after-tasks-finish.enabled'needs to be set to true.See more FLIP-147: Support Checkpoints After Tasks Finished.
-
skipSnapshotBackfill
public Db2SourceBuilder<T> skipSnapshotBackfill(boolean skipSnapshotBackfill)
Whether to skip backfill in snapshot reading phase.If backfill is skipped, changes on captured tables during snapshot phase will be consumed later in redo logs reading phase instead of being merged into the snapshot.
WARNING: Skipping backfill might lead to data inconsistency because some redo logs events happened within the snapshot phase might be replayed (only at-least-once semantic is promised). For example updating an already updated value in snapshot, or deleting an already deleted entry in snapshot. These replayed redo logs events should be handled specially.
-
assignUnboundedChunkFirst
public Db2SourceBuilder<T> assignUnboundedChunkFirst(boolean assignUnboundedChunkFirst)
Whether theDb2SourceBuilder.Db2IncrementalSourceshould assign the unbounded chunks first or not during snapshot reading phase.
-
releaseSnapshotMetadataEnabled
public Db2SourceBuilder<T> releaseSnapshotMetadataEnabled(boolean releaseSnapshotMetadataEnabled)
Whether to release the finished snapshot split metadata from the coordinator after entering the stream phase, to reduce JobManager memory pressure (FLINK-40697).
-
build
public Db2SourceBuilder.Db2IncrementalSource<T> build()
Build theDb2SourceBuilder.Db2IncrementalSource.- Returns:
- a Db2ParallelSource with the settings made for this builder.
-
-