private void determineCapturedTables(SnapshotContext ctx) throws Exception { Set<TableId> allTableIds = getAllTableIds(ctx); Set<TableId> capturedTables = new HashSet<>(); for (TableId tableId : allTableIds) { if (connectorConfig.getTableFilters().dataCollectionFilter().isIncluded(tableId)) { LOGGER.trace("Adding table {} to the list of captured tables", tableId); capturedTables.add(tableId); } else { LOGGER.trace("Ignoring table {} as it's not included in the filter configuration", tableId); } } ctx.capturedTables = capturedTables; }
protected RelationalDatabaseConnectorConfig(Configuration config, String logicalName, TableFilter systemTablesFilter, TableIdToStringMapper tableIdMapper) { super(config, logicalName); if (systemTablesFilter != null && tableIdMapper != null) { this.tableFilters = new RelationalTableFilters(config, systemTablesFilter, tableIdMapper); } // handled by sub-classes for the time being else { this.tableFilters = null; } }
@Override protected void readTableStructure(ChangeEventSourceContext sourceContext, SnapshotContext snapshotContext) throws SQLException, InterruptedException { Set<String> schemas = snapshotContext.capturedTables.stream() .map(TableId::schema) .collect(Collectors.toSet()); // reading info only for the schemas we're interested in as per the set of captured tables; // while the passed table name filter alone would skip all non-included tables, reading the schema // would take much longer that way for (String schema : schemas) { if (!sourceContext.isRunning()) { throw new InterruptedException("Interrupted while reading structure of schema " + schema); } LOGGER.info("Reading structure of schema '{}'", snapshotContext.catalogName); jdbcConnection.readSchema( snapshotContext.tables, snapshotContext.catalogName, schema, connectorConfig.getTableFilters().dataCollectionFilter(), null, false ); } }
protected RelationalDatabaseConnectorConfig(Configuration config, String logicalName, TableFilter systemTablesFilter, TableIdToStringMapper tableIdMapper) { super(config, logicalName); if (systemTablesFilter != null && tableIdMapper != null) { this.tableFilters = new RelationalTableFilters(config, systemTablesFilter, tableIdMapper); } // handled by sub-classes for the time being else { this.tableFilters = null; } }
if (connectorConfig.getTableFilters().dataCollectionFilter().isIncluded(changeTable.getSourceTableId())) { return true;
public SqlServerDatabaseSchema(SqlServerConnectorConfig connectorConfig, SchemaNameAdjuster schemaNameAdjuster, TopicSelector<TableId> topicSelector, SqlServerConnection connection) { super(connectorConfig, topicSelector, connectorConfig.getTableFilters().dataCollectionFilter(), connectorConfig.getColumnFilter(), new TableSchemaBuilder( new SqlServerValueConverters(connectorConfig.getDecimalMode()), schemaNameAdjuster, SourceInfo.SCHEMA ), false); }
schema, queue, connectorConfig.getTableFilters().dataCollectionFilter(), DataChangeEvent::new);
private void determineCapturedTables(SnapshotContext ctx) throws Exception { Set<TableId> allTableIds = getAllTableIds(ctx); Set<TableId> capturedTables = new HashSet<>(); for (TableId tableId : allTableIds) { if (connectorConfig.getTableFilters().dataCollectionFilter().isIncluded(tableId)) { LOGGER.trace("Adding table {} to the list of captured tables", tableId); capturedTables.add(tableId); } else { LOGGER.trace("Ignoring table {} as it's not included in the filter configuration", tableId); } } ctx.capturedTables = capturedTables; }
@Override protected void readTableStructure(ChangeEventSourceContext sourceContext, SnapshotContext snapshotContext) throws SQLException, InterruptedException { Set<String> schemas = snapshotContext.capturedTables.stream() .map(TableId::schema) .collect(Collectors.toSet()); // reading info only for the schemas we're interested in as per the set of captured tables; // while the passed table name filter alone would skip all non-included tables, reading the schema // would take much longer that way for (String schema : schemas) { if (!sourceContext.isRunning()) { throw new InterruptedException("Interrupted while reading structure of schema " + schema); } jdbcConnection.readSchema( snapshotContext.tables, snapshotContext.catalogName, schema, connectorConfig.getTableFilters().dataCollectionFilter(), null, false ); } }
public OracleDatabaseSchema(OracleConnectorConfig connectorConfig, SchemaNameAdjuster schemaNameAdjuster, TopicSelector<TableId> topicSelector, OracleConnection connection) { super(connectorConfig, topicSelector, connectorConfig.getTableFilters().dataCollectionFilter(), null, new TableSchemaBuilder(new OracleValueConverters(connection), schemaNameAdjuster, SourceInfo.SCHEMA), connectorConfig.getTablenameCaseInsensitive()); }
connectorConfig.getTableFilters().dataCollectionFilter(), DataChangeEvent::new);