You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2020/01/10 13:17:09 UTC

[GitHub] [flink] 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)

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 + write_buffer_ratio)`

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services