This is an automated email from the ASF dual-hosted git repository. yuyuankang pushed a commit to branch kyy in repository https://gitbox.apache.org/repos/asf/iotdb.git
commit aa5660da1701e6d9183a39240b97b500aee35c83 Author: Ring-k <[email protected]> AuthorDate: Wed Jan 26 11:15:29 2022 +0800 remove useless code --- .../file/metadata/statistics/BinaryStatistics.java | 67 +++---------------- .../metadata/statistics/BooleanStatistics.java | 62 ++---------------- .../file/metadata/statistics/DoubleStatistics.java | 62 ++---------------- .../file/metadata/statistics/FloatStatistics.java | 62 ++---------------- .../metadata/statistics/IntegerStatistics.java | 62 ++---------------- .../file/metadata/statistics/LongStatistics.java | 62 ++---------------- .../file/metadata/statistics/Statistics.java | 24 +------ .../file/metadata/statistics/TimeStatistics.java | 76 ++++------------------ 8 files changed, 50 insertions(+), 427 deletions(-) diff --git a/tsfile/src/main/java/org/apache/iotdb/tsfile/file/metadata/statistics/BinaryStatistics.java b/tsfile/src/main/java/org/apache/iotdb/tsfile/file/metadata/statistics/BinaryStatistics.java index 440844f..a14770b 100644 --- a/tsfile/src/main/java/org/apache/iotdb/tsfile/file/metadata/statistics/BinaryStatistics.java +++ b/tsfile/src/main/java/org/apache/iotdb/tsfile/file/metadata/statistics/BinaryStatistics.java @@ -35,8 +35,7 @@ public class BinaryStatistics extends Statistics<Binary> { private Binary firstValue = new Binary(""); private Binary lastValue = new Binary(""); - private static final String BINARY_STATS_UNSUPPORTED_MSG = - "Binary statistics does not support: %s"; + private static final String BINARY = "Binary"; static final int BINARY_STATISTICS_FIXED_RAM_SIZE = 32; @Override @@ -44,6 +43,9 @@ public class BinaryStatistics extends Statistics<Binary> { return TSDataType.TEXT; } + /** + * The output of this method should be identical to the method "serializeStats(OutputStream outputStream)" + */ @Override public int getStatsSize() { return 4 + firstValue.getValues().length + 4 + lastValue.getValues().length; @@ -77,16 +79,13 @@ public class BinaryStatistics extends Statistics<Binary> { } @Override - public void setMinMaxFromBytes(byte[] minBytes, byte[] maxBytes) {} - - @Override public Binary getMinValue() { - throw new StatisticsClassException(String.format(BINARY_STATS_UNSUPPORTED_MSG, "min")); + throw new StatisticsClassException(String.format(STATS_UNSUPPORTED_MSG,BINARY, "min")); } @Override public Binary getMaxValue() { - throw new StatisticsClassException(String.format(BINARY_STATS_UNSUPPORTED_MSG, "max")); + throw new StatisticsClassException(String.format(STATS_UNSUPPORTED_MSG,BINARY, "max")); } @Override @@ -101,12 +100,12 @@ public class BinaryStatistics extends Statistics<Binary> { @Override public double getSumDoubleValue() { - throw new StatisticsClassException(String.format(BINARY_STATS_UNSUPPORTED_MSG, "double sum")); + throw new StatisticsClassException(String.format(STATS_UNSUPPORTED_MSG,BINARY, "double sum")); } @Override public long getSumLongValue() { - throw new StatisticsClassException(String.format(BINARY_STATS_UNSUPPORTED_MSG, "long sum")); + throw new StatisticsClassException(String.format(STATS_UNSUPPORTED_MSG,BINARY, "long sum")); } @Override @@ -147,56 +146,6 @@ public class BinaryStatistics extends Statistics<Binary> { } @Override - public byte[] getMinValueBytes() { - throw new StatisticsClassException(String.format(BINARY_STATS_UNSUPPORTED_MSG, "min")); - } - - @Override - public byte[] getMaxValueBytes() { - throw new StatisticsClassException(String.format(BINARY_STATS_UNSUPPORTED_MSG, "max")); - } - - @Override - public byte[] getFirstValueBytes() { - return firstValue.getValues(); - } - - @Override - public byte[] getLastValueBytes() { - return lastValue.getValues(); - } - - @Override - public byte[] getSumValueBytes() { - throw new StatisticsClassException(String.format(BINARY_STATS_UNSUPPORTED_MSG, "sum")); - } - - @Override - public ByteBuffer getMinValueBuffer() { - throw new StatisticsClassException(String.format(BINARY_STATS_UNSUPPORTED_MSG, "min")); - } - - @Override - public ByteBuffer getMaxValueBuffer() { - throw new StatisticsClassException(String.format(BINARY_STATS_UNSUPPORTED_MSG, "max")); - } - - @Override - public ByteBuffer getFirstValueBuffer() { - return ByteBuffer.wrap(firstValue.getValues()); - } - - @Override - public ByteBuffer getLastValueBuffer() { - return ByteBuffer.wrap(lastValue.getValues()); - } - - @Override - public ByteBuffer getSumValueBuffer() { - throw new StatisticsClassException(String.format(BINARY_STATS_UNSUPPORTED_MSG, "sum")); - } - - @Override public int serializeStats(OutputStream outputStream) throws IOException { int byteLen = 0; byteLen += ReadWriteIOUtils.write(firstValue, outputStream); diff --git a/tsfile/src/main/java/org/apache/iotdb/tsfile/file/metadata/statistics/BooleanStatistics.java b/tsfile/src/main/java/org/apache/iotdb/tsfile/file/metadata/statistics/BooleanStatistics.java index 05a46aa..4193951 100644 --- a/tsfile/src/main/java/org/apache/iotdb/tsfile/file/metadata/statistics/BooleanStatistics.java +++ b/tsfile/src/main/java/org/apache/iotdb/tsfile/file/metadata/statistics/BooleanStatistics.java @@ -36,12 +36,16 @@ public class BooleanStatistics extends Statistics<Boolean> { private long sumValue; static final int BOOLEAN_STATISTICS_FIXED_RAM_SIZE = 56; + private static final String BOOLEAN = "Boolean"; @Override public TSDataType getType() { return TSDataType.BOOLEAN; } + /** + * The output of this method should be identical to the method "serializeStats(OutputStream outputStream)" + */ @Override public int getStatsSize() { return 10; @@ -101,16 +105,13 @@ public class BooleanStatistics extends Statistics<Boolean> { } @Override - public void setMinMaxFromBytes(byte[] minBytes, byte[] maxBytes) {} - - @Override public Boolean getMinValue() { - throw new StatisticsClassException("Boolean statistics does not support: min"); + throw new StatisticsClassException(String.format(STATS_UNSUPPORTED_MSG, BOOLEAN, "min")); } @Override public Boolean getMaxValue() { - throw new StatisticsClassException("Boolean statistics does not support: max"); + throw new StatisticsClassException(String.format(STATS_UNSUPPORTED_MSG, BOOLEAN, "max")); } @Override @@ -125,7 +126,7 @@ public class BooleanStatistics extends Statistics<Boolean> { @Override public double getSumDoubleValue() { - throw new StatisticsClassException("Boolean statistics does not support: double sum"); + throw new StatisticsClassException(String.format(STATS_UNSUPPORTED_MSG, BOOLEAN, "double sum")); } @Override @@ -133,30 +134,6 @@ public class BooleanStatistics extends Statistics<Boolean> { return sumValue; } - @Override - public ByteBuffer getMinValueBuffer() { - throw new StatisticsClassException("Boolean statistics do not support: min"); - } - - @Override - public ByteBuffer getMaxValueBuffer() { - throw new StatisticsClassException("Boolean statistics do not support: max"); - } - - @Override - public ByteBuffer getFirstValueBuffer() { - return ReadWriteIOUtils.getByteBuffer(firstValue); - } - - @Override - public ByteBuffer getLastValueBuffer() { - return ReadWriteIOUtils.getByteBuffer(lastValue); - } - - @Override - public ByteBuffer getSumValueBuffer() { - return ReadWriteIOUtils.getByteBuffer(sumValue); - } @Override protected void mergeStatisticsValue(Statistics<Boolean> stats) { @@ -175,31 +152,6 @@ public class BooleanStatistics extends Statistics<Boolean> { } @Override - public byte[] getMinValueBytes() { - throw new StatisticsClassException("Boolean statistics does not support: min"); - } - - @Override - public byte[] getMaxValueBytes() { - throw new StatisticsClassException("Boolean statistics does not support: max"); - } - - @Override - public byte[] getFirstValueBytes() { - return BytesUtils.boolToBytes(firstValue); - } - - @Override - public byte[] getLastValueBytes() { - return BytesUtils.boolToBytes(lastValue); - } - - @Override - public byte[] getSumValueBytes() { - return BytesUtils.longToBytes(sumValue); - } - - @Override public int serializeStats(OutputStream outputStream) throws IOException { int byteLen = 0; byteLen += ReadWriteIOUtils.write(firstValue, outputStream); diff --git a/tsfile/src/main/java/org/apache/iotdb/tsfile/file/metadata/statistics/DoubleStatistics.java b/tsfile/src/main/java/org/apache/iotdb/tsfile/file/metadata/statistics/DoubleStatistics.java index d8a5831..98d0fb6 100644 --- a/tsfile/src/main/java/org/apache/iotdb/tsfile/file/metadata/statistics/DoubleStatistics.java +++ b/tsfile/src/main/java/org/apache/iotdb/tsfile/file/metadata/statistics/DoubleStatistics.java @@ -38,12 +38,16 @@ public class DoubleStatistics extends Statistics<Double> { private double sumValue; static final int DOUBLE_STATISTICS_FIXED_RAM_SIZE = 80; + private final String DOUBLE = "Double"; @Override public TSDataType getType() { return TSDataType.DOUBLE; } + /** + * The output of this method should be identical to the method "serializeStats(OutputStream outputStream)" + */ @Override public int getStatsSize() { return 40; @@ -104,12 +108,6 @@ public class DoubleStatistics extends Statistics<Double> { } @Override - public void setMinMaxFromBytes(byte[] minBytes, byte[] maxBytes) { - minValue = BytesUtils.bytesToDouble(minBytes); - maxValue = BytesUtils.bytesToDouble(maxBytes); - } - - @Override void updateStats(double value) { if (this.isEmpty) { initializeStats(value, value, value, value, value); @@ -158,7 +156,7 @@ public class DoubleStatistics extends Statistics<Double> { @Override public long getSumLongValue() { - throw new StatisticsClassException("Double statistics does not support: long sum"); + throw new StatisticsClassException(String.format(STATS_UNSUPPORTED_MSG, DOUBLE, "long sum")); } @Override @@ -185,56 +183,6 @@ public class DoubleStatistics extends Statistics<Double> { } @Override - public byte[] getMinValueBytes() { - return BytesUtils.doubleToBytes(minValue); - } - - @Override - public byte[] getMaxValueBytes() { - return BytesUtils.doubleToBytes(maxValue); - } - - @Override - public byte[] getFirstValueBytes() { - return BytesUtils.doubleToBytes(firstValue); - } - - @Override - public byte[] getLastValueBytes() { - return BytesUtils.doubleToBytes(lastValue); - } - - @Override - public byte[] getSumValueBytes() { - return BytesUtils.doubleToBytes(sumValue); - } - - @Override - public ByteBuffer getMinValueBuffer() { - return ReadWriteIOUtils.getByteBuffer(minValue); - } - - @Override - public ByteBuffer getMaxValueBuffer() { - return ReadWriteIOUtils.getByteBuffer(maxValue); - } - - @Override - public ByteBuffer getFirstValueBuffer() { - return ReadWriteIOUtils.getByteBuffer(firstValue); - } - - @Override - public ByteBuffer getLastValueBuffer() { - return ReadWriteIOUtils.getByteBuffer(lastValue); - } - - @Override - public ByteBuffer getSumValueBuffer() { - return ReadWriteIOUtils.getByteBuffer(sumValue); - } - - @Override public int serializeStats(OutputStream outputStream) throws IOException { int byteLen = 0; byteLen += ReadWriteIOUtils.write(minValue, outputStream); diff --git a/tsfile/src/main/java/org/apache/iotdb/tsfile/file/metadata/statistics/FloatStatistics.java b/tsfile/src/main/java/org/apache/iotdb/tsfile/file/metadata/statistics/FloatStatistics.java index 3380d5d..8e76da0 100644 --- a/tsfile/src/main/java/org/apache/iotdb/tsfile/file/metadata/statistics/FloatStatistics.java +++ b/tsfile/src/main/java/org/apache/iotdb/tsfile/file/metadata/statistics/FloatStatistics.java @@ -39,12 +39,16 @@ public class FloatStatistics extends Statistics<Float> { private double sumValue; static final int FLOAT_STATISTICS_FIXED_RAM_SIZE = 64; + private final String FLOAT = "Float"; @Override public TSDataType getType() { return TSDataType.FLOAT; } + /** + * The output of this method should be identical to the method "serializeStats(OutputStream outputStream)" + */ @Override public int getStatsSize() { return 24; @@ -96,12 +100,6 @@ public class FloatStatistics extends Statistics<Float> { } @Override - public void setMinMaxFromBytes(byte[] minBytes, byte[] maxBytes) { - minValue = BytesUtils.bytesToFloat(minBytes); - maxValue = BytesUtils.bytesToFloat(maxBytes); - } - - @Override void updateStats(float value) { if (this.isEmpty) { initializeStats(value, value, value, value, value); @@ -150,7 +148,7 @@ public class FloatStatistics extends Statistics<Float> { @Override public long getSumLongValue() { - throw new StatisticsClassException("Float statistics does not support: long sum"); + throw new StatisticsClassException(String.format(STATS_UNSUPPORTED_MSG, FLOAT, "long sum")); } @Override @@ -177,56 +175,6 @@ public class FloatStatistics extends Statistics<Float> { } @Override - public byte[] getMinValueBytes() { - return BytesUtils.floatToBytes(minValue); - } - - @Override - public byte[] getMaxValueBytes() { - return BytesUtils.floatToBytes(maxValue); - } - - @Override - public byte[] getFirstValueBytes() { - return BytesUtils.floatToBytes(firstValue); - } - - @Override - public byte[] getLastValueBytes() { - return BytesUtils.floatToBytes(lastValue); - } - - @Override - public byte[] getSumValueBytes() { - return BytesUtils.doubleToBytes(sumValue); - } - - @Override - public ByteBuffer getMinValueBuffer() { - return ReadWriteIOUtils.getByteBuffer(minValue); - } - - @Override - public ByteBuffer getMaxValueBuffer() { - return ReadWriteIOUtils.getByteBuffer(maxValue); - } - - @Override - public ByteBuffer getFirstValueBuffer() { - return ReadWriteIOUtils.getByteBuffer(firstValue); - } - - @Override - public ByteBuffer getLastValueBuffer() { - return ReadWriteIOUtils.getByteBuffer(lastValue); - } - - @Override - public ByteBuffer getSumValueBuffer() { - return ReadWriteIOUtils.getByteBuffer(sumValue); - } - - @Override public int serializeStats(OutputStream outputStream) throws IOException { int byteLen = 0; byteLen += ReadWriteIOUtils.write(minValue, outputStream); diff --git a/tsfile/src/main/java/org/apache/iotdb/tsfile/file/metadata/statistics/IntegerStatistics.java b/tsfile/src/main/java/org/apache/iotdb/tsfile/file/metadata/statistics/IntegerStatistics.java index 3cc2dcd..2b744a1 100644 --- a/tsfile/src/main/java/org/apache/iotdb/tsfile/file/metadata/statistics/IntegerStatistics.java +++ b/tsfile/src/main/java/org/apache/iotdb/tsfile/file/metadata/statistics/IntegerStatistics.java @@ -39,12 +39,16 @@ public class IntegerStatistics extends Statistics<Integer> { private long sumValue; static final int INTEGER_STATISTICS_FIXED_RAM_SIZE = 64; + private static final String INTEGER = "Integer"; @Override public TSDataType getType() { return TSDataType.INT32; } + /** + * The output of this method should be identical to the method "serializeStats(OutputStream outputStream)" + */ @Override public int getStatsSize() { return 24; @@ -96,12 +100,6 @@ public class IntegerStatistics extends Statistics<Integer> { } @Override - public void setMinMaxFromBytes(byte[] minBytes, byte[] maxBytes) { - minValue = BytesUtils.bytesToInt(minBytes); - maxValue = BytesUtils.bytesToInt(maxBytes); - } - - @Override void updateStats(int value) { if (isEmpty) { initializeStats(value, value, value, value, value); @@ -145,7 +143,7 @@ public class IntegerStatistics extends Statistics<Integer> { @Override public double getSumDoubleValue() { - throw new StatisticsClassException("Integer statistics does not support: double sum"); + throw new StatisticsClassException(String.format(STATS_UNSUPPORTED_MSG, INTEGER, "double sum")); } @Override @@ -177,56 +175,6 @@ public class IntegerStatistics extends Statistics<Integer> { } @Override - public ByteBuffer getMinValueBuffer() { - return ReadWriteIOUtils.getByteBuffer(minValue); - } - - @Override - public ByteBuffer getMaxValueBuffer() { - return ReadWriteIOUtils.getByteBuffer(maxValue); - } - - @Override - public ByteBuffer getFirstValueBuffer() { - return ReadWriteIOUtils.getByteBuffer(firstValue); - } - - @Override - public ByteBuffer getLastValueBuffer() { - return ReadWriteIOUtils.getByteBuffer(lastValue); - } - - @Override - public ByteBuffer getSumValueBuffer() { - return ReadWriteIOUtils.getByteBuffer(sumValue); - } - - @Override - public byte[] getMinValueBytes() { - return BytesUtils.intToBytes(minValue); - } - - @Override - public byte[] getMaxValueBytes() { - return BytesUtils.intToBytes(maxValue); - } - - @Override - public byte[] getFirstValueBytes() { - return BytesUtils.intToBytes(firstValue); - } - - @Override - public byte[] getLastValueBytes() { - return BytesUtils.intToBytes(lastValue); - } - - @Override - public byte[] getSumValueBytes() { - return BytesUtils.longToBytes(sumValue); - } - - @Override public int serializeStats(OutputStream outputStream) throws IOException { int byteLen = 0; byteLen += ReadWriteIOUtils.write(minValue, outputStream); diff --git a/tsfile/src/main/java/org/apache/iotdb/tsfile/file/metadata/statistics/LongStatistics.java b/tsfile/src/main/java/org/apache/iotdb/tsfile/file/metadata/statistics/LongStatistics.java index 80741c2..1939878 100644 --- a/tsfile/src/main/java/org/apache/iotdb/tsfile/file/metadata/statistics/LongStatistics.java +++ b/tsfile/src/main/java/org/apache/iotdb/tsfile/file/metadata/statistics/LongStatistics.java @@ -38,12 +38,16 @@ public class LongStatistics extends Statistics<Long> { private double sumValue; static final int LONG_STATISTICS_FIXED_RAM_SIZE = 80; + private static final String LONG = "Long"; @Override public TSDataType getType() { return TSDataType.INT64; } + /** + * The output of this method should be identical to the method "serializeStats(OutputStream outputStream)" + */ @Override public int getStatsSize() { return 40; @@ -95,12 +99,6 @@ public class LongStatistics extends Statistics<Long> { } @Override - public void setMinMaxFromBytes(byte[] minBytes, byte[] maxBytes) { - minValue = BytesUtils.bytesToLong(minBytes); - maxValue = BytesUtils.bytesToLong(maxBytes); - } - - @Override public Long getMinValue() { return minValue; } @@ -127,7 +125,7 @@ public class LongStatistics extends Statistics<Long> { @Override public long getSumLongValue() { - throw new StatisticsClassException("Long statistics does not support: long sum"); + throw new StatisticsClassException(String.format(STATS_UNSUPPORTED_MSG, LONG, "long sum")); } @Override @@ -186,56 +184,6 @@ public class LongStatistics extends Statistics<Long> { } @Override - public byte[] getMinValueBytes() { - return BytesUtils.longToBytes(minValue); - } - - @Override - public byte[] getMaxValueBytes() { - return BytesUtils.longToBytes(maxValue); - } - - @Override - public byte[] getFirstValueBytes() { - return BytesUtils.longToBytes(firstValue); - } - - @Override - public byte[] getLastValueBytes() { - return BytesUtils.longToBytes(lastValue); - } - - @Override - public byte[] getSumValueBytes() { - return BytesUtils.doubleToBytes(sumValue); - } - - @Override - public ByteBuffer getMinValueBuffer() { - return ReadWriteIOUtils.getByteBuffer(minValue); - } - - @Override - public ByteBuffer getMaxValueBuffer() { - return ReadWriteIOUtils.getByteBuffer(maxValue); - } - - @Override - public ByteBuffer getFirstValueBuffer() { - return ReadWriteIOUtils.getByteBuffer(firstValue); - } - - @Override - public ByteBuffer getLastValueBuffer() { - return ReadWriteIOUtils.getByteBuffer(lastValue); - } - - @Override - public ByteBuffer getSumValueBuffer() { - return ReadWriteIOUtils.getByteBuffer(sumValue); - } - - @Override public int serializeStats(OutputStream outputStream) throws IOException { int byteLen = 0; byteLen += ReadWriteIOUtils.write(minValue, outputStream); diff --git a/tsfile/src/main/java/org/apache/iotdb/tsfile/file/metadata/statistics/Statistics.java b/tsfile/src/main/java/org/apache/iotdb/tsfile/file/metadata/statistics/Statistics.java index abec0e7..a9fcec1 100644 --- a/tsfile/src/main/java/org/apache/iotdb/tsfile/file/metadata/statistics/Statistics.java +++ b/tsfile/src/main/java/org/apache/iotdb/tsfile/file/metadata/statistics/Statistics.java @@ -58,6 +58,8 @@ public abstract class Statistics<T extends Serializable> { private long startTime = Long.MAX_VALUE; private long endTime = Long.MIN_VALUE; + static final String STATS_UNSUPPORTED_MSG = "%s statistics does not support: %s"; + /** * static method providing statistic instance for respective data type. * @@ -133,8 +135,6 @@ public abstract class Statistics<T extends Serializable> { public abstract void deserialize(ByteBuffer byteBuffer); - public abstract void setMinMaxFromBytes(byte[] minBytes, byte[] maxBytes); - public abstract T getMinValue(); public abstract T getMaxValue(); @@ -147,26 +147,6 @@ public abstract class Statistics<T extends Serializable> { public abstract long getSumLongValue(); - public abstract byte[] getMinValueBytes(); - - public abstract byte[] getMaxValueBytes(); - - public abstract byte[] getFirstValueBytes(); - - public abstract byte[] getLastValueBytes(); - - public abstract byte[] getSumValueBytes(); - - public abstract ByteBuffer getMinValueBuffer(); - - public abstract ByteBuffer getMaxValueBuffer(); - - public abstract ByteBuffer getFirstValueBuffer(); - - public abstract ByteBuffer getLastValueBuffer(); - - public abstract ByteBuffer getSumValueBuffer(); - /** * merge parameter to this statistic * diff --git a/tsfile/src/main/java/org/apache/iotdb/tsfile/file/metadata/statistics/TimeStatistics.java b/tsfile/src/main/java/org/apache/iotdb/tsfile/file/metadata/statistics/TimeStatistics.java index 8ed2778..9dca855 100644 --- a/tsfile/src/main/java/org/apache/iotdb/tsfile/file/metadata/statistics/TimeStatistics.java +++ b/tsfile/src/main/java/org/apache/iotdb/tsfile/file/metadata/statistics/TimeStatistics.java @@ -29,65 +29,64 @@ import java.nio.ByteBuffer; public class TimeStatistics extends Statistics<Long> { static final int TIME_STATISTICS_FIXED_RAM_SIZE = 40; + private static final String TIME = "Time"; @Override public TSDataType getType() { return TSDataType.VECTOR; } + /** + * The output of this method should be identical to the method "serializeStats(OutputStream outputStream)" + */ @Override public int getStatsSize() { return 0; } @Override - public void setMinMaxFromBytes(byte[] minBytes, byte[] maxBytes) { - throw new StatisticsClassException("Time statistics does not support: set min max from bytes"); - } - - @Override public Long getMinValue() { - throw new StatisticsClassException("Time statistics does not support: min value"); + throw new StatisticsClassException(String.format(STATS_UNSUPPORTED_MSG, TIME, "min value")); } @Override public Long getMaxValue() { - throw new StatisticsClassException("Time statistics does not support: max value"); + throw new StatisticsClassException(String.format(STATS_UNSUPPORTED_MSG, TIME, "max value")); } @Override public Long getFirstValue() { - throw new StatisticsClassException("Time statistics does not support: first value"); + throw new StatisticsClassException(String.format(STATS_UNSUPPORTED_MSG, TIME, "first value")); } @Override public Long getLastValue() { - throw new StatisticsClassException("Time statistics does not support: last value"); + throw new StatisticsClassException(String.format(STATS_UNSUPPORTED_MSG, TIME, "last value")); } @Override public double getSumDoubleValue() { - throw new StatisticsClassException("Time statistics does not support: double sum"); + throw new StatisticsClassException(String.format(STATS_UNSUPPORTED_MSG, TIME, "double sum")); } @Override public long getSumLongValue() { - throw new StatisticsClassException("Time statistics does not support: long sum"); + throw new StatisticsClassException(String.format(STATS_UNSUPPORTED_MSG, TIME, "long sum")); } @Override void updateStats(long value) { - throw new StatisticsClassException("Time statistics does not support: update stats"); + throw new StatisticsClassException(String.format(STATS_UNSUPPORTED_MSG, TIME, "update stats")); } @Override void updateStats(long[] values, int batchSize) { - throw new StatisticsClassException("Time statistics does not support: update stats"); + throw new StatisticsClassException(String.format(STATS_UNSUPPORTED_MSG, TIME, "update stats")); } @Override public void updateStats(long minValue, long maxValue) { - throw new StatisticsClassException("Time statistics does not support: update stats"); + throw new StatisticsClassException(String.format(STATS_UNSUPPORTED_MSG, TIME, "update stats")); } @Override @@ -98,55 +97,6 @@ public class TimeStatistics extends Statistics<Long> { @Override protected void mergeStatisticsValue(Statistics<Long> stats) {} - @Override - public byte[] getMinValueBytes() { - throw new StatisticsClassException("Time statistics does not support: get min value bytes"); - } - - @Override - public byte[] getMaxValueBytes() { - throw new StatisticsClassException("Time statistics does not support: get max value bytes"); - } - - @Override - public byte[] getFirstValueBytes() { - throw new StatisticsClassException("Time statistics does not support: get first value bytes"); - } - - @Override - public byte[] getLastValueBytes() { - throw new StatisticsClassException("Time statistics does not support: get last value bytes"); - } - - @Override - public byte[] getSumValueBytes() { - throw new StatisticsClassException("Time statistics does not support: get sum value bytes"); - } - - @Override - public ByteBuffer getMinValueBuffer() { - throw new StatisticsClassException("Time statistics does not support: get min value bytes"); - } - - @Override - public ByteBuffer getMaxValueBuffer() { - throw new StatisticsClassException("Time statistics does not support: get max value buffer"); - } - - @Override - public ByteBuffer getFirstValueBuffer() { - throw new StatisticsClassException("Time statistics does not support: get first value buffer"); - } - - @Override - public ByteBuffer getLastValueBuffer() { - throw new StatisticsClassException("Time statistics does not support: get last value buffer"); - } - - @Override - public ByteBuffer getSumValueBuffer() { - throw new StatisticsClassException("Time statistics does not support: get sum value buffer"); - } @Override public int serializeStats(OutputStream outputStream) {
