Class JdbcTableDiscoverer
- java.lang.Object
-
- org.apache.flink.cdc.common.source.discover.JdbcTableDiscoverer
-
- All Implemented Interfaces:
Serializable,AutoCloseable,ObjectIdDiscoverer<TableId>,TableDiscoverer
public class JdbcTableDiscoverer extends Object implements TableDiscoverer
ATableDiscovererthat reads the list of subscribed tables from a JDBC database.- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.flink.cdc.common.source.discover.ObjectIdDiscoverer
ObjectIdDiscoverer.Context
-
-
Field Summary
Fields Modifier and Type Field Description static ConfigOption<String>COLUMN_NAMEstatic ConfigOption<String>JDBC_URLstatic ConfigOption<String>PASSWORDstatic ConfigOption<String>SUBSCRIBE_IDstatic ConfigOption<String>SUBSCRIBE_ID_COLUMNstatic ConfigOption<String>SUBSCRIBE_QUERYstatic ConfigOption<String>TABLE_NAMEstatic ConfigOption<String>USERNAME
-
Constructor Summary
Constructors Constructor Description JdbcTableDiscoverer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Closes this discoverer and releases any resources.Set<TableId>discover()Discovers and returns the complete current set of object identifiers selected by the caller configuration.voidopen(ObjectIdDiscoverer.Context context)Opens this discoverer and initializes any resources needed for discovery.
-
-
-
Field Detail
-
JDBC_URL
public static final ConfigOption<String> JDBC_URL
-
USERNAME
public static final ConfigOption<String> USERNAME
-
PASSWORD
public static final ConfigOption<String> PASSWORD
-
SUBSCRIBE_QUERY
public static final ConfigOption<String> SUBSCRIBE_QUERY
-
TABLE_NAME
public static final ConfigOption<String> TABLE_NAME
-
COLUMN_NAME
public static final ConfigOption<String> COLUMN_NAME
-
SUBSCRIBE_ID_COLUMN
public static final ConfigOption<String> SUBSCRIBE_ID_COLUMN
-
SUBSCRIBE_ID
public static final ConfigOption<String> SUBSCRIBE_ID
-
-
Method Detail
-
open
public void open(ObjectIdDiscoverer.Context context) throws Exception
Description copied from interface:ObjectIdDiscovererOpens this discoverer and initializes any resources needed for discovery.- Specified by:
openin interfaceObjectIdDiscoverer<TableId>- Throws:
Exception
-
discover
public Set<TableId> discover() throws Exception
Description copied from interface:ObjectIdDiscovererDiscovers and returns the complete current set of object identifiers selected by the caller configuration.A successful result is authoritative: identifiers absent from it are no longer selected, and an empty result selects no identifiers. A failed discovery does not describe a new set.
- Specified by:
discoverin interfaceObjectIdDiscoverer<TableId>- Throws:
Exception
-
close
public void close() throws ExceptionDescription copied from interface:ObjectIdDiscovererCloses this discoverer and releases any resources.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceObjectIdDiscoverer<TableId>- Throws:
Exception
-
-