E - the type of the contained elements in the queue.public class RocksDBCachingPriorityQueueSet<E extends org.apache.flink.runtime.state.heap.HeapPriorityQueueElement> extends Object implements org.apache.flink.runtime.state.InternalPriorityQueue<E>, org.apache.flink.runtime.state.heap.HeapPriorityQueueElement
TreeSet to cache the bytes
of up to the first n elements from RocksDB in memory to reduce interaction with RocksDB, in particular seek
operations. Cache uses a simple write-through policy.| Modifier and Type | Class and Description |
|---|---|
static interface |
RocksDBCachingPriorityQueueSet.OrderedByteArraySetCache
Cache that is organized as an ordered set for byte-arrays.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(E toAdd) |
void |
addAll(Collection<? extends E> toAdd) |
int |
getInternalIndex() |
boolean |
isEmpty() |
org.apache.flink.util.CloseableIterator<E> |
iterator() |
E |
peek() |
E |
poll() |
boolean |
remove(E toRemove) |
void |
setInternalIndex(int newIndex) |
int |
size()
This implementation comes at a relatively high cost per invocation.
|
@Nullable public E peek()
peek in interface org.apache.flink.runtime.state.InternalPriorityQueue<E extends org.apache.flink.runtime.state.heap.HeapPriorityQueueElement>@Nullable public E poll()
poll in interface org.apache.flink.runtime.state.InternalPriorityQueue<E extends org.apache.flink.runtime.state.heap.HeapPriorityQueueElement>public boolean add(@Nonnull E toAdd)
add in interface org.apache.flink.runtime.state.InternalPriorityQueue<E extends org.apache.flink.runtime.state.heap.HeapPriorityQueueElement>public boolean remove(@Nonnull E toRemove)
remove in interface org.apache.flink.runtime.state.InternalPriorityQueue<E extends org.apache.flink.runtime.state.heap.HeapPriorityQueueElement>public void addAll(@Nullable Collection<? extends E> toAdd)
addAll in interface org.apache.flink.runtime.state.InternalPriorityQueue<E extends org.apache.flink.runtime.state.heap.HeapPriorityQueueElement>public boolean isEmpty()
isEmpty in interface org.apache.flink.runtime.state.InternalPriorityQueue<E extends org.apache.flink.runtime.state.heap.HeapPriorityQueueElement>@Nonnull public org.apache.flink.util.CloseableIterator<E> iterator()
iterator in interface org.apache.flink.runtime.state.InternalPriorityQueue<E extends org.apache.flink.runtime.state.heap.HeapPriorityQueueElement>public int size()
size in interface org.apache.flink.runtime.state.InternalPriorityQueue<E extends org.apache.flink.runtime.state.heap.HeapPriorityQueueElement>public int getInternalIndex()
getInternalIndex in interface org.apache.flink.runtime.state.heap.HeapPriorityQueueElementpublic void setInternalIndex(int newIndex)
setInternalIndex in interface org.apache.flink.runtime.state.heap.HeapPriorityQueueElementCopyright © 2014–2020 The Apache Software Foundation. All rights reserved.