Skip to content

Commit

Permalink
[monir][mysql] Filter databases that do not need to be read
Browse files Browse the repository at this point in the history
  • Loading branch information
Paddy0523 committed May 29, 2023
1 parent c3a88f0 commit 6f133be
Showing 1 changed file with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,13 @@ public static List<TableId> listTables(JdbcConnection jdbc, RelationalTableFilte
"SHOW DATABASES",
rs -> {
while (rs.next()) {
databaseNames.add(rs.getString(1));
String databaseName = rs.getString(1);
if (tableFilters.databaseFilter().test(databaseName)){
databaseNames.add(databaseName);
LOG.info("\t including database '{}' for further processing", databaseName);
}else {
LOG.info("\t '{}' is filtered out of database capturing", databaseName);
}
}
});
LOG.info("\t list of available databases is: {}", databaseNames);
Expand All @@ -78,9 +84,9 @@ public static List<TableId> listTables(JdbcConnection jdbc, RelationalTableFilte
TableId tableId = new TableId(dbName, null, rs.getString(1));
if (tableFilters.dataCollectionFilter().isIncluded(tableId)) {
capturedTableIds.add(tableId);
LOG.info("\t including '{}' for further processing", tableId);
LOG.info("\t including table '{}' for further processing", tableId);
} else {
LOG.info("\t '{}' is filtered out of capturing", tableId);
LOG.info("\t '{}' is filtered out of table capturing", tableId);
}
}
});
Expand Down

0 comments on commit 6f133be

Please sign in to comment.