Class Db2Dialect
- java.lang.Object
-
- org.apache.flink.cdc.connectors.db2.source.dialect.Db2Dialect
-
- All Implemented Interfaces:
Closeable,Serializable,AutoCloseable,DataSourceDialect<JdbcSourceConfig>,JdbcDataSourceDialect
@Experimental public class Db2Dialect extends Object implements JdbcDataSourceDialect
TheJdbcDataSourceDialectimplementation for Db2 datasource.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description Db2Dialect(Db2SourceConfig sourceConfig)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ChunkSplittercreateChunkSplitter(JdbcSourceConfig sourceConfig)Returns theChunkSplitterwhich used to split collection to splits.ChunkSplittercreateChunkSplitter(JdbcSourceConfig sourceConfig, ChunkSplitterState chunkSplitterState)FetchTask<SourceSplitBase>createFetchTask(SourceSplitBase sourceSplitBase)The fetch task used to fetch data of a snapshot split or stream split.FetchTask.ContextcreateFetchTaskContext(JdbcSourceConfig sourceConfig)The task context used for fetch task to fetch data from external systems.List<io.debezium.relational.TableId>discoverDataCollections(JdbcSourceConfig sourceConfig)Discovers the list of table to capture.Map<io.debezium.relational.TableId,io.debezium.relational.history.TableChanges.TableChange>discoverDataCollectionSchemas(JdbcSourceConfig sourceConfig)Discovers the captured tables' schema bySourceConfig.OffsetdisplayCurrentOffset(JdbcSourceConfig sourceConfig)Displays current offset from the database e.g.StringgetName()Get the name of dialect.JdbcConnectionPoolFactorygetPooledDataSourceFactory()Get a connection pool factory to create connection pool.booleanisDataCollectionIdCaseSensitive(JdbcSourceConfig sourceConfig)Check if the CollectionId is case-sensitive or not.booleanisIncludeDataCollection(JdbcSourceConfig sourceConfig, io.debezium.relational.TableId tableId)Check if the tableId is included in SourceConfig.io.debezium.jdbc.JdbcConnectionopenJdbcConnection(JdbcSourceConfig sourceConfig)Creates and opens a newJdbcConnectionbacking connection pool.io.debezium.relational.history.TableChanges.TableChangequeryTableSchema(io.debezium.jdbc.JdbcConnection jdbc, io.debezium.relational.TableId tableId)Query and build the schema of table.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.flink.cdc.connectors.base.dialect.DataSourceDialect
displayCommittedOffset, notifyCheckpointComplete
-
Methods inherited from interface org.apache.flink.cdc.connectors.base.dialect.JdbcDataSourceDialect
close
-
-
-
-
Constructor Detail
-
Db2Dialect
public Db2Dialect(Db2SourceConfig sourceConfig)
-
-
Method Detail
-
getName
public String getName()
Description copied from interface:DataSourceDialectGet the name of dialect.- Specified by:
getNamein interfaceDataSourceDialect<JdbcSourceConfig>
-
displayCurrentOffset
public Offset displayCurrentOffset(JdbcSourceConfig sourceConfig)
Description copied from interface:DataSourceDialectDisplays current offset from the database e.g. query Mysql binary logs by querySHOW MASTER STATUS.- Specified by:
displayCurrentOffsetin interfaceDataSourceDialect<JdbcSourceConfig>
-
isDataCollectionIdCaseSensitive
public boolean isDataCollectionIdCaseSensitive(JdbcSourceConfig sourceConfig)
Description copied from interface:DataSourceDialectCheck if the CollectionId is case-sensitive or not.- Specified by:
isDataCollectionIdCaseSensitivein interfaceDataSourceDialect<JdbcSourceConfig>
-
openJdbcConnection
public io.debezium.jdbc.JdbcConnection openJdbcConnection(JdbcSourceConfig sourceConfig)
Description copied from interface:JdbcDataSourceDialectCreates and opens a newJdbcConnectionbacking connection pool.- Specified by:
openJdbcConnectionin interfaceJdbcDataSourceDialect- Parameters:
sourceConfig- a basic source configuration.- Returns:
- a utility that simplifies using a JDBC connection.
-
createChunkSplitter
public ChunkSplitter createChunkSplitter(JdbcSourceConfig sourceConfig)
Description copied from interface:DataSourceDialectReturns theChunkSplitterwhich used to split collection to splits.- Specified by:
createChunkSplitterin interfaceDataSourceDialect<JdbcSourceConfig>
-
createChunkSplitter
public ChunkSplitter createChunkSplitter(JdbcSourceConfig sourceConfig, ChunkSplitterState chunkSplitterState)
- Specified by:
createChunkSplitterin interfaceDataSourceDialect<JdbcSourceConfig>
-
getPooledDataSourceFactory
public JdbcConnectionPoolFactory getPooledDataSourceFactory()
Description copied from interface:JdbcDataSourceDialectGet a connection pool factory to create connection pool.- Specified by:
getPooledDataSourceFactoryin interfaceJdbcDataSourceDialect
-
discoverDataCollections
public List<io.debezium.relational.TableId> discoverDataCollections(JdbcSourceConfig sourceConfig)
Description copied from interface:JdbcDataSourceDialectDiscovers the list of table to capture.- Specified by:
discoverDataCollectionsin interfaceDataSourceDialect<JdbcSourceConfig>- Specified by:
discoverDataCollectionsin interfaceJdbcDataSourceDialect
-
discoverDataCollectionSchemas
public Map<io.debezium.relational.TableId,io.debezium.relational.history.TableChanges.TableChange> discoverDataCollectionSchemas(JdbcSourceConfig sourceConfig)
Description copied from interface:JdbcDataSourceDialectDiscovers the captured tables' schema bySourceConfig.- Specified by:
discoverDataCollectionSchemasin interfaceDataSourceDialect<JdbcSourceConfig>- Specified by:
discoverDataCollectionSchemasin interfaceJdbcDataSourceDialect- Parameters:
sourceConfig- a basic source configuration.
-
queryTableSchema
public io.debezium.relational.history.TableChanges.TableChange queryTableSchema(io.debezium.jdbc.JdbcConnection jdbc, io.debezium.relational.TableId tableId)Description copied from interface:JdbcDataSourceDialectQuery and build the schema of table.- Specified by:
queryTableSchemain interfaceJdbcDataSourceDialect
-
createFetchTask
public FetchTask<SourceSplitBase> createFetchTask(SourceSplitBase sourceSplitBase)
Description copied from interface:DataSourceDialectThe fetch task used to fetch data of a snapshot split or stream split.- Specified by:
createFetchTaskin interfaceDataSourceDialect<JdbcSourceConfig>- Specified by:
createFetchTaskin interfaceJdbcDataSourceDialect
-
createFetchTaskContext
public FetchTask.Context createFetchTaskContext(JdbcSourceConfig sourceConfig)
The task context used for fetch task to fetch data from external systems.- Specified by:
createFetchTaskContextin interfaceDataSourceDialect<JdbcSourceConfig>- Parameters:
sourceConfig-
-
isIncludeDataCollection
public boolean isIncludeDataCollection(JdbcSourceConfig sourceConfig, io.debezium.relational.TableId tableId)
Check if the tableId is included in SourceConfig.- Specified by:
isIncludeDataCollectionin interfaceDataSourceDialect<JdbcSourceConfig>- Parameters:
sourceConfig-tableId-
-
-