本文整理了Java中org.elasticsearch.cluster.metadata.MappingMetaData.initMappers()
方法的一些代码示例,展示了MappingMetaData.initMappers()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。MappingMetaData.initMappers()
方法的具体详情如下:
包路径:org.elasticsearch.cluster.metadata.MappingMetaData
类名称:MappingMetaData
方法名:initMappers
暂无
代码示例来源:origin: org.elasticsearch/elasticsearch
public MappingMetaData(CompressedXContent mapping) throws IOException {
this.source = mapping;
Map<String, Object> mappingMap = XContentHelper.convertToMap(mapping.compressedReference(), true).v2();
if (mappingMap.size() != 1) {
throw new IllegalStateException("Can't derive type from mapping, no root type: " + mapping.string());
}
this.type = mappingMap.keySet().iterator().next();
initMappers((Map<String, Object>) mappingMap.get(this.type));
}
代码示例来源:origin: org.elasticsearch/elasticsearch
public MappingMetaData(String type, Map<String, Object> mapping) throws IOException {
this.type = type;
XContentBuilder mappingBuilder = XContentFactory.jsonBuilder().map(mapping);
this.source = new CompressedXContent(BytesReference.bytes(mappingBuilder));
Map<String, Object> withoutType = mapping;
if (mapping.size() == 1 && mapping.containsKey(type)) {
withoutType = (Map<String, Object>) mapping.get(type);
}
initMappers(withoutType);
}
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.elasticsearch
public MappingMetaData(CompressedXContent mapping) throws IOException {
this.source = mapping;
Map<String, Object> mappingMap = XContentHelper.convertToMap(mapping.compressedReference(), true).v2();
if (mappingMap.size() != 1) {
throw new IllegalStateException("Can't derive type from mapping, no root type: " + mapping.string());
}
this.type = mappingMap.keySet().iterator().next();
initMappers((Map<String, Object>) mappingMap.get(this.type));
}
代码示例来源:origin: apache/servicemix-bundles
public MappingMetaData(CompressedXContent mapping) throws IOException {
this.source = mapping;
Map<String, Object> mappingMap = XContentHelper.convertToMap(mapping.compressedReference(), true).v2();
if (mappingMap.size() != 1) {
throw new IllegalStateException("Can't derive type from mapping, no root type: " + mapping.string());
}
this.type = mappingMap.keySet().iterator().next();
initMappers((Map<String, Object>) mappingMap.get(this.type));
}
代码示例来源:origin: com.strapdata.elasticsearch/elasticsearch
public MappingMetaData(CompressedXContent mapping) throws IOException {
this.source = mapping;
Map<String, Object> mappingMap = XContentHelper.convertToMap(mapping.compressedReference(), true).v2();
if (mappingMap.size() != 1) {
throw new IllegalStateException("Can't derive type from mapping, no root type: " + mapping.string());
}
this.type = mappingMap.keySet().iterator().next();
initMappers((Map<String, Object>) mappingMap.get(this.type));
}
代码示例来源:origin: harbby/presto-connectors
public MappingMetaData(CompressedXContent mapping) throws IOException {
this.source = mapping;
Map<String, Object> mappingMap;
try (XContentParser parser = XContentHelper.createParser(mapping.compressedReference())) {
mappingMap = parser.mapOrdered();
}
if (mappingMap.size() != 1) {
throw new IllegalStateException("Can't derive type from mapping, no root type: " + mapping.string());
}
this.type = mappingMap.keySet().iterator().next();
initMappers((Map<String, Object>) mappingMap.get(this.type));
}
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.elasticsearch
public MappingMetaData(String type, Map<String, Object> mapping) throws IOException {
this.type = type;
XContentBuilder mappingBuilder = XContentFactory.jsonBuilder().map(mapping);
this.source = new CompressedXContent(BytesReference.bytes(mappingBuilder));
Map<String, Object> withoutType = mapping;
if (mapping.size() == 1 && mapping.containsKey(type)) {
withoutType = (Map<String, Object>) mapping.get(type);
}
initMappers(withoutType);
}
代码示例来源:origin: harbby/presto-connectors
public MappingMetaData(String type, Map<String, Object> mapping) throws IOException {
this.type = type;
XContentBuilder mappingBuilder = XContentFactory.jsonBuilder().map(mapping);
this.source = new CompressedXContent(mappingBuilder.bytes());
Map<String, Object> withoutType = mapping;
if (mapping.size() == 1 && mapping.containsKey(type)) {
withoutType = (Map<String, Object>) mapping.get(type);
}
initMappers(withoutType);
}
代码示例来源:origin: com.strapdata.elasticsearch/elasticsearch
public MappingMetaData(String type, Map<String, Object> mapping) throws IOException {
this.type = type;
XContentBuilder mappingBuilder = XContentFactory.jsonBuilder().map(mapping);
this.source = new CompressedXContent(mappingBuilder.bytes());
Map<String, Object> withoutType = mapping;
if (mapping.size() == 1 && mapping.containsKey(type)) {
withoutType = (Map<String, Object>) mapping.get(type);
}
initMappers(withoutType);
}
代码示例来源:origin: apache/servicemix-bundles
public MappingMetaData(String type, Map<String, Object> mapping) throws IOException {
this.type = type;
XContentBuilder mappingBuilder = XContentFactory.jsonBuilder().map(mapping);
this.source = new CompressedXContent(BytesReference.bytes(mappingBuilder));
Map<String, Object> withoutType = mapping;
if (mapping.size() == 1 && mapping.containsKey(type)) {
withoutType = (Map<String, Object>) mapping.get(type);
}
initMappers(withoutType);
}
内容来源于网络,如有侵权,请联系作者删除!