org.elasticsearch.common.collect.Maps类的使用及代码示例

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

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

Maps介绍

暂无

代码示例

代码示例来源:origin: richardwilly98/elasticsearch-river-mongodb

private void logStatistics(long duration) {
    if (definition.isStoreStatistics()) {
      long totalDocuments = deletedDocuments.get() + insertedDocuments.get();
      logger.trace("Indexed {} documents: {} insertions, {} updates, {} deletions", totalDocuments, insertedDocuments.get(),
          updatedDocuments.get(), deletedDocuments.get());
      Map<String, Object> source = new HashMap<String, Object>();
      Map<String, Object> statistics = Maps.newHashMap();
      statistics.put("duration", duration);
      statistics.put("date", new Date());
      statistics.put("index", index);
      statistics.put("type", type);
      statistics.put("documents.inserted", insertedDocuments.get());
      statistics.put("documents.updated", updatedDocuments.get());
      statistics.put("documents.deleted", deletedDocuments.get());
      statistics.put("documents.total", documentCount.get());
      source.put("statistics", statistics);
      client.prepareIndex(definition.getStatisticsIndexName(), definition.getStatisticsTypeName()).setSource(source).get();
    }
  }
}

代码示例来源:origin: com.bazaarvoice.elasticsearch.client/es-client-java-core

public static InternalAggregation fromXContent(final String name, final Map<String, Object> map, final AggregationsManifest manifest) {
    final long docCount = nodeLongValue(map.get("doc_count"));
    final Map<String, Object> subAggsMap = Maps.filterKeys(map, new Predicate<String>() {
      @Override public boolean apply(final String s) {
        return !s.equals("doc_count");
      }
    });
    final InternalAggregations aggregations = InternalAggregationsHelper.fromXContentUnwrapped(subAggsMap, manifest);
    return new InternalGlobal(name, docCount, aggregations);
  }
}

代码示例来源:origin: com.bazaarvoice.elasticsearch.client/es-client-java-core

@Override public GetResponse fromXContent(final Map<String, Object> map) {
    final Map<String, GetField> fields;
    if (map.containsKey("fields")) {
      Map<String, Object> incoming = nodeMapValue(map.get("fields"), String.class, Object.class);
      fields = Maps.newHashMapWithExpectedSize(incoming.size());
      for (Map.Entry<String, Object> entry : incoming.entrySet()) {
        if (entry.getValue() instanceof List) {
          fields.put(entry.getKey(), new GetField(entry.getKey(), nodeListValue(entry.getValue(), Object.class)));
        } else {
          fields.put(entry.getKey(), new GetField(entry.getKey(), ImmutableList.of(entry.getValue())));
        }
      }
    } else {
      fields = ImmutableMap.of();
    }

    return new GetResponse(new GetResult(
      nodeStringValue(map.get("_index")),
      nodeStringValue(map.get("_type")),
      nodeStringValue(map.get("_id")),
      nodeLongValue(map.get("_version"), -1),
      nodeBooleanValue(map.get("found"), true),
      nodeBytesReferenceValue(map.get("_source")),
      fields
    ));
  }
}

代码示例来源:origin: alien4cloud/alien4cloud

public void initWorkflows(TopologyContext topologyContext) {
  Map<String, Workflow> wfs = topologyContext.getTopology().getWorkflows();
  if (wfs == null) {
    wfs = Maps.newLinkedHashMap();
    topologyContext.getTopology().setWorkflows(wfs);
  }
  if (!wfs.containsKey(INSTALL)) {
    initStandardWorkflow(INSTALL, topologyContext);
  }
  if (!wfs.containsKey(UNINSTALL)) {
    initStandardWorkflow(UNINSTALL, topologyContext);
  }
  if (!wfs.containsKey(START)) {
    initStandardWorkflow(START, topologyContext);
  }
  if (!wfs.containsKey(STOP)) {
    initStandardWorkflow(STOP, topologyContext);
  }
  if (!wfs.containsKey(RUN)) {
    initStandardWorkflow(RUN, topologyContext);
  }
  if (!wfs.containsKey(CANCEL)) {
    initStandardWorkflow(CANCEL, topologyContext);
  }
  postProcessTopologyWorkflows(topologyContext);
}

代码示例来源:origin: com.bazaarvoice.elasticsearch.client/es-rest-client-core-1.4

public static InternalAggregation fromXContent(final String name, final Map<String, Object> map, final AggregationsManifest manifest) {
    final long docCount = nodeLongValue(map.get("doc_count"));
    final Map<String, Object> subAggsMap = Maps.filterKeys(map, new Predicate<String>() {
      @Override public boolean apply(final String s) {
        return !s.equals("doc_count");
      }
    });
    final InternalAggregations aggregations = InternalAggregationsHelper.fromXContentUnwrapped(subAggsMap, manifest);
    return new InternalGlobal(name, docCount, aggregations);
  }
}

代码示例来源:origin: com.bazaarvoice.elasticsearch.client/es-rest-client-core-1.4

@Override public GetResponse fromXContent(final Map<String, Object> map) {
    final Map<String, GetField> fields;
    if (map.containsKey("fields")) {
      Map<String, Object> incoming = nodeMapValue(map.get("fields"), String.class, Object.class);
      fields = Maps.newHashMapWithExpectedSize(incoming.size());
      for (Map.Entry<String, Object> entry : incoming.entrySet()) {
        if (entry.getValue() instanceof List) {
          fields.put(entry.getKey(), new GetField(entry.getKey(), nodeListValue(entry.getValue(), Object.class)));
        } else {
          fields.put(entry.getKey(), new GetField(entry.getKey(), ImmutableList.of(entry.getValue())));
        }
      }
    } else {
      fields = ImmutableMap.of();
    }

    //noinspection unchecked
    return new GetResponse(new GetResult(
      nodeStringValue(map.get("_index")),
      nodeStringValue(map.get("_type")),
      nodeStringValue(map.get("_id")),
      nodeLongValue(map.get("_version"), -1),
      nodeBooleanValue(map.get("found"), true),
      nodeBytesReferenceForMapValue((Map<String, ?>) map.get("_source")),
      fields
    ));
  }
}

代码示例来源:origin: alien4cloud/alien4cloud

public Workflow createWorkflow(Topology topology, String name) {
  String workflowName = getWorkflowName(topology, name, 0);
  Workflow wf = new Workflow();
  wf.setName(workflowName);
  wf.setStandard(false);
  wf.setHasCustomModifications(true);
  Map<String, Workflow> wfs = topology.getWorkflows();
  if (wfs == null) {
    wfs = Maps.newLinkedHashMap();
    topology.setWorkflows(wfs);
  }
  wfs.put(workflowName, wf);
  return wf;
}

代码示例来源:origin: apache/flume

private void appendHeaders(XContentBuilder builder, Event event)
  throws IOException {
 Map<String, String> headers = Maps.newHashMap(event.getHeaders());

代码示例来源:origin: com.bazaarvoice.elasticsearch.client/es-rest-client-core-1.4

public static InternalAggregation fromXContent(final String name, final Map<String, Object> map, final AggregationsManifest manifest) {
    final long docCount = nodeLongValue(map.get("doc_count"));
    final Map<String, Object> subAggsMap = Maps.filterKeys(map, new Predicate<String>() {
      @Override public boolean apply(final String s) {
        return !s.equals("doc_count");
      }
    });
    final InternalAggregations aggregations = InternalAggregationsHelper.fromXContentUnwrapped(subAggsMap, manifest);
    return new InternalNested(name, docCount, aggregations);
  }
}

代码示例来源:origin: alien4cloud/alien4cloud

if (node instanceof SequenceNode) {
  SequenceNode sequenceNode = (SequenceNode) node;
  Map<String, T> sequenceMap = Maps.newLinkedHashMap();
  for (Node elementNode : sequenceNode.getValue()) {
    if (elementNode instanceof MappingNode) {

代码示例来源:origin: richardwilly98/elasticsearch-river-mongodb

initalTimestampSettings.get(INITIAL_TIMESTAMP_SCRIPT_FIELD).toString(), ScriptService.ScriptType.INLINE, Maps.<String, Object>newHashMap());
Object ctx = scriptExecutable.run();
logger.trace("initialTimestamp script returned: {}", ctx);

代码示例来源:origin: com.bazaarvoice.elasticsearch.client/es-client-java-core

public static InternalAggregation fromXContent(final String name, final Map<String, Object> map, final AggregationsManifest manifest) {
    final long docCount = nodeLongValue(map.get("doc_count"));
    final Map<String, Object> subAggsMap = Maps.filterKeys(map, new Predicate<String>() {
      @Override public boolean apply(final String s) {
        return !s.equals("doc_count");
      }
    });
    final InternalAggregations aggregations = InternalAggregationsHelper.fromXContentUnwrapped(subAggsMap, manifest);

    return new InternalMissing(name, docCount, aggregations);
  }
}

代码示例来源:origin: jprante/elasticsearch-gatherer

public GathererRegistry(Map<String, Class<? extends Module>> gathererModules) {
  this.gathererModules = gathererModules;
  this.gatherers = newHashMap();
}

代码示例来源:origin: com.bazaarvoice.elasticsearch.client/es-rest-client-core-1.4

public static InternalFilters.Bucket fromXContent(final String key, final Map<String, Object> map, final AggregationsManifest manifest) {
    final long docCount = nodeLongValue(map.get(DOC_COUNT));

    final Map<String, Object> subAggsMap = Maps.filterKeys(map, new Predicate<String>() {
      @Override public boolean apply(final String s) {
        return !properKeys.contains(s);
      }
    });
    final InternalAggregations aggregations = InternalAggregationsHelper.fromXContentUnwrapped(subAggsMap, manifest);
    return new InternalFilters.Bucket(key, docCount, aggregations);
  }
}

代码示例来源:origin: meltwater/elasticsearch-batch-percolator

public BatchPercolateResponseItem(String docId){
  this.matches = Maps.newHashMap();
  this.docId = docId;
}

代码示例来源:origin: com.bazaarvoice.elasticsearch.client/es-client-java-core

public static InternalAggregation fromXContent(final String name, final Map<String, Object> map, final AggregationsManifest manifest) {
    final long docCount = nodeLongValue(map.get("doc_count"));
    final Map<String, Object> subAggsMap = Maps.filterKeys(map, new Predicate<String>() {
      @Override public boolean apply(final String s) {
        return !s.equals("doc_count");
      }
    });
    final InternalAggregations aggregations = InternalAggregationsHelper.fromXContentUnwrapped(subAggsMap, manifest);
    return new InternalChildren(name, docCount, aggregations);
  }
}

代码示例来源:origin: jprante/elasticsearch-gatherer

public PlainIndexableObject() {
  this.meta = newHashMap();
  this.source = newHashMap();
}

代码示例来源:origin: com.bazaarvoice.elasticsearch.client/es-rest-client-core-1.4

public static InternalAggregation fromXContent(final String name, final Map<String, Object> map, final AggregationsManifest manifest) {
    final long docCount = nodeLongValue(map.get("doc_count"));
    final Map<String, Object> subAggsMap = Maps.filterKeys(map, new Predicate<String>() {
      @Override public boolean apply(final String s) {
        return !s.equals("doc_count");
      }
    });
    final InternalAggregations aggregations = InternalAggregationsHelper.fromXContentUnwrapped(subAggsMap, manifest);
    return new InternalChildren(name, docCount, aggregations);
  }
}

代码示例来源:origin: meltwater/elasticsearch-batch-percolator

public QueryMatch(){
  hls = Maps.newHashMap();
}

代码示例来源:origin: com.bazaarvoice.elasticsearch.client/es-client-java-core

public static InternalAggregation fromXContent(final String name, final Map<String, Object> map, final AggregationsManifest manifest) {
    final long docCount = nodeLongValue(map.get("doc_count"));
    final Map<String, Object> subAggsMap = Maps.filterKeys(map, new Predicate<String>() {
      @Override public boolean apply(final String s) {
        return !s.equals("doc_count");
      }
    });
    final InternalAggregations aggregations = InternalAggregationsHelper.fromXContentUnwrapped(subAggsMap, manifest);
    return new InternalReverseNested(name, docCount, aggregations);
  }
}

相关文章