mirror of https://github.com/apache/druid.git
fix approximate histogram serde to not change buffer limit
This commit is contained in:
parent
70ae6e1fcd
commit
d0b8494735
|
@ -110,8 +110,9 @@ public class ApproximateHistogramFoldingSerde extends ComplexMetricSerde
|
||||||
@Override
|
@Override
|
||||||
public ApproximateHistogram fromByteBuffer(ByteBuffer buffer, int numBytes)
|
public ApproximateHistogram fromByteBuffer(ByteBuffer buffer, int numBytes)
|
||||||
{
|
{
|
||||||
buffer.limit(buffer.position() + numBytes);
|
final ByteBuffer readOnlyBuffer = buffer.asReadOnlyBuffer();
|
||||||
return ApproximateHistogram.fromBytes(buffer);
|
readOnlyBuffer.limit(readOnlyBuffer.position() + numBytes);
|
||||||
|
return ApproximateHistogram.fromBytes(readOnlyBuffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Reference in New Issue