mirror of
https://github.com/alibaba/canal.git
synced 2026-11-04 00:30:15 +08:00
merge code and format
This commit is contained in:
@@ -132,14 +132,14 @@ public class ESConnection {
|
|||||||
logger.error(e.getMessage(), e);
|
logger.error(e.getMessage(), e);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 通过别名查询mapping返回的是真实索引名称,mappings.get(index)返回null,为兼容别名情况修改如下:
|
// 通过别名查询mapping返回的是真实索引名称,mappings.get(index)返回null,为兼容别名情况修改如下:
|
||||||
mappingMetaData = mappings.get(index);
|
mappingMetaData = mappings.get(index);
|
||||||
if (mappingMetaData == null && !mappings.isEmpty()) {
|
if (mappingMetaData == null && !mappings.isEmpty()) {
|
||||||
// 如果通过索引名找不到,可能是别名,取第一个映射
|
// 如果通过索引名找不到,可能是别名,取第一个映射
|
||||||
mappingMetaData = mappings.values().iterator().next();
|
mappingMetaData = mappings.values().iterator().next();
|
||||||
}
|
}
|
||||||
|
|
||||||
// 如果还是null,说明索引不存在或没有mapping
|
// 如果还是null,说明索引不存在或没有mapping
|
||||||
if (mappingMetaData == null) {
|
if (mappingMetaData == null) {
|
||||||
throw new IllegalArgumentException("Not found the mapping info of index: " + index);
|
throw new IllegalArgumentException("Not found the mapping info of index: " + index);
|
||||||
|
|||||||
@@ -142,14 +142,14 @@ public class ESConnection {
|
|||||||
logger.error(e.getMessage(), e);
|
logger.error(e.getMessage(), e);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 通过别名查询mapping返回的是真实索引名称,mappings.get(index)返回null,为兼容别名情况修改如下:
|
// 通过别名查询mapping返回的是真实索引名称,mappings.get(index)返回null,为兼容别名情况修改如下:
|
||||||
mappingMetaData = mappings.get(index);
|
mappingMetaData = mappings.get(index);
|
||||||
if (mappingMetaData == null && !mappings.isEmpty()) {
|
if (mappingMetaData == null && !mappings.isEmpty()) {
|
||||||
// 如果通过索引名找不到,可能是别名,取第一个映射
|
// 如果通过索引名找不到,可能是别名,取第一个映射
|
||||||
mappingMetaData = mappings.values().iterator().next();
|
mappingMetaData = mappings.values().iterator().next();
|
||||||
}
|
}
|
||||||
|
|
||||||
// 如果还是null,说明索引不存在或没有mapping
|
// 如果还是null,说明索引不存在或没有mapping
|
||||||
if (mappingMetaData == null) {
|
if (mappingMetaData == null) {
|
||||||
throw new IllegalArgumentException("Not found the mapping info of index: " + index);
|
throw new IllegalArgumentException("Not found the mapping info of index: " + index);
|
||||||
|
|||||||
Reference in New Issue
Block a user