Class ByteBufferMinMaxOffsetHeap
- java.lang.Object
-
- org.apache.druid.query.groupby.epinephelinae.ByteBufferMinMaxOffsetHeap
-
public class ByteBufferMinMaxOffsetHeap extends Object
ByteBuffer-based implementation of the min-max heap developed by Atkinson, et al. (http://portal.acm.org/citation.cfm?id=6621), with some utility functions from Guava's MinMaxPriorityQueue.
-
-
Constructor Summary
Constructors Constructor Description ByteBufferMinMaxOffsetHeap(ByteBuffer buf, int limit, Comparator<Integer> minComparator, LimitedBufferHashGrouper.BufferGrouperOffsetHeapIndexUpdater heapIndexUpdater)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intaddOffset(int offset)intgetAt(int index)intgetHeapSize()intindexOf(int offset)intremoveAt(int deletedIndex)intremoveMax()intremoveMin()voidremoveOffset(int offset)voidreset()voidsetAt(int index, int newVal)StringtoString()
-
-
-
Constructor Detail
-
ByteBufferMinMaxOffsetHeap
public ByteBufferMinMaxOffsetHeap(ByteBuffer buf, int limit, Comparator<Integer> minComparator, LimitedBufferHashGrouper.BufferGrouperOffsetHeapIndexUpdater heapIndexUpdater)
-
-
Method Detail
-
reset
public void reset()
-
addOffset
public int addOffset(int offset)
-
removeMin
public int removeMin()
-
removeMax
public int removeMax()
-
removeAt
public int removeAt(int deletedIndex)
-
setAt
public void setAt(int index, int newVal)
-
getAt
public int getAt(int index)
-
indexOf
public int indexOf(int offset)
-
removeOffset
public void removeOffset(int offset)
-
getHeapSize
public int getHeapSize()
-
-