public class TreeOrderedSetCache extends Object implements RocksDBCachingPriorityQueueSet.OrderedByteArraySetCache
TreeSet.LEXICOGRAPHIC_BYTE_COMPARATOR| Modifier and Type | Method and Description |
|---|---|
boolean |
add(byte[] toAdd)
Adds the given element, if it was not already contained.
|
void |
bulkLoadFromOrderedIterator(Iterator<byte[]> orderedIterator)
Clears the cache and adds up to
maxSize() elements from the iterator to the cache. |
boolean |
isEmpty()
Returns
size() == 0. |
boolean |
isFull()
Returns
size() == maxSize(). |
int |
maxSize()
Returns the maximum number of elements that can be stored in the cache.
|
byte[] |
peekFirst()
Returns the first element or
null if empty. |
byte[] |
peekLast()
Returns the last element or
null if empty. |
byte[] |
pollFirst()
Returns and removes the first element or returns
null if empty. |
byte[] |
pollLast()
Returns and removes the last element or returns
null if empty. |
boolean |
remove(byte[] toRemove)
Removes the given element, if it is contained.
|
int |
size()
Returns the number of contained elements.
|
public int size()
RocksDBCachingPriorityQueueSet.OrderedByteArraySetCachesize in interface RocksDBCachingPriorityQueueSet.OrderedByteArraySetCachepublic int maxSize()
RocksDBCachingPriorityQueueSet.OrderedByteArraySetCachemaxSize in interface RocksDBCachingPriorityQueueSet.OrderedByteArraySetCachepublic boolean isEmpty()
RocksDBCachingPriorityQueueSet.OrderedByteArraySetCachesize() == 0.isEmpty in interface RocksDBCachingPriorityQueueSet.OrderedByteArraySetCachepublic boolean isFull()
RocksDBCachingPriorityQueueSet.OrderedByteArraySetCachesize() == maxSize().isFull in interface RocksDBCachingPriorityQueueSet.OrderedByteArraySetCachepublic boolean add(@Nonnull byte[] toAdd)
RocksDBCachingPriorityQueueSet.OrderedByteArraySetCachetrue iff the cache was modified.add in interface RocksDBCachingPriorityQueueSet.OrderedByteArraySetCachepublic boolean remove(@Nonnull byte[] toRemove)
RocksDBCachingPriorityQueueSet.OrderedByteArraySetCachetrue iff the cache was modified.remove in interface RocksDBCachingPriorityQueueSet.OrderedByteArraySetCache@Nullable public byte[] peekFirst()
RocksDBCachingPriorityQueueSet.OrderedByteArraySetCachenull if empty.peekFirst in interface RocksDBCachingPriorityQueueSet.OrderedByteArraySetCache@Nullable public byte[] peekLast()
RocksDBCachingPriorityQueueSet.OrderedByteArraySetCachenull if empty.peekLast in interface RocksDBCachingPriorityQueueSet.OrderedByteArraySetCache@Nullable public byte[] pollFirst()
RocksDBCachingPriorityQueueSet.OrderedByteArraySetCachenull if empty.pollFirst in interface RocksDBCachingPriorityQueueSet.OrderedByteArraySetCache@Nullable public byte[] pollLast()
RocksDBCachingPriorityQueueSet.OrderedByteArraySetCachenull if empty.pollLast in interface RocksDBCachingPriorityQueueSet.OrderedByteArraySetCachepublic void bulkLoadFromOrderedIterator(@Nonnull Iterator<byte[]> orderedIterator)
RocksDBCachingPriorityQueueSet.OrderedByteArraySetCachemaxSize() elements from the iterator to the cache.
Iterator must be ordered in the same order as this cache.bulkLoadFromOrderedIterator in interface RocksDBCachingPriorityQueueSet.OrderedByteArraySetCacheorderedIterator - iterator with elements in-order.Copyright © 2014–2020 The Apache Software Foundation. All rights reserved.