mirror of https://github.com/apache/druid.git
don't assume bytebuffer limit is set
This commit is contained in:
parent
21e54d8060
commit
03c51518bc
|
@ -66,9 +66,11 @@ public class HyperUniquesBufferAggregator implements BufferAggregator
|
|||
@Override
|
||||
public Object get(ByteBuffer buf, int position)
|
||||
{
|
||||
ByteBuffer dataCopyBuffer = ByteBuffer.allocateDirect(HyperLogLogCollector.getLatestNumBytesForDenseStorage());
|
||||
final int size = HyperLogLogCollector.getLatestNumBytesForDenseStorage();
|
||||
ByteBuffer dataCopyBuffer = ByteBuffer.allocateDirect(size);
|
||||
ByteBuffer mutationBuffer = buf.duplicate();
|
||||
mutationBuffer.position(position);
|
||||
mutationBuffer.limit(position + size);
|
||||
dataCopyBuffer.put(mutationBuffer);
|
||||
dataCopyBuffer.rewind();
|
||||
return HyperLogLogCollector.makeCollector(dataCopyBuffer);
|
||||
|
|
Loading…
Reference in New Issue