if (transportClient.connectedNodes().isEmpty()) { throw new RuntimeException("Elasticsearch client is not connected to any Elasticsearch nodes!");
ApproximatePercentileRanksImpl(final String name, final ImmutableList<Percentile> percents) { super(name); this.name = name; checkState(!percents.isEmpty()); TreeMap<Double, Double> map = new TreeMap<Double, Double>(); for (Percentile p : percents) { map.put(p.getValue(), p.getPercent()); } this.map = map; this.percents = percents; }
ApproximatePercentileRanksImpl(final String name, final ImmutableList<Percentile> percents) { super(name); this.name = name; checkState(!percents.isEmpty()); TreeMap<Double, Double> map = new TreeMap<Double, Double>(); for (Percentile p : percents) { map.put(p.getValue(), p.getPercent()); } this.map = map; this.percents = percents; }
ApproximatePercentilesImpl(final String name, final ImmutableList<Percentile> percentiles) { super(name); this.name = name; checkState(!percentiles.isEmpty()); TreeMap<Double, Double> map = new TreeMap<Double, Double>(); for (Percentile p : percentiles) { map.put(p.getPercent(), p.getValue()); } if (!map.containsKey(0.0)) { map.put(0.0, 0.0); } if (!map.containsKey(100.0)) { map.put(100.0, map.floorEntry(100.0).getValue()); } this.map = map; this.percentiles = percentiles; }
ApproximatePercentilesImpl(final String name, final ImmutableList<Percentile> percentiles) { super(name); this.name = name; checkState(!percentiles.isEmpty()); TreeMap<Double, Double> map = new TreeMap<Double, Double>(); for (Percentile p : percentiles) { map.put(p.getPercent(), p.getValue()); } if (!map.containsKey(0.0)) { map.put(0.0, 0.0); } if (!map.containsKey(100.0)) { map.put(100.0, map.floorEntry(100.0).getValue()); } this.map = map; this.percentiles = percentiles; }