Tabnine Logo
InternalMax
Code IndexAdd Tabnine 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)

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

  • Running tasks concurrently on multiple threads
  • findViewById (Activity)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • getExternalFilesDir (Context)
  • File (java.io)
    An "abstract" representation of a file system entity identified by a pathname. The pathname may be a
  • UnknownHostException (java.net)
    Thrown when a hostname can not be resolved.
  • Collections (java.util)
    This class consists exclusively of static methods that operate on or return collections. It contains
  • TimeZone (java.util)
    TimeZone represents a time zone offset, and also figures out daylight savings. Typically, you get a
  • JPanel (javax.swing)
  • Reflections (org.reflections)
    Reflections one-stop-shop objectReflections scans your classpath, indexes the metadata, allows you t
  • From CI to AI: The AI layer in your organization
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now