Package org.HdrHistogram
Class EncodableHistogram
- java.lang.Object
-
- org.HdrHistogram.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 Summary
Constructors Constructor Description EncodableHistogram()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description (package private) static EncodableHistogram
decodeFromCompressedByteBuffer(java.nio.ByteBuffer buffer, long minBarForHighestTrackableValue)
Decode aEncodableHistogram
from a compressed byte buffer.abstract int
encodeIntoCompressedByteBuffer(java.nio.ByteBuffer targetBuffer, int compressionLevel)
abstract long
getEndTimeStamp()
abstract double
getMaxValueAsDouble()
abstract int
getNeededByteBufferCapacity()
abstract long
getStartTimeStamp()
abstract java.lang.String
getTag()
abstract void
setEndTimeStamp(long endTimestamp)
abstract void
setStartTimeStamp(long startTimeStamp)
abstract void
setTag(java.lang.String tag)
-
-
-
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 aEncodableHistogram
from a compressed byte buffer. Will return either aHistogram
orDoubleHistogram
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
orDoubleHistogram
- Throws:
java.util.zip.DataFormatException
- on errors in decoding the buffer compression.
-
-