Class EncodableHistogram

  • Direct Known Subclasses:
    AbstractHistogramBase, DoubleHistogram

    public abstract class EncodableHistogram
    extends java.lang.Object
    A base class for all encodable (and decodable) histogram classes. Log readers and writers will generally use this base class to provide common log processing across the integer value based AbstractHistogram subclasses and the double value based DoubleHistogram class.
    • Constructor Detail

      • EncodableHistogram

        public EncodableHistogram()
    • Method Detail

      • getNeededByteBufferCapacity

        public abstract int getNeededByteBufferCapacity()
      • encodeIntoCompressedByteBuffer

        public abstract int encodeIntoCompressedByteBuffer​(java.nio.ByteBuffer targetBuffer,
                                                           int compressionLevel)
      • getStartTimeStamp

        public abstract long getStartTimeStamp()
      • setStartTimeStamp

        public abstract void setStartTimeStamp​(long startTimeStamp)
      • getEndTimeStamp

        public abstract long getEndTimeStamp()
      • setEndTimeStamp

        public abstract void setEndTimeStamp​(long endTimestamp)
      • getTag

        public abstract java.lang.String getTag()
      • setTag

        public abstract void setTag​(java.lang.String tag)
      • getMaxValueAsDouble

        public abstract double getMaxValueAsDouble()
      • decodeFromCompressedByteBuffer

        static EncodableHistogram decodeFromCompressedByteBuffer​(java.nio.ByteBuffer buffer,
                                                                 long minBarForHighestTrackableValue)
                                                          throws java.util.zip.DataFormatException
        Decode a from a compressed byte buffer. Will return either a Histogram or DoubleHistogram depending on the format found in the supplied buffer.
        Parameters:
        buffer - The input buffer to decode from.
        minBarForHighestTrackableValue - A lower bound either on the highestTrackableValue of the created Histogram, or on the HighestToLowestValueRatio of the created DoubleHistogram.
        Returns:
        The decoded Histogram or DoubleHistogram
        Throws:
        java.util.zip.DataFormatException - on errors in decoding the buffer compression.