|
@@ -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;
|
|
|
+ }
|
|
|
|
|
|
}
|