fix fillReadAheadCache stat bug
These code blocks will not be executed:
dbLedgerStorageStats.getReadAheadBatchCountStats().registerSuccessfulValue(count);
dbLedgerStorageStats.getReadAheadBatchSizeStats().registerSuccessfulValue(size);
### Motivation
fix fillReadAheadCache stat bug
### Changes
Replace return with break to exit the while loop
Reviewers: Enrico Olivelli <eolivelli@gmail.com>, Rajan Dhabalia <rdhabalia@apache.org>
This closes #2383 from holmes07/master
diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/storage/ldb/SingleDirectoryDbLedgerStorage.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/storage/ldb/SingleDirectoryDbLedgerStorage.java
index 60e3d64..931c3e0 100644
--- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/storage/ldb/SingleDirectoryDbLedgerStorage.java
+++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/storage/ldb/SingleDirectoryDbLedgerStorage.java
@@ -475,7 +475,7 @@
if (currentEntryLedgerId != orginalLedgerId) {
// Found an entry belonging to a different ledger, stopping read-ahead
- return;
+ break;
}
// Insert entry in read cache