4747 * released
4848 * </ul>
4949 *
50- * <p>Closeable state determination: When reference count is 0, it's in closeable state, no
51- * additional state variables needed.
50+ * <p>Closeable state determination: When reference count is 0, it's in closeable state.
5251 *
5352 * <p>Note: This class is thread-safe and can be used concurrently across multiple threads.
5453 */
@@ -145,8 +144,6 @@ public int release() {
145144 LOG .debug ("Released RocksDBSharedResource, reference count: {}" , newCount );
146145
147146 if (newCount == 0 ) {
148- // When reference count is 0, don't release resources, just enter closeable state
149- LOG .debug ("RocksDBSharedResource transitioned to closeable state" );
150147 // Wake up any waiting close() method
151148 lock .notifyAll ();
152149 } else if (newCount < 0 ) {
@@ -242,6 +239,12 @@ private void createSharedBlockCache() {
242239 }
243240
244241 long cacheSize = configuration .get (ConfigOptions .KV_SHARED_BLOCK_CACHE_SIZE ).getBytes ();
242+ int cacheNumShardBits =
243+ configuration .get (ConfigOptions .KV_SHARED_BLOCK_CACHE_NUM_SHARD_BITS );
244+ boolean strictCapacityLimit =
245+ configuration .get (ConfigOptions .KV_SHARED_BLOCK_CACHE_STRICT_CAPACITY_LIMIT );
246+ double highPriPoolRatio =
247+ configuration .get (ConfigOptions .KV_SHARED_BLOCK_CACHE_HIGH_PRI_POOL_RATIO );
245248
246249 // Load RocksDB native library if needed, this operation is idempotent
247250 RocksDB .loadLibrary ();
@@ -252,9 +255,15 @@ private void createSharedBlockCache() {
252255 // - numShardBits: number of bits for shard count (8 means 256 shards)
253256 // - strictCapacityLimit: whether to strictly limit capacity
254257 // - highPriPoolRatio: ratio of high priority pool
255- sharedBlockCache = new LRUCache (cacheSize , 8 , true , 0.5 );
256-
257- LOG .info ("Created shared block cache with size: {} bytes" , cacheSize );
258+ sharedBlockCache =
259+ new LRUCache (cacheSize , cacheNumShardBits , strictCapacityLimit , highPriPoolRatio );
260+
261+ LOG .info (
262+ "Created shared block cache with size: {} bytes, numShardBits: {}, strictCapacityLimit: {}, highPriPoolRatio: {}" ,
263+ cacheSize ,
264+ cacheNumShardBits ,
265+ strictCapacityLimit ,
266+ highPriPoolRatio );
258267 }
259268
260269 /** Close shared resources. */
0 commit comments