|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.accumulo.core.file.blockfile.cache.CachedBlockQueue
public class CachedBlockQueue
A memory-bound queue that will grow until an element brings total size >= maxSize. From then on, only entries that are sorted larger than the smallest current entry will be inserted/replaced.
Use this when you want to find the largest elements (according to their ordering, not their heap size) that consume as close to the specified maxSize as possible. Default behavior is to grow just above rather than just below specified max.
Object used in this queue must implement HeapSize
as well as Comparable
.
Constructor Summary | |
---|---|
CachedBlockQueue(long maxSize,
long blockSize)
|
Method Summary | |
---|---|
void |
add(CachedBlock cb)
Attempt to add the specified cached block to this queue. |
CachedBlock[] |
get()
Get a sorted List of all elements in this queue, in descending order. |
LinkedList<CachedBlock> |
getList()
Get a sorted List of all elements in this queue, in descending order. |
long |
heapSize()
Total size of all elements in this queue. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CachedBlockQueue(long maxSize, long blockSize)
maxSize
- the target size of elements in the queueblockSize
- expected average size of blocksMethod Detail |
---|
public void add(CachedBlock cb)
If the queue is smaller than the max size, or if the specified element is ordered before the smallest element in the queue, the element will be added to the queue. Otherwise, there is no side effect of this call.
cb
- block to try to add to the queuepublic CachedBlock[] get()
public LinkedList<CachedBlock> getList()
public long heapSize()
heapSize
in interface HeapSize
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |