You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@bookkeeper.apache.org by yo...@apache.org on 2022/04/13 01:49:19 UTC
[bookkeeper] branch master updated: simplify throttle code in metadata scanning (#3196)
This is an automated email from the ASF dual-hosted git repository.
yong pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/bookkeeper.git
The following commit(s) were added to refs/heads/master by this push:
new bbd2d4a4f simplify throttle code in metadata scanning (#3196)
bbd2d4a4f is described below
commit bbd2d4a4f787094c1cc6b67c2c2bd9794ffe435e
Author: Hang Chen <ch...@apache.org>
AuthorDate: Wed Apr 13 09:49:15 2022 +0800
simplify throttle code in metadata scanning (#3196)
### Motivation
The throttler has been checked whether throttle by bytes in `acquire` method, we doesn't need double check.
### Changes
Remove the double check of whether throttle by bytes.
---
.../src/main/java/org/apache/bookkeeper/bookie/EntryLogger.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/EntryLogger.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/EntryLogger.java
index 8be995a19..859f3e588 100644
--- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/EntryLogger.java
+++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/EntryLogger.java
@@ -1178,7 +1178,7 @@ public class EntryLogger {
@Override
public void process(long ledgerId, long offset, ByteBuf entry) throws IOException {
if (throttler != null) {
- throttler.acquire(conf.getIsThrottleByBytes() ? entry.readableBytes() : 1);
+ throttler.acquire(entry.readableBytes());
}
// add new entry size of a ledger to entry log meta
meta.addLedgerSize(ledgerId, entry.readableBytes() + 4);