public static interface RocksDBCachingPriorityQueueSet.OrderedByteArraySetCache
| Modifier and Type | Field and Description |
|---|---|
static Comparator<byte[]> |
LEXICOGRAPHIC_BYTE_COMPARATOR
Comparator for byte arrays.
|
| 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.
|
static final Comparator<byte[]> LEXICOGRAPHIC_BYTE_COMPARATOR
int size()
int maxSize()
boolean isEmpty()
size() == 0.boolean isFull()
size() == maxSize().boolean add(@Nonnull byte[] toAdd)
true iff the cache was modified.boolean remove(@Nonnull byte[] toRemove)
true iff the cache was modified.@Nullable byte[] peekFirst()
null if empty.@Nullable byte[] peekLast()
null if empty.@Nullable byte[] pollFirst()
null if empty.@Nullable byte[] pollLast()
null if empty.void bulkLoadFromOrderedIterator(@Nonnull Iterator<byte[]> orderedIterator)
maxSize() elements from the iterator to the cache.
Iterator must be ordered in the same order as this cache.orderedIterator - iterator with elements in-order.Copyright © 2014–2020 The Apache Software Foundation. All rights reserved.