本文整理汇总了Java中org.HdrHistogram.DoubleHistogram.decodeFromCompressedByteBuffer方法的典型用法代码示例。如果您正苦于以下问题:Java DoubleHistogram.decodeFromCompressedByteBuffer方法的具体用法?Java DoubleHistogram.decodeFromCompressedByteBuffer怎么用?Java DoubleHistogram.decodeFromCompressedByteBuffer使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.HdrHistogram.DoubleHistogram
的用法示例。
在下文中一共展示了DoubleHistogram.decodeFromCompressedByteBuffer方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: AbstractInternalHDRPercentiles
import org.HdrHistogram.DoubleHistogram; //导入方法依赖的package包/类
/**
* Read from a stream.
*/
protected AbstractInternalHDRPercentiles(StreamInput in) throws IOException {
super(in);
format = in.readNamedWriteable(DocValueFormat.class);
keys = in.readDoubleArray();
long minBarForHighestToLowestValueRatio = in.readLong();
final int serializedLen = in.readVInt();
byte[] bytes = new byte[serializedLen];
in.readBytes(bytes, 0, serializedLen);
ByteBuffer stateBuffer = ByteBuffer.wrap(bytes);
try {
state = DoubleHistogram.decodeFromCompressedByteBuffer(stateBuffer, minBarForHighestToLowestValueRatio);
} catch (DataFormatException e) {
throw new IOException("Failed to decode DoubleHistogram for aggregation [" + name + "]", e);
}
keyed = in.readBoolean();
}
示例2: doReadFrom
import org.HdrHistogram.DoubleHistogram; //导入方法依赖的package包/类
@Override
protected void doReadFrom(StreamInput in) throws IOException {
valueFormatter = ValueFormatterStreams.readOptional(in);
keys = new double[in.readInt()];
for (int i = 0; i < keys.length; ++i) {
keys[i] = in.readDouble();
}
long minBarForHighestToLowestValueRatio = in.readLong();
final int serializedLen = in.readVInt();
byte[] bytes = new byte[serializedLen];
in.readBytes(bytes, 0, serializedLen);
ByteBuffer stateBuffer = ByteBuffer.wrap(bytes);
try {
state = DoubleHistogram.decodeFromCompressedByteBuffer(stateBuffer, minBarForHighestToLowestValueRatio);
} catch (DataFormatException e) {
throw new IOException("Failed to decode DoubleHistogram for aggregation [" + name + "]", e);
}
keyed = in.readBoolean();
}
示例3: fromBinary
import org.HdrHistogram.DoubleHistogram; //导入方法依赖的package包/类
@Override
public void fromBinary(
final byte[] bytes ) {
final ByteBuffer buffer = super.binaryBuffer(bytes);
final int endPosition = buffer.getInt();
try {
positiveHistogram = DoubleHistogram.decodeFromCompressedByteBuffer(
buffer,
LocalInternalHistogram.class,
0);
buffer.position(endPosition);
positiveHistogram.setAutoResize(true);
if (buffer.get() == (byte) 0x01) {
negativeHistogram = DoubleHistogram.decodeFromCompressedByteBuffer(
buffer,
LocalInternalHistogram.class,
0);
negativeHistogram.setAutoResize(true);
}
}
catch (final DataFormatException e) {
throw new RuntimeException(
"Cannot decode statistic",
e);
}
}