From 848e9d5abc9974a01bf1e7b3cc2697aa74f6440d Mon Sep 17 00:00:00 2001 From: Yechao Chen Date: Thu, 14 Sep 2017 16:53:35 +0800 Subject: [PATCH] HBASE-18772 (Addendum) we pass the wrong arguments to AdaptiveLifoCoDelCallQueue Signed-off-by: Chia-Ping Tsai --- .../java/org/apache/hadoop/hbase/ipc/RpcExecutor.java | 10 +++++----- .../hadoop/hbase/ipc/TestSimpleRpcScheduler.java | 2 -- 2 files changed, 5 insertions(+), 7 deletions(-) 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 3971fb337e7..5c017305abe 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> 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() { 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 90d5772a3bf..b4f93c5a9ad 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();