Skip to content

Commit 5ea858c

Browse files
committed
Fix javadoc
1 parent 95ce81a commit 5ea858c

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

x-pack/plugin/analytics/src/main/java/org/elasticsearch/xpack/analytics/mapper/ParsedHistogramConverter.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,25 +17,25 @@ public class ParsedHistogramConverter {
1717
/**
1818
* Converts exponential histograms to t-digests using the very same algorithm as the built-in OTLP metrics endpoint.
1919
*
20-
* @param exponential
21-
* @return
20+
* @param expHisto the exponential histogram to convert
21+
* @return the resulting t-digest histogram
2222
*/
23-
public static HistogramParser.ParsedHistogram exponentialToTDigest(ExponentialHistogramParser.ParsedExponentialHistogram exponential) {
23+
public static HistogramParser.ParsedHistogram exponentialToTDigest(ExponentialHistogramParser.ParsedExponentialHistogram expHisto) {
2424
// We don't want to reuse the code across the OTLP intake an the field mappers because they use different data models
2525
// and shuffling the data into a common format or interface would be more expensive and complex than just duplicating the logic.
2626
List<Double> centroids = new ArrayList<>(); // sorted from descending to ascending
2727
List<Long> counts = new ArrayList<>();
2828

29-
List<IndexWithCount> neg = exponential.negativeBuckets();
29+
List<IndexWithCount> neg = expHisto.negativeBuckets();
3030
for (int i = neg.size() - 1; i >= 0; i--) {
31-
appendBucketCentroid(centroids, counts, neg.get(i), exponential.scale(), -1);
31+
appendBucketCentroid(centroids, counts, neg.get(i), expHisto.scale(), -1);
3232
}
33-
if (exponential.zeroCount() > 0) {
33+
if (expHisto.zeroCount() > 0) {
3434
centroids.add(0.0);
35-
counts.add(exponential.zeroCount());
35+
counts.add(expHisto.zeroCount());
3636
}
37-
for (IndexWithCount positiveBucket : exponential.positiveBuckets()) {
38-
appendBucketCentroid(centroids, counts, positiveBucket, exponential.scale(), 1);
37+
for (IndexWithCount positiveBucket : expHisto.positiveBuckets()) {
38+
appendBucketCentroid(centroids, counts, positiveBucket, expHisto.scale(), 1);
3939
}
4040
assert centroids.size() == counts.size();
4141
assert centroids.stream().sorted().toList().equals(centroids);

0 commit comments

Comments
 (0)