diff --git a/zookeeper-server/src/main/java/org/apache/zookeeper/server/BlueThrottle.java b/zookeeper-server/src/main/java/org/apache/zookeeper/server/BlueThrottle.java index cc22f572848..a7c46c00aa7 100644 --- a/zookeeper-server/src/main/java/org/apache/zookeeper/server/BlueThrottle.java +++ b/zookeeper-server/src/main/java/org/apache/zookeeper/server/BlueThrottle.java @@ -162,11 +162,11 @@ public synchronized double getDecreasePoint() { return decreasePoint; } - public double getDropChance() { + public synchronized double getDropChance() { return drop; } - public int getDeficit() { + public synchronized int getDeficit() { return maxTokens - tokens; } @@ -199,7 +199,7 @@ public synchronized boolean checkLimit(int need) { return true; } - public boolean checkBlue(long now) { + public synchronized boolean checkBlue(long now) { int length = maxTokens - tokens; int limit = maxTokens; long diff = now - lastFreeze;