Codota Logo
InternalMax
Code IndexAdd Codota to your IDE (free)

How to use
InternalMax
in
org.elasticsearch.search.aggregations.metrics.max

Best Java code snippets using org.elasticsearch.search.aggregations.metrics.max.InternalMax (Showing top 20 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
Charset c =
  • Codota IconString charsetName;Charset.forName(charsetName)
  • Codota IconCharset.defaultCharset()
  • Codota IconContentType contentType;contentType.getCharset()
  • Smart code suggestions by Codota
}
origin: org.elasticsearch/elasticsearch

@Override
public InternalMax doReduce(List<InternalAggregation> aggregations, ReduceContext reduceContext) {
  double max = Double.NEGATIVE_INFINITY;
  for (InternalAggregation aggregation : aggregations) {
    max = Math.max(max, ((InternalMax) aggregation).max);
  }
  return new InternalMax(name, max, format, pipelineAggregators(), getMetaData());
}
origin: SonarSource/sonarqube

  return Stream.empty();
 long lastIssueDate = (long) ((InternalMax) branchBucket.getAggregations().get("maxFuncCreatedAt")).getValue();
 return Stream.of(new ProjectStatistics(branchBucket.getKeyAsString(), count, lastIssueDate));
}))
origin: org.elasticsearch/elasticsearch

@Override
public InternalAggregation buildEmptyAggregation() {
  return new InternalMax(name, Double.NEGATIVE_INFINITY, formatter, pipelineAggregators(), metaData());
}
origin: harbby/presto-connectors

  @Override
  public InternalMax readResult(StreamInput in) throws IOException {
    InternalMax result = new InternalMax();
    result.readFrom(in);
    return result;
  }
};
origin: org.elasticsearch/elasticsearch

@Override
public InternalAggregation buildAggregation(long bucket) {
  if (valuesSource == null || bucket >= maxes.size()) {
    return buildEmptyAggregation();
  }
  return new InternalMax(name, maxes.get(bucket), formatter, pipelineAggregators(),  metaData());
}
origin: harbby/presto-connectors

@Override
public InternalMax doReduce(List<InternalAggregation> aggregations, ReduceContext reduceContext) {
  double max = Double.NEGATIVE_INFINITY;
  for (InternalAggregation aggregation : aggregations) {
    max = Math.max(max, ((InternalMax) aggregation).max);
  }
  return new InternalMax(name, max, valueFormatter, pipelineAggregators(), getMetaData());
}
origin: com.strapdata.elasticsearch/elasticsearch

@Override
public InternalAggregation buildEmptyAggregation() {
  return new InternalMax(name, Double.NEGATIVE_INFINITY, formatter, pipelineAggregators(), metaData());
}
origin: Impetus/Kundera

/**
 * Gets the aggregated result.
 * 
 * @param internalAggs
 *            the internal aggs
 * @param identifier
 *            the identifier
 * @param exp
 *            the exp
 * @return the aggregated result
 */
private Object getAggregatedResult(InternalAggregations internalAggs, String identifier, Expression exp)
{
  switch (identifier)
  {
  case Expression.MIN:
    return (((InternalMin) internalAggs.get(exp.toParsedText())).getValue());
  case Expression.MAX:
    return (((InternalMax) internalAggs.get(exp.toParsedText())).getValue());
  case Expression.AVG:
    return (((InternalAvg) internalAggs.get(exp.toParsedText())).getValue());
  case Expression.SUM:
    return (((InternalSum) internalAggs.get(exp.toParsedText())).getValue());
  case Expression.COUNT:
    return (((InternalValueCount) internalAggs.get(exp.toParsedText())).getValue());
  }
  throw new KunderaException("No support for " + identifier + " aggregation.");
}
origin: apache/servicemix-bundles

@Override
public InternalMax doReduce(List<InternalAggregation> aggregations, ReduceContext reduceContext) {
  double max = Double.NEGATIVE_INFINITY;
  for (InternalAggregation aggregation : aggregations) {
    max = Math.max(max, ((InternalMax) aggregation).max);
  }
  return new InternalMax(name, max, format, pipelineAggregators(), getMetaData());
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.elasticsearch

@Override
public InternalAggregation buildEmptyAggregation() {
  return new InternalMax(name, Double.NEGATIVE_INFINITY, formatter, pipelineAggregators(), metaData());
}
origin: com.strapdata.elasticsearch.test/framework

@Override
protected final void assertReduced(T reduced, List<T> inputs) {
  assertEquals(inputs.stream().mapToLong(InternalSingleBucketAggregation::getDocCount).sum(), reduced.getDocCount());
  if (hasInternalMax) {
    double expected = inputs.stream().mapToDouble(i -> {
          InternalMax max = i.getAggregations().get("max");
          return max.getValue();
        }).max().getAsDouble();
    InternalMax reducedMax = reduced.getAggregations().get("max");
    assertEquals(expected, reducedMax.getValue(), 0);
  }
  if (hasInternalMin) {
    double expected = inputs.stream().mapToDouble(i -> {
          InternalMin min = i.getAggregations().get("min");
          return min.getValue();
        }).min().getAsDouble();
    InternalMin reducedMin = reduced.getAggregations().get("min");
    assertEquals(expected, reducedMin.getValue(), 0);
  }
  extraAssertReduced(reduced, inputs);
}
origin: com.strapdata.elasticsearch/elasticsearch

@Override
public InternalMax doReduce(List<InternalAggregation> aggregations, ReduceContext reduceContext) {
  double max = Double.NEGATIVE_INFINITY;
  for (InternalAggregation aggregation : aggregations) {
    max = Math.max(max, ((InternalMax) aggregation).max);
  }
  return new InternalMax(name, max, format, pipelineAggregators(), getMetaData());
}
origin: harbby/presto-connectors

@Override
public InternalAggregation buildEmptyAggregation() {
  return new InternalMax(name, Double.NEGATIVE_INFINITY, formatter, pipelineAggregators(), metaData());
}
origin: org.sonarsource.sonarqube/sonar-server

  return Stream.empty();
 long lastIssueDate = (long) ((InternalMax) branchBucket.getAggregations().get("maxFuncCreatedAt")).getValue();
 return Stream.of(new ProjectStatistics(branchBucket.getKeyAsString(), count, lastIssueDate));
}))
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.elasticsearch

@Override
public InternalMax doReduce(List<InternalAggregation> aggregations, ReduceContext reduceContext) {
  double max = Double.NEGATIVE_INFINITY;
  for (InternalAggregation aggregation : aggregations) {
    max = Math.max(max, ((InternalMax) aggregation).max);
  }
  return new InternalMax(name, max, format, pipelineAggregators(), getMetaData());
}
origin: com.strapdata.elasticsearch.test/framework

@Override
public void setUp() throws Exception {
  super.setUp();
  hasInternalMax = randomBoolean();
  hasInternalMin = randomBoolean();
  subAggregationsSupplier = () -> {
    List<InternalAggregation> aggs = new ArrayList<>();
    if (hasInternalMax) {
      aggs.add(new InternalMax("max", randomDouble(), randomNumericDocValueFormat(), emptyList(), emptyMap()));
    }
    if (hasInternalMin) {
      aggs.add(new InternalMin("min", randomDouble(), randomNumericDocValueFormat(), emptyList(), emptyMap()));
    }
    return new InternalAggregations(aggs);
  };
}
origin: Anchormen/sql4es

  currentRow.set(metricCol.getIndex(), ((InternalCardinality) agg).getValue());
} else if (agg instanceof InternalMax) {
  currentRow.set(metricCol.getIndex(), ((InternalMax) agg).getValue());
} else if (agg instanceof InternalMin) {
  currentRow.set(metricCol.getIndex(), ((InternalMin) agg).getValue());
origin: com.strapdata.elasticsearch/elasticsearch

@Override
public InternalAggregation buildAggregation(long bucket) {
  if (valuesSource == null || bucket >= maxes.size()) {
    return buildEmptyAggregation();
  }
  return new InternalMax(name, maxes.get(bucket), formatter, pipelineAggregators(),  metaData());
}
origin: com.impetus.kundera.client/kundera-elastic-search

/**
 * Gets the aggregated result.
 * 
 * @param internalAggs
 *            the internal aggs
 * @param identifier
 *            the identifier
 * @param exp
 *            the exp
 * @return the aggregated result
 */
private Object getAggregatedResult(InternalAggregations internalAggs, String identifier, Expression exp)
{
  switch (identifier)
  {
  case Expression.MIN:
    return (((InternalMin) internalAggs.get(exp.toParsedText())).getValue());
  case Expression.MAX:
    return (((InternalMax) internalAggs.get(exp.toParsedText())).getValue());
  case Expression.AVG:
    return (((InternalAvg) internalAggs.get(exp.toParsedText())).getValue());
  case Expression.SUM:
    return (((InternalSum) internalAggs.get(exp.toParsedText())).getValue());
  case Expression.COUNT:
    return (((InternalValueCount) internalAggs.get(exp.toParsedText())).getValue());
  }
  throw new KunderaException("No support for " + identifier + " aggregation.");
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.elasticsearch

@Override
public InternalAggregation buildAggregation(long bucket) {
  if (valuesSource == null || bucket >= maxes.size()) {
    return buildEmptyAggregation();
  }
  return new InternalMax(name, maxes.get(bucket), formatter, pipelineAggregators(),  metaData());
}
org.elasticsearch.search.aggregations.metrics.maxInternalMax

Most used methods

  • <init>
    Read from a stream.
  • getValue
  • getMetaData
  • pipelineAggregators
  • readFrom

Popular in Java

  • Creating JSON documents from java classes using gson
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • findViewById (Activity)
  • notifyDataSetChanged (ArrayAdapter)
  • BufferedWriter (java.io)
    Wraps an existing Writer and buffers the output. Expensive interaction with the underlying reader is
  • File (java.io)
    An "abstract" representation of a file system entity identified by a pathname. The pathname may be a
  • Permission (java.security)
    Abstract class for representing access to a system resource. All permissions have a name (whose inte
  • LinkedHashMap (java.util)
    Hash table and linked list implementation of the Map interface, with predictable iteration order. Th
  • DataSource (javax.sql)
    A factory for connections to the physical data source that this DataSource object represents. An alt
  • Get (org.apache.hadoop.hbase.client)
    Used to perform Get operations on a single row. To get everything for a row, instantiate a Get objec
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now