carp84 commented on a change in pull request #10820:
[FLINK-15512][statebackend] Refactor the mechanism to calculate the cache
capacity shared among RocksDB instance(s)
URL: https://github.com/apache/flink/pull/10820#discussion_r365226910
##########
File path:
flink-state-backends/flink-statebackend-rocksdb/src/main/java/org/apache/flink/contrib/streaming/state/RocksDBOperationUtils.java
##########
@@ -213,4 +211,40 @@ public static void addColumnFamilyOptionsToCloseLater(
throw new IOException("Failed to acquire shared cache
resource for RocksDB", e);
}
}
+
+ @VisibleForTesting
+ static RocksDBSharedResources allocateRocksDBSharedResources(long size,
double writeBufferRatio, double highPriorityPoolRatio) {
+ long calculatedCacheSize = calculateActualCacheSize(size,
writeBufferRatio);
+ final Cache cache = createCache(calculatedCacheSize,
highPriorityPoolRatio);
+ final WriteBufferManager wbm = new WriteBufferManager((long)
(writeBufferRatio * size), cache);
Review comment:
The `WriteBufferManager` size should also be calculated with the deduced
formula: `2 * total_memory_size * write_buffer_ratio / 3`
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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