azagrebin commented on a change in pull request #6438: [FLINK-9981] Tune
performance of RocksDB implementation
URL: https://github.com/apache/flink/pull/6438#discussion_r206983891
##########
File path:
flink-state-backends/flink-statebackend-rocksdb/src/test/java/org/apache/flink/contrib/streaming/state/KeyGroupPartitionedPriorityQueueWithRocksDBStoreTest.java
##########
@@ -18,36 +18,54 @@
package org.apache.flink.contrib.streaming.state;
-import org.apache.flink.runtime.state.heap.CachingInternalPriorityQueueSet;
+import org.apache.flink.core.memory.ByteArrayInputStreamWithPos;
+import org.apache.flink.core.memory.ByteArrayOutputStreamWithPos;
+import org.apache.flink.runtime.state.InternalPriorityQueue;
+import org.apache.flink.runtime.state.InternalPriorityQueueTestBase;
import org.apache.flink.runtime.state.heap.KeyGroupPartitionedPriorityQueue;
-import
org.apache.flink.runtime.state.heap.KeyGroupPartitionedPriorityQueueTest;
-import org.apache.flink.runtime.state.heap.TreeOrderedSetCache;
import org.junit.Rule;
/**
- * Test of {@link KeyGroupPartitionedPriorityQueue} powered by a {@link
RocksDBOrderedSetStore}.
+ * Test of {@link KeyGroupPartitionedPriorityQueue} powered by a {@link
RocksDBCachingPriorityQueueSet}.
*/
-public class KeyGroupPartitionedPriorityQueueWithRocksDBStoreTest extends
KeyGroupPartitionedPriorityQueueTest {
+public class KeyGroupPartitionedPriorityQueueWithRocksDBStoreTest extends
InternalPriorityQueueTestBase {
@Rule
public final RocksDBResource rocksDBResource = new RocksDBResource();
@Override
- protected KeyGroupPartitionedPriorityQueue.PartitionQueueSetFactory<
- TestElement,
CachingInternalPriorityQueueSet<TestElement>> newFactory(
- int initialCapacity) {
-
- return (keyGroupId, numKeyGroups, elementComparator) -> {
-
CachingInternalPriorityQueueSet.OrderedSetCache<TestElement> cache =
- new
TreeOrderedSetCache<>(TEST_ELEMENT_COMPARATOR, 32);
-
CachingInternalPriorityQueueSet.OrderedSetStore<TestElement> store =
-
RocksDBOrderedSetStoreTest.createRocksDBOrderedStore(
- rocksDBResource,
- TestElementSerializer.INSTANCE,
- keyGroupId,
- numKeyGroups);
- return new CachingInternalPriorityQueueSet<>(cache,
store);
+ protected InternalPriorityQueue<TestElement> newPriorityQueue(int
initialCapacity) {
+ return new KeyGroupPartitionedPriorityQueue<>(
+ KEY_EXTRACTOR_FUNCTION,
+ TEST_ELEMENT_PRIORITY_COMPARATOR,
+ newFactory(initialCapacity),
+ KEY_GROUP_RANGE,
KEY_GROUP_RANGE.getNumberOfKeyGroups());
+ }
+
+ @Override
+ protected boolean testSetSemanticsAgainstDuplicateElements() {
+ return true;
+ }
+
+ private KeyGroupPartitionedPriorityQueue.PartitionQueueSetFactory<
+ TestElement, RocksDBCachingPriorityQueueSet<TestElement>>
newFactory(int initialCapacity) {
Review comment:
Do we want this currently unused `initialCapacity` parameter?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services