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 int
addOffset(int offset)
int
getAt(int index)
int
getHeapSize()
int
indexOf(int offset)
int
removeAt(int deletedIndex)
int
removeMax()
int
removeMin()
void
removeOffset(int offset)
void
reset()
void
setAt(int index, int newVal)
String
toString()
-
-
-
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()
-
-