Skip to content

Commit 454a9cc

Browse files
committed
Remove dead code
1 parent cab3fdf commit 454a9cc

File tree

4 files changed

+5
-27
lines changed

4 files changed

+5
-27
lines changed

libs/exponential-histogram/src/main/java/org/elasticsearch/exponentialhistogram/ExponentialHistogram.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public interface ExponentialHistogram {
4040
// One option would be to use "Quadruple": https://github.com/m-vokhm/Quadruple
4141
int MAX_SCALE = 38;
4242

43-
// Add this scale all double values already fall into a single bucket
43+
// At this scale all double values already fall into a single bucket
4444
int MIN_SCALE = -11;
4545

4646
// Only use 62 bit at max to allow to compute the difference between the smallest and largest index without causing overflow
@@ -122,8 +122,6 @@ interface BucketIterator {
122122
* @return the scale, which is guaranteed to be constant over the lifetime of this iterator.
123123
*/
124124
int scale();
125-
126-
BucketIterator copy();
127125
}
128126

129127
/**

libs/exponential-histogram/src/main/java/org/elasticsearch/exponentialhistogram/ExponentialHistogramMerger.java

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -62,26 +62,16 @@ public ExponentialHistogram get() {
6262
return result;
6363
}
6464

65-
public static ExponentialHistogram merge(int bucketCount, ExponentialHistogram... histograms) {
66-
return merge(bucketCount, Arrays.stream(histograms));
67-
}
68-
69-
public static ExponentialHistogram merge(int bucketCount, Stream<ExponentialHistogram> histograms) {
70-
ExponentialHistogramMerger merger = new ExponentialHistogramMerger(bucketCount);
71-
histograms.forEach(merger::add);
72-
return merger.get();
73-
}
74-
7565
// TODO: this algorithm is very efficient if b has roughly as many buckets as a
7666
// However, if b is much smaller we still have to iterate over all buckets of a which is very wasteful
7767
// This can be optimized by buffering multiple histograms to accumulate first, then in O(log(b)) turn them into a single, merged histogram
7868
// (b is the number of buffered buckets)
7969

8070
private void merge(FixedCapacityExponentialHistogram output, ExponentialHistogram a, ExponentialHistogram b) {
81-
ExponentialHistogram.BucketIterator posBucketsA = a.positiveBuckets();
82-
ExponentialHistogram.BucketIterator negBucketsA = a.negativeBuckets();
83-
ExponentialHistogram.BucketIterator posBucketsB = b.positiveBuckets();
84-
ExponentialHistogram.BucketIterator negBucketsB = b.negativeBuckets();
71+
ExponentialHistogram.CopyableBucketIterator posBucketsA = a.positiveBuckets();
72+
ExponentialHistogram.CopyableBucketIterator negBucketsA = a.negativeBuckets();
73+
ExponentialHistogram.CopyableBucketIterator posBucketsB = b.positiveBuckets();
74+
ExponentialHistogram.CopyableBucketIterator negBucketsB = b.negativeBuckets();
8575

8676
ZeroBucket zeroBucket = a.zeroBucket().merge(b.zeroBucket());
8777
zeroBucket = zeroBucket.collapseOverlappingBuckets(posBucketsA, negBucketsA, posBucketsB, negBucketsB);

libs/exponential-histogram/src/main/java/org/elasticsearch/exponentialhistogram/MergingBucketIterator.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -79,11 +79,6 @@ public int scale() {
7979
return itA.scale();
8080
}
8181

82-
@Override
83-
public ExponentialHistogram.BucketIterator copy() {
84-
throw new UnsupportedOperationException();
85-
}
86-
8782
private void assertEndNotReached() {
8883
if (endReached) {
8984
throw new IllegalStateException("No more buckets");

libs/exponential-histogram/src/main/java/org/elasticsearch/exponentialhistogram/ScaleAdjustingBucketIterator.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,4 @@ private void assertEndNotReached() {
7070
public int scale() {
7171
return delegate.scale() + scaleAdjustment;
7272
}
73-
74-
@Override
75-
public ExponentialHistogram.BucketIterator copy() {
76-
throw new UnsupportedOperationException();
77-
}
7873
}

0 commit comments

Comments
 (0)