添加Rows过滤

This commit is contained in:
zhangyukun
2016-02-25 11:44:22 +08:00
parent 1813c1eff9
commit 652101035e

View File

@@ -84,6 +84,8 @@ public class LogEventConvert extends AbstractCanalLifeCycle implements BinlogPar
private boolean filterQueryDdl = false;
// 是否跳过table相关的解析异常,比如表不存在或者列数量不匹配,issue 92
private boolean filterTableError = false;
// 新增rows过滤,用于仅订阅除rows以外的数据
private boolean filterRows = false;
public Entry parse(LogEvent logEvent) throws CanalParseException {
if (logEvent == null || logEvent instanceof UnknownLogEvent) {
@@ -305,7 +307,7 @@ public class LogEventConvert extends AbstractCanalLifeCycle implements BinlogPar
}
private Entry parseRowsEvent(RowsLogEvent event) {
if (filterQueryDml) {
if (filterRows) {
return null;
}
try {
@@ -716,5 +718,9 @@ public class LogEventConvert extends AbstractCanalLifeCycle implements BinlogPar
public void setFilterTableError(boolean filterTableError) {
this.filterTableError = filterTableError;
}
public void setFilterRows(boolean filterRows) {
this.filterRows = filterRows;
}
}