Class FlussDefaultDiscoverer
- java.lang.Object
-
- org.apache.flink.cdc.connectors.fluss.source.discover.FlussDefaultDiscoverer
-
- All Implemented Interfaces:
Serializable,AutoCloseable,ObjectIdDiscoverer<TableId>,TableDiscoverer
public class FlussDefaultDiscoverer extends Object implements TableDiscoverer
The defaultTableDiscovererfor Fluss that subscribes to tables whose fully-qualified name (formatted as"database.tableName") matches a user-provided Java regular expression.The pattern is matched against the fully-qualified name of every table across every database visible to the Fluss cluster. A single regex can therefore span multiple databases, e.g.
"source_db\\..*|audit_db\\.events_.*".Note: dots in database or table names must be escaped (e.g.
"db\\.table") because.is a regex meta-character.Configuration keys (read from the full connector configuration):
bootstrap.servers— Fluss bootstrap servers (required).table.discoverer.pattern— Java regex for matching fully-qualified table names (required).
- 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>PATTERN
-
Constructor Summary
Constructors Constructor Description FlussDefaultDiscoverer()
-
Method Summary
All Methods Static 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.static org.apache.fluss.metadata.TablePathtoTablePath(TableId tableId)Converts aTableId(two-part: schemaName.tableName) to a FlussTablePath.
-
-
-
Field Detail
-
PATTERN
public static final ConfigOption<String> PATTERN
-
-
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
-
-