hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From te...@apache.org
Subject hbase git commit: HBASE-14252 RegionServers fail to start when setting hbase.ipc.server.callqueue.scan.ratio to 0 (Yubao Liu and Ted Yu)
Date Mon, 25 Apr 2016 21:34:26 GMT
Repository: hbase
Updated Branches:
  refs/heads/branch-1.3 13629a859 -> cf680ad19


HBASE-14252 RegionServers fail to start when setting hbase.ipc.server.callqueue.scan.ratio
to 0 (Yubao Liu and Ted Yu)


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/cf680ad1
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/cf680ad1
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/cf680ad1

Branch: refs/heads/branch-1.3
Commit: cf680ad19a16cee9438081fa44f3bc245d82bf10
Parents: 13629a8
Author: tedyu <yuzhihong@gmail.com>
Authored: Mon Apr 25 14:34:15 2016 -0700
Committer: tedyu <yuzhihong@gmail.com>
Committed: Mon Apr 25 14:34:15 2016 -0700

----------------------------------------------------------------------
 .../apache/hadoop/hbase/ipc/RWQueueRpcExecutor.java |  2 +-
 .../hadoop/hbase/ipc/TestSimpleRpcScheduler.java    | 16 ++++++++++++++++
 2 files changed, 17 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/cf680ad1/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/RWQueueRpcExecutor.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/RWQueueRpcExecutor.java
b/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/RWQueueRpcExecutor.java
index e0203ab..68e7b65 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/RWQueueRpcExecutor.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/RWQueueRpcExecutor.java
@@ -142,7 +142,7 @@ public class RWQueueRpcExecutor extends RpcExecutor {
     this.numScanQueues = numScanQueues;
     this.writeBalancer = getBalancer(numWriteQueues);
     this.readBalancer = getBalancer(numReadQueues);
-    this.scanBalancer = getBalancer(numScanQueues);
+    this.scanBalancer = numScanQueues > 0 ? getBalancer(numScanQueues) : null;
 
     queues = new ArrayList<BlockingQueue<CallRunner>>(numWriteQueues + numReadQueues
+ numScanQueues);
     LOG.debug(name + " writeQueues=" + numWriteQueues + " writeHandlers=" + writeHandlersCount
+

http://git-wip-us.apache.org/repos/asf/hbase/blob/cf680ad1/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 79fc091..561af58 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
@@ -247,6 +247,22 @@ public class TestSimpleRpcScheduler {
   }
 
   @Test
+  public void testScanQueueWithZeroScanRatio() throws Exception {
+    Configuration schedConf = HBaseConfiguration.create();
+    schedConf.setFloat(SimpleRpcScheduler.CALL_QUEUE_HANDLER_FACTOR_CONF_KEY, 1.0f);
+    schedConf.setFloat(SimpleRpcScheduler.CALL_QUEUE_READ_SHARE_CONF_KEY, 0.5f);
+    schedConf.setFloat(SimpleRpcScheduler.CALL_QUEUE_SCAN_SHARE_CONF_KEY, 0f);
+
+    PriorityFunction priority = mock(PriorityFunction.class);
+    when(priority.getPriority(any(RequestHeader.class), any(Message.class),
+      any(User.class))).thenReturn(HConstants.NORMAL_QOS);
+
+    RpcScheduler scheduler = new SimpleRpcScheduler(schedConf, 2, 1, 1, priority,
+                                                    HConstants.QOS_THRESHOLD);
+    assertNotEquals(scheduler, null);
+  }
+
+  @Test
   public void testScanQueues() throws Exception {
     Configuration schedConf = HBaseConfiguration.create();
     schedConf.setFloat(SimpleRpcScheduler.CALL_QUEUE_HANDLER_FACTOR_CONF_KEY, 1.0f);


Mime
View raw message