Class RocksDBCachingPriorityQueueSet<E extends org.apache.flink.runtime.state.heap.HeapPriorityQueueElement>
- java.lang.Object
-
- org.apache.flink.runtime.state.heap.AbstractHeapPriorityQueueElement
-
- org.apache.flink.contrib.streaming.state.RocksDBCachingPriorityQueueSet<E>
-
- Type Parameters:
E- the type of the contained elements in the queue.
- All Implemented Interfaces:
org.apache.flink.runtime.state.heap.HeapPriorityQueueElement,org.apache.flink.runtime.state.InternalPriorityQueue<E>
public class RocksDBCachingPriorityQueueSet<E extends org.apache.flink.runtime.state.heap.HeapPriorityQueueElement> extends org.apache.flink.runtime.state.heap.AbstractHeapPriorityQueueElement implements org.apache.flink.runtime.state.InternalPriorityQueue<E>A priority queue with set semantics, implemented on top of RocksDB. This uses aTreeSetto 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.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceRocksDBCachingPriorityQueueSet.OrderedByteArraySetCacheCache that is organized as an ordered set for byte-arrays.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanadd(E toAdd)voidaddAll(Collection<? extends E> toAdd)booleanisEmpty()org.apache.flink.util.CloseableIterator<E>iterator()Epeek()Epoll()booleanremove(E toRemove)intsize()This implementation comes at a relatively high cost per invocation.
-
-
-
Method Detail
-
peek
@Nullable public E peek()
- Specified by:
peekin interfaceorg.apache.flink.runtime.state.InternalPriorityQueue<E extends org.apache.flink.runtime.state.heap.HeapPriorityQueueElement>
-
poll
@Nullable public E poll()
- Specified by:
pollin interfaceorg.apache.flink.runtime.state.InternalPriorityQueue<E extends org.apache.flink.runtime.state.heap.HeapPriorityQueueElement>
-
add
public boolean add(@Nonnull E toAdd)
- Specified by:
addin interfaceorg.apache.flink.runtime.state.InternalPriorityQueue<E extends org.apache.flink.runtime.state.heap.HeapPriorityQueueElement>
-
remove
public boolean remove(@Nonnull E toRemove)
- Specified by:
removein interfaceorg.apache.flink.runtime.state.InternalPriorityQueue<E extends org.apache.flink.runtime.state.heap.HeapPriorityQueueElement>
-
addAll
public void addAll(@Nullable Collection<? extends E> toAdd)
- Specified by:
addAllin interfaceorg.apache.flink.runtime.state.InternalPriorityQueue<E extends org.apache.flink.runtime.state.heap.HeapPriorityQueueElement>
-
isEmpty
public boolean isEmpty()
- Specified by:
isEmptyin interfaceorg.apache.flink.runtime.state.InternalPriorityQueue<E extends org.apache.flink.runtime.state.heap.HeapPriorityQueueElement>
-
iterator
@Nonnull public org.apache.flink.util.CloseableIterator<E> iterator()
- Specified by:
iteratorin interfaceorg.apache.flink.runtime.state.InternalPriorityQueue<E extends org.apache.flink.runtime.state.heap.HeapPriorityQueueElement>
-
size
public int size()
This implementation comes at a relatively high cost per invocation. It should not be called repeatedly when it is clear that the value did not change. Currently this is only truly used to realize certain higher-level tests.- Specified by:
sizein interfaceorg.apache.flink.runtime.state.InternalPriorityQueue<E extends org.apache.flink.runtime.state.heap.HeapPriorityQueueElement>
-
-