eventmesh-connectors/eventmesh-connector-jdbc/src/main/java/org/apache/eventmesh/connector/jdbc/source/AbstractEngine.java [62:111]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    protected Set<TableId> calculateNeedHandleTable() {
        // Get the database and table include and exclude lists from the connector configuration
        List<String> databaseIncludeList = sourceConnectorConfig.getDatabaseIncludeList();

        // If the database include list is empty, get a list of all databases and use that as the include list
        if (CollectionUtils.isEmpty(databaseIncludeList)) {
            List<String> allDatabases = databaseDialect.listDatabases();
            databaseIncludeList = new ArrayList<>(allDatabases);
        }
        Set<String> defaultExcludeDatabase = defaultExcludeDatabase();
        if (CollectionUtils.isNotEmpty(defaultExcludeDatabase)) {
            databaseIncludeList.removeAll(defaultExcludeDatabase);
        }

        List<String> databaseExcludeList = sourceConnectorConfig.getDatabaseExcludeList();
        // Remove the default excluded databases from the include list
        if (CollectionUtils.isNotEmpty(databaseExcludeList)) {
            databaseIncludeList.removeAll(databaseExcludeList);
        }

        List<String> tableIncludeList = sourceConnectorConfig.getTableIncludeList();
        // Create a list of included tables based on the table include list
        List<TableId> includeTableList = new ArrayList<>();
        if (CollectionUtils.isNotEmpty(tableIncludeList)) {
            List<TableId> tableIdList = buildTableId(tableIncludeList);
            includeTableList.addAll(tableIdList);
        }

        // If the table include list is empty, get a list of all tables for each database in the include list
        if (CollectionUtils.isEmpty(tableIncludeList)) {
            for (String database : databaseIncludeList) {
                try {
                    List<TableId> tableIds = databaseDialect.listTables(database);
                    includeTableList.addAll(tableIds);
                } catch (SQLException e) {
                    log.warn("List database[{}] table error", database, e);
                }
            }
        }

        List<String> tableExcludeList = sourceConnectorConfig.getTableExcludeList();
        // Remove any tables in the exclude list from the included tables list
        if (CollectionUtils.isNotEmpty(tableExcludeList)) {
            includeTableList.removeAll(buildTableId(tableExcludeList));
        }

        includeDatabaseTable.addAll(includeTableList);

        return includeDatabaseTable;
    }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



eventmesh-connectors/eventmesh-connector-jdbc/src/main/java/org/apache/eventmesh/connector/jdbc/source/dialect/cdc/AbstractCdcEngine.java [69:118]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    protected Set<TableId> calculateNeedHandleTable() {
        // Get the database and table include and exclude lists from the connector configuration
        List<String> databaseIncludeList = sourceConnectorConfig.getDatabaseIncludeList();

        // If the database include list is empty, get a list of all databases and use that as the include list
        if (CollectionUtils.isEmpty(databaseIncludeList)) {
            List<String> allDatabases = databaseDialect.listDatabases();
            databaseIncludeList = new ArrayList<>(allDatabases);
        }
        Set<String> defaultExcludeDatabase = defaultExcludeDatabase();
        if (CollectionUtils.isNotEmpty(defaultExcludeDatabase)) {
            databaseIncludeList.removeAll(defaultExcludeDatabase);
        }

        List<String> databaseExcludeList = sourceConnectorConfig.getDatabaseExcludeList();
        // Remove the default excluded databases from the include list
        if (CollectionUtils.isNotEmpty(databaseExcludeList)) {
            databaseIncludeList.removeAll(databaseExcludeList);
        }

        List<String> tableIncludeList = sourceConnectorConfig.getTableIncludeList();
        // Create a list of included tables based on the table include list
        List<TableId> includeTableList = new ArrayList<>();
        if (CollectionUtils.isNotEmpty(tableIncludeList)) {
            List<TableId> tableIdList = buildTableId(tableIncludeList);
            includeTableList.addAll(tableIdList);
        }

        // If the table include list is empty, get a list of all tables for each database in the include list
        if (CollectionUtils.isEmpty(tableIncludeList)) {
            for (String database : databaseIncludeList) {
                try {
                    List<TableId> tableIds = databaseDialect.listTables(database);
                    includeTableList.addAll(tableIds);
                } catch (SQLException e) {
                    log.warn("List database[{}] table error", database, e);
                }
            }
        }

        List<String> tableExcludeList = sourceConnectorConfig.getTableExcludeList();
        // Remove any tables in the exclude list from the included tables list
        if (CollectionUtils.isNotEmpty(tableExcludeList)) {
            includeTableList.removeAll(buildTableId(tableExcludeList));
        }

        includeDatabaseTable.addAll(includeTableList);

        return includeDatabaseTable;
    }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



