Class ByteBufferMinMaxOffsetHeap
java.lang.Object
org.apache.druid.query.groupby.epinephelinae.ByteBufferMinMaxOffsetHeap
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
ConstructorsConstructorDescriptionByteBufferMinMaxOffsetHeap(ByteBuffer buf, int limit, Comparator<Integer> minComparator, LimitedBufferHashGrouper.BufferGrouperOffsetHeapIndexUpdater heapIndexUpdater) -
Method Summary
-
Constructor Details
-
ByteBufferMinMaxOffsetHeap
public ByteBufferMinMaxOffsetHeap(ByteBuffer buf, int limit, Comparator<Integer> minComparator, LimitedBufferHashGrouper.BufferGrouperOffsetHeapIndexUpdater heapIndexUpdater)
-
-
Method Details
-
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() -
toString
-