You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@bookkeeper.apache.org by "zymap (via GitHub)" <gi...@apache.org> on 2023/03/29 01:33:44 UTC

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

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


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

Review Comment:
   We should also check it is smaller than the max read cache size.



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