|
| 1 | +/* |
| 2 | + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one |
| 3 | + * or more contributor license agreements. Licensed under the Elastic License |
| 4 | + * 2.0 and the Server Side Public License, v 1; you may not use this file except |
| 5 | + * in compliance with, at your election, the Elastic License 2.0 or the Server |
| 6 | + * Side Public License, v 1. |
| 7 | + */ |
| 8 | + |
| 9 | +package org.elasticsearch.search.aggregations.metrics; |
| 10 | + |
| 11 | +import org.HdrHistogram.DoubleHistogram; |
| 12 | + |
| 13 | +import java.io.PrintStream; |
| 14 | + |
| 15 | +public final class EmptyDoubleHdrHistogram extends DoubleHistogram { |
| 16 | + |
| 17 | + public EmptyDoubleHdrHistogram() { |
| 18 | + super(0); |
| 19 | + setAutoResize(false); |
| 20 | + } |
| 21 | + |
| 22 | + @Override |
| 23 | + public void setAutoResize(boolean ignored) { |
| 24 | + // DO NOT CHANGE 'autoResize' |
| 25 | + } |
| 26 | + |
| 27 | + @Override |
| 28 | + public void recordValue(double value) throws ArrayIndexOutOfBoundsException { |
| 29 | + throw new UnsupportedOperationException("Immutable Empty HdrHistogram"); |
| 30 | + } |
| 31 | + |
| 32 | + @Override |
| 33 | + public void recordValueWithCount(double value, long count) throws ArrayIndexOutOfBoundsException { |
| 34 | + throw new UnsupportedOperationException("Immutable Empty HdrHistogram"); |
| 35 | + } |
| 36 | + |
| 37 | + @Override |
| 38 | + public void recordValueWithExpectedInterval(double value, double expectedIntervalBetweenValueSamples) |
| 39 | + throws ArrayIndexOutOfBoundsException { |
| 40 | + throw new UnsupportedOperationException("Immutable Empty HdrHistogram"); |
| 41 | + } |
| 42 | + |
| 43 | + @Override |
| 44 | + public void reset() { |
| 45 | + throw new UnsupportedOperationException("Immutable Empty HdrHistogram"); |
| 46 | + } |
| 47 | + |
| 48 | + @Override |
| 49 | + public DoubleHistogram copy() { |
| 50 | + throw new UnsupportedOperationException("Immutable Empty HdrHistogram"); |
| 51 | + } |
| 52 | + |
| 53 | + @Override |
| 54 | + public DoubleHistogram copyCorrectedForCoordinatedOmission(double expectedIntervalBetweenValueSamples) { |
| 55 | + throw new UnsupportedOperationException("Immutable Empty HdrHistogram"); |
| 56 | + } |
| 57 | + |
| 58 | + @Override |
| 59 | + public void copyInto(DoubleHistogram targetHistogram) { |
| 60 | + throw new UnsupportedOperationException("Immutable Empty HdrHistogram"); |
| 61 | + } |
| 62 | + |
| 63 | + @Override |
| 64 | + public void copyIntoCorrectedForCoordinatedOmission(DoubleHistogram targetHistogram, double expectedIntervalBetweenValueSamples) { |
| 65 | + throw new UnsupportedOperationException("Immutable Empty HdrHistogram"); |
| 66 | + } |
| 67 | + |
| 68 | + @Override |
| 69 | + public void add(DoubleHistogram fromHistogram) throws ArrayIndexOutOfBoundsException { |
| 70 | + throw new UnsupportedOperationException("Immutable Empty HdrHistogram"); |
| 71 | + } |
| 72 | + |
| 73 | + @Override |
| 74 | + public void addWhileCorrectingForCoordinatedOmission(DoubleHistogram fromHistogram, double expectedIntervalBetweenValueSamples) { |
| 75 | + throw new UnsupportedOperationException("Immutable Empty HdrHistogram"); |
| 76 | + } |
| 77 | + |
| 78 | + @Override |
| 79 | + public void subtract(DoubleHistogram otherHistogram) { |
| 80 | + throw new UnsupportedOperationException("Immutable Empty HdrHistogram"); |
| 81 | + } |
| 82 | + |
| 83 | + @Override |
| 84 | + public double lowestEquivalentValue(double value) { |
| 85 | + throw new UnsupportedOperationException("Immutable Empty HdrHistogram"); |
| 86 | + } |
| 87 | + |
| 88 | + @Override |
| 89 | + public double highestEquivalentValue(double value) { |
| 90 | + throw new UnsupportedOperationException("Immutable Empty HdrHistogram"); |
| 91 | + } |
| 92 | + |
| 93 | + @Override |
| 94 | + public double sizeOfEquivalentValueRange(double value) { |
| 95 | + throw new UnsupportedOperationException("Immutable Empty HdrHistogram"); |
| 96 | + } |
| 97 | + |
| 98 | + @Override |
| 99 | + public double medianEquivalentValue(double value) { |
| 100 | + throw new UnsupportedOperationException("Immutable Empty HdrHistogram"); |
| 101 | + } |
| 102 | + |
| 103 | + @Override |
| 104 | + public double nextNonEquivalentValue(double value) { |
| 105 | + throw new UnsupportedOperationException("Immutable Empty HdrHistogram"); |
| 106 | + } |
| 107 | + |
| 108 | + @Override |
| 109 | + public boolean valuesAreEquivalent(double value1, double value2) { |
| 110 | + throw new UnsupportedOperationException("Immutable Empty HdrHistogram"); |
| 111 | + } |
| 112 | + |
| 113 | + @Override |
| 114 | + public void setStartTimeStamp(long timeStampMsec) { |
| 115 | + throw new UnsupportedOperationException("Immutable Empty HdrHistogram"); |
| 116 | + } |
| 117 | + |
| 118 | + @Override |
| 119 | + public long getStartTimeStamp() { |
| 120 | + throw new UnsupportedOperationException("Immutable Empty HdrHistogram"); |
| 121 | + } |
| 122 | + |
| 123 | + @Override |
| 124 | + public long getEndTimeStamp() { |
| 125 | + throw new UnsupportedOperationException("Immutable Empty HdrHistogram"); |
| 126 | + } |
| 127 | + |
| 128 | + @Override |
| 129 | + public void setEndTimeStamp(long timeStampMsec) { |
| 130 | + throw new UnsupportedOperationException("Immutable Empty HdrHistogram"); |
| 131 | + } |
| 132 | + |
| 133 | + @Override |
| 134 | + public void setTag(String tag) { |
| 135 | + throw new UnsupportedOperationException("Immutable Empty HdrHistogram"); |
| 136 | + } |
| 137 | + |
| 138 | + @Override |
| 139 | + public double getMinValue() { |
| 140 | + throw new UnsupportedOperationException("Immutable Empty HdrHistogram"); |
| 141 | + } |
| 142 | + |
| 143 | + @Override |
| 144 | + public double getMaxValue() { |
| 145 | + throw new UnsupportedOperationException("Immutable Empty HdrHistogram"); |
| 146 | + } |
| 147 | + |
| 148 | + @Override |
| 149 | + public double getMinNonZeroValue() { |
| 150 | + throw new UnsupportedOperationException("Immutable Empty HdrHistogram"); |
| 151 | + } |
| 152 | + |
| 153 | + @Override |
| 154 | + public double getMaxValueAsDouble() { |
| 155 | + throw new UnsupportedOperationException("Immutable Empty HdrHistogram"); |
| 156 | + } |
| 157 | + |
| 158 | + @Override |
| 159 | + public double getMean() { |
| 160 | + throw new UnsupportedOperationException("Immutable Empty HdrHistogram"); |
| 161 | + } |
| 162 | + |
| 163 | + @Override |
| 164 | + public double getStdDeviation() { |
| 165 | + throw new UnsupportedOperationException("Immutable Empty HdrHistogram"); |
| 166 | + } |
| 167 | + |
| 168 | + @Override |
| 169 | + public Percentiles percentiles(int percentileTicksPerHalfDistance) { |
| 170 | + throw new UnsupportedOperationException("Immutable Empty HdrHistogram"); |
| 171 | + } |
| 172 | + |
| 173 | + @Override |
| 174 | + public LinearBucketValues linearBucketValues(double valueUnitsPerBucket) { |
| 175 | + throw new UnsupportedOperationException("Immutable Empty HdrHistogram"); |
| 176 | + } |
| 177 | + |
| 178 | + @Override |
| 179 | + public LogarithmicBucketValues logarithmicBucketValues(double valueUnitsInFirstBucket, double logBase) { |
| 180 | + throw new UnsupportedOperationException("Immutable Empty HdrHistogram"); |
| 181 | + } |
| 182 | + |
| 183 | + @Override |
| 184 | + public void outputPercentileDistribution(PrintStream printStream, Double outputValueUnitScalingRatio) { |
| 185 | + throw new UnsupportedOperationException("Immutable Empty HdrHistogram"); |
| 186 | + } |
| 187 | + |
| 188 | + @Override |
| 189 | + public void outputPercentileDistribution( |
| 190 | + PrintStream printStream, |
| 191 | + int percentileTicksPerHalfDistance, |
| 192 | + Double outputValueUnitScalingRatio |
| 193 | + ) { |
| 194 | + throw new UnsupportedOperationException("Immutable Empty HdrHistogram"); |
| 195 | + } |
| 196 | + |
| 197 | + @Override |
| 198 | + public void outputPercentileDistribution( |
| 199 | + PrintStream printStream, |
| 200 | + int percentileTicksPerHalfDistance, |
| 201 | + Double outputValueUnitScalingRatio, |
| 202 | + boolean useCsvFormat |
| 203 | + ) { |
| 204 | + throw new UnsupportedOperationException("Immutable Empty HdrHistogram"); |
| 205 | + } |
| 206 | + |
| 207 | +} |
0 commit comments