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; }
(tableFilter != null && !tableFilter.isIncluded(tableId))) { continue;
if (connectorConfig.getTableFilters().dataCollectionFilter().isIncluded(changeTable.getSourceTableId())) { return true;
(tableFilter != null && !tableFilter.isIncluded(tableId))) { continue;
if (tableFilter.isIncluded(tableIdWithCatalog)) { TableEditor editor = tables.editTable(tableId); editor.tableId(tableIdWithCatalog);
protected boolean isFilteredOut(TableId id) { return !filters.tableFilter().isIncluded(id); }
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; }
public Tables subset(TableFilter filter) { if (filter == null) return this; return lock.read(() -> { Tables result = new Tables(tableIdCaseInsensitive); tablesByTableId.forEach((tableId, table) -> { if (filter.isIncluded(tableId)) { result.overwriteTable(table); } }); return result; }); }
/** * Get the {@link Table} meta-data for the table with the given identifier, if that table exists and is * included by the filter configuration * * @param id the table identifier; may be null * @return the current table definition, or null if there is no table with the given identifier, if the identifier is null, * or if the table has been excluded by the filters */ public Table tableFor(TableId id) { return tableFilter.isIncluded(id) ? tables.forTable(id) : null; }
/** * Builds up the CDC event schema for the given table and stores it in this schema. */ protected void buildAndRegisterSchema(Table table) { if (tableFilter.isIncluded(table.id())) { TableSchema schema = schemaBuilder.create(schemaPrefix, getEnvelopeSchemaName(table), table, columnFilter, columnMappers); schemasByTableId.put(table.id(), schema); } }
protected boolean isFilteredOut(TableId id) { return !filters.tableFilter().isIncluded(id); }
@Override public void enterAlterTable(MySqlParser.AlterTableContext ctx) { final TableId tableId = parser.parseQualifiedTableId(ctx.tableName().fullId()); if (!parser.getTableFilter().isIncluded(tableId)) { LOG.debug("Ignoring ALTER TABLE statement for non-whitelisted table {}", tableId); return; } tableEditor = parser.databaseTables().editTable(tableId); if (tableEditor == null) { throw new ParsingException(null, "Trying to alter table " + tableId.toString() + ", which does not exist. Query: " + getText(ctx)); } super.enterAlterTable(ctx); }
/** * Get the {@link Table} meta-data for the table with the given identifier, if that table exists and is * included by the filter configuration * * @param id the table identifier; may be null * @return the current table definition, or null if there is no table with the given identifier, if the identifier is null, * or if the table has been excluded by the filters */ public Table tableFor(TableId id) { return tableFilter.isIncluded(id) ? tables.forTable(id) : null; }
public Tables subset(TableFilter filter) { if (filter == null) return this; return lock.read(() -> { Tables result = new Tables(tableIdCaseInsensitive); tablesByTableId.forEach((tableId, table) -> { if (filter.isIncluded(tableId)) { result.overwriteTable(table); } }); return result; }); }
/** * Builds up the CDC event schema for the given table and stores it in this schema. */ protected void buildAndRegisterSchema(Table table) { if (tableFilter.isIncluded(table.id())) { TableSchema schema = schemaBuilder.create(schemaPrefix, getEnvelopeSchemaName(table), table, columnFilter, columnMappers); schemasByTableId.put(table.id(), schema); } }