mirror of
https://github.com/alibaba/canal.git
synced 2026-11-04 00:30:15 +08:00
dml类整理
This commit is contained in:
@@ -144,9 +144,9 @@ public class MessageUtil {
|
||||
dml.setTs(flatMessage.getTs());
|
||||
dml.setEs(flatMessage.getEs());
|
||||
dml.setSql(flatMessage.getSql());
|
||||
if (flatMessage.getSqlType() == null || flatMessage.getMysqlType() == null) {
|
||||
throw new RuntimeException("SqlType or mysqlType is null");
|
||||
}
|
||||
// if (flatMessage.getSqlType() == null || flatMessage.getMysqlType() == null) {
|
||||
// throw new RuntimeException("SqlType or mysqlType is null");
|
||||
// }
|
||||
List<Map<String, String>> data = flatMessage.getData();
|
||||
if (data != null) {
|
||||
dml.setData(changeRows(data, flatMessage.getSqlType(), flatMessage.getMysqlType()));
|
||||
|
||||
@@ -75,6 +75,11 @@ public class RdbAdapter implements OuterAdapter {
|
||||
rdbMapping.put(key, mappingConfig);
|
||||
}
|
||||
});
|
||||
|
||||
if (rdbMapping.isEmpty()) {
|
||||
throw new RuntimeException("No rdb adapter found for config key: " + configuration.getKey());
|
||||
}
|
||||
|
||||
for (Map.Entry<String, MappingConfig> entry : rdbMapping.entrySet()) {
|
||||
String configName = entry.getKey();
|
||||
MappingConfig mappingConfig = entry.getValue();
|
||||
@@ -89,7 +94,7 @@ public class RdbAdapter implements OuterAdapter {
|
||||
|
||||
mirrorDbConfigCache.put(StringUtils.trimToEmpty(mappingConfig.getDestination()) + "."
|
||||
+ mappingConfig.getDbMapping().getDatabase(),
|
||||
MirrorDbConfig.create(configName, mappingConfig));
|
||||
MirrorDbConfig.create(configName, mappingConfig));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user