HBASE-18772 (Addendum) we pass the wrong arguments to AdaptiveLifoCoDelCallQueue
Signed-off-by: Chia-Ping Tsai <chia7...@gmail.com> Project: http://git-wip-us.apache.org/repos/asf/hbase/repo Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/5c07dba4 Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/5c07dba4 Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/5c07dba4 Branch: refs/heads/HBASE-18467 Commit: 5c07dba43a9aacd77037948528b45fce4a42d822 Parents: fb3c8bf Author: Yechao Chen <chenyec...@gmail.com> Authored: Thu Sep 14 16:53:35 2017 +0800 Committer: Chia-Ping Tsai <chia7...@gmail.com> Committed: Fri Sep 15 10:27:47 2017 +0800 ---------------------------------------------------------------------- .../java/org/apache/hadoop/hbase/ipc/RpcExecutor.java | 10 +++++----- .../apache/hadoop/hbase/ipc/TestSimpleRpcScheduler.java | 2 -- 2 files changed, 5 insertions(+), 7 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hbase/blob/5c07dba4/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/RpcExecutor.java ---------------------------------------------------------------------- diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/RpcExecutor.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/RpcExecutor.java index 3971fb3..5c017305 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/RpcExecutor.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/RpcExecutor.java @@ -26,7 +26,7 @@ import java.util.concurrent.BlockingQueue; import java.util.concurrent.LinkedBlockingQueue; import java.util.concurrent.ThreadLocalRandom; import java.util.concurrent.atomic.AtomicInteger; -import java.util.concurrent.atomic.AtomicLong; +import java.util.concurrent.atomic.LongAdder; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -76,8 +76,8 @@ public abstract class RpcExecutor { public static final int CALL_QUEUE_CODEL_DEFAULT_INTERVAL = 100; public static final double CALL_QUEUE_CODEL_DEFAULT_LIFO_THRESHOLD = 0.8; - private AtomicLong numGeneralCallsDropped = new AtomicLong(); - private AtomicLong numLifoModeSwitches = new AtomicLong(); + private LongAdder numGeneralCallsDropped = new LongAdder(); + private LongAdder numLifoModeSwitches = new LongAdder(); protected final int numCallQueues; protected final List<BlockingQueue<CallRunner>> queues; @@ -385,11 +385,11 @@ public abstract class RpcExecutor { } public long getNumGeneralCallsDropped() { - return numGeneralCallsDropped.get(); + return numGeneralCallsDropped.longValue(); } public long getNumLifoModeSwitches() { - return numLifoModeSwitches.get(); + return numLifoModeSwitches.longValue(); } public int getActiveHandlerCount() { http://git-wip-us.apache.org/repos/asf/hbase/blob/5c07dba4/hbase-server/src/test/java/org/apache/hadoop/hbase/ipc/TestSimpleRpcScheduler.java ---------------------------------------------------------------------- diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/ipc/TestSimpleRpcScheduler.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/ipc/TestSimpleRpcScheduler.java index 90d5772..b4f93c5 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/ipc/TestSimpleRpcScheduler.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/ipc/TestSimpleRpcScheduler.java @@ -67,7 +67,6 @@ import org.apache.hadoop.hbase.util.EnvironmentEdge; import org.apache.hadoop.hbase.util.EnvironmentEdgeManager; import org.apache.hadoop.hbase.util.Threads; import org.junit.Before; -import org.junit.Ignore; import org.junit.Rule; import org.junit.Test; import org.junit.experimental.categories.Category; @@ -431,7 +430,6 @@ public class TestSimpleRpcScheduler { // fastpath thread to: new FastPathBalancedQueueRpcExecutor("CodelFPBQ.default", handlerCount, numCallQueues... // Codel is hard to test. This test is going to be flakey given it all timer-based. Disabling for now till chat // with authors. - @Ignore @Test public void testCoDelScheduling() throws Exception { CoDelEnvironmentEdge envEdge = new CoDelEnvironmentEdge();