public class TreeOrderedSetCache extends Object implements RocksDBCachingPriorityQueueSet.OrderedByteArraySetCache
TreeSet.LEXICOGRAPHIC_BYTE_COMPARATOR| 限定符和类型 | 方法和说明 |
|---|---|
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()
public int maxSize()
public boolean isEmpty()
size() == 0.public boolean isFull()
size() == maxSize().public boolean add(@Nonnull byte[] toAdd)
true iff the cache was modified.public boolean remove(@Nonnull byte[] toRemove)
true iff the cache was modified.@Nullable public byte[] peekFirst()
null if empty.@Nullable public byte[] peekLast()
null if empty.@Nullable public byte[] pollFirst()
null if empty.@Nullable public byte[] pollLast()
null if empty.public 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.bulkLoadFromOrderedIterator 在接口中 RocksDBCachingPriorityQueueSet.OrderedByteArraySetCacheorderedIterator - iterator with elements in-order.Copyright © 2014–2019 The Apache Software Foundation. All rights reserved.