fixed issue #1168, support filter with compareTableMetaDbAndMemory

This commit is contained in:
agapple
2018-11-25 21:01:19 +08:00
parent f7bf4ac6ff
commit cbab3fb561

View File

@@ -310,11 +310,19 @@ public class DatabaseTableMeta implements TableMetaTSDB {
boolean compareAll = true;
for (Schema schema : tmpMemoryTableMeta.getRepository().getSchemas()) {
for (String table : schema.showTables()) {
String fullName = schema + "." + table;
if (blackFilter == null || !blackFilter.filter(fullName)) {
if (filter == null || filter.filter(fullName)) {
// issue : https://github.com/alibaba/canal/issues/1168
// 在生成snapshot时重新过滤一遍
if (!compareTableMetaDbAndMemory(connection, tmpMemoryTableMeta, schema.getName(), table)) {
compareAll = false;
}
}
}
}
}
if (compareAll) {
Map<String, String> content = new HashMap<String, String>();
content.put("destination", destination);