use of com.fasterxml.jackson.annotation.JsonValue in project druid by druid-io.
the class HyperLogLogCollector method toByteArray.
@JsonValue
public byte[] toByteArray() {
final ByteBuffer buffer = toByteBuffer();
byte[] theBytes = new byte[buffer.remaining()];
buffer.get(theBytes);
return theBytes;
}
use of com.fasterxml.jackson.annotation.JsonValue in project druid by druid-io.
the class Histogram method toBytes.
@JsonValue
public byte[] toBytes() {
ByteBuffer buf = ByteBuffer.allocate(Ints.BYTES + Floats.BYTES * breaks.length + Longs.BYTES * bins.length + Floats.BYTES * 2);
buf.putInt(breaks.length);
for (float b : breaks) {
buf.putFloat(b);
}
for (long c : bins) {
buf.putLong(c);
}
buf.putFloat(min);
buf.putFloat(max);
return buf.array();
}
use of com.fasterxml.jackson.annotation.JsonValue in project druid by druid-io.
the class HyperLogLogCollector method toByteArray.
@JsonValue
public byte[] toByteArray() {
final ByteBuffer buffer = toByteBuffer();
byte[] theBytes = new byte[buffer.remaining()];
buffer.get(theBytes);
return theBytes;
}
use of com.fasterxml.jackson.annotation.JsonValue in project druid by druid-io.
the class ApproximateHistogram method toBytes.
/**
* Returns a byte-array representation of this ApproximateHistogram object
*
* @return byte array representation
*/
@JsonValue
public byte[] toBytes() {
ByteBuffer buf = ByteBuffer.allocate(getMinStorageSize());
toBytes(buf);
return buf.array();
}
use of com.fasterxml.jackson.annotation.JsonValue in project druid by druid-io.
the class VarianceAggregatorCollector method toByteArray.
@JsonValue
public byte[] toByteArray() {
final ByteBuffer buffer = toByteBuffer();
buffer.flip();
byte[] theBytes = new byte[buffer.remaining()];
buffer.get(theBytes);
return theBytes;
}
Aggregations