You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@bookkeeper.apache.org by "hangc0276 (via GitHub)" <gi...@apache.org> on 2023/04/10 14:55:11 UTC

[GitHub] [bookkeeper] hangc0276 commented on a diff in pull request #3895: [feature] [server] add dbStorage_readAheadCacheBatchBytesSize properties when read ahead entries

hangc0276 commented on code in PR #3895:
URL: https://github.com/apache/bookkeeper/pull/3895#discussion_r1161791955


##########
bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/storage/ldb/SingleDirectoryDbLedgerStorage.java:
##########
@@ -695,6 +696,19 @@ private void fillReadAheadCache(long orginalLedgerId, long firstEntryId, long fi
         }
     }
 
+    protected boolean chargeReadAheadCache(int currentReadAheadCount, long currentReadAheadBytes) {
+        // compatible with old logic
+        boolean chargeSizeCondition = currentReadAheadCount < readAheadCacheBatchSize
+                && currentReadAheadBytes < maxReadAheadBytesSize;
+        if (readAheadCacheBatchBytesSize > 0) {
+            // exact limits limit the size and count for each batch
+            chargeSizeCondition = currentReadAheadCount < readAheadCacheBatchSize

Review Comment:
   if (readAheadCacheBatchBytesSize > 0 && chargeSizeCondition) {
       chargeSizeCondition = chargeSizeCondition && currentReadAheadBytes < readCacheMaxSize;
   }



-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@bookkeeper.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org