Skip to content

Commit f539f5a

Browse files
committed
checkstyle
1 parent b65efb0 commit f539f5a

File tree

1 file changed

+4
-2
lines changed
  • x-pack/plugin/mapper-exponential-histogram/src/main/java/org/elasticsearch/xpack/exponentialhistogram

1 file changed

+4
-2
lines changed

x-pack/plugin/mapper-exponential-histogram/src/main/java/org/elasticsearch/xpack/exponentialhistogram/EncodedHistogramData.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,13 @@ final class EncodedHistogramData {
4444
- write the index of the first bucket as ZigZag-VLong
4545
- write the count of the first bucket as ZigZag-VLong
4646
- for each remaining (non-empty) bucket:
47-
- if there was no empty bucket right before this bucket (the index of the bucket is exactly previousBucketIndex+1), write the count for the bucket as ZigZag-VLong
47+
- if there was no empty bucket right before this bucket (the index of the bucket is exactly previousBucketIndex+1),
48+
write the count for the bucket as ZigZag-VLong
4849
- Otherwise there is at least one empty bucket between this one and the previous one.
4950
We compute the number of empty buckets as n=currentBucketIndex-previousIndex-1 and then write -n out as
5051
ZigZag-VLong followed by the count for the bucket as ZigZag-VLong. The negation is performed to allow to
51-
distinguish whether a value represents a bucket count (positive number) or the number of empty buckets (negative number) when decoding.
52+
distinguish whether a value represents a bucket count (positive number) or the number of empty buckets (negative number)
53+
when decoding.
5254
5355
While this encoding is designed for sparse histograms, it compresses well for dense histograms too.
5456
For fully dense histograms it effectively results in encoding the index of the first bucket, followed by just an array of counts.

0 commit comments

Comments
 (0)