org.elasticsearch.cluster.metadata.MappingMetaData.initMappers()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(5.2k)|赞(0)|评价(0)|浏览(73)

本文整理了Java中org.elasticsearch.cluster.metadata.MappingMetaData.initMappers()方法的一些代码示例,展示了MappingMetaData.initMappers()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。MappingMetaData.initMappers()方法的具体详情如下:
包路径:org.elasticsearch.cluster.metadata.MappingMetaData
类名称:MappingMetaData
方法名:initMappers

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);
}

相关文章