added root priority and executor on master
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/SimpleRpcScheduler.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/SimpleRpcScheduler.java
index 0c3e6c2..b424099 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/SimpleRpcScheduler.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/SimpleRpcScheduler.java
@@ -43,6 +43,11 @@
private final RpcExecutor replicationExecutor;
/**
+ * Executor for root region only.
+ */
+ private final RpcExecutor rootTransitionExecutor;
+
+ /**
* This executor is only for meta transition
*/
private final RpcExecutor metaTransitionExecutor;
@@ -122,6 +127,9 @@
RpcExecutor.CALL_QUEUE_TYPE_FIFO_CONF_VALUE, maxPriorityQueueLength, priority, conf,
abortable) :
null;
+ this.rootTransitionExecutor = new FastPathBalancedQueueRpcExecutor("rootPriority.FPBQ", 1,
+ RpcExecutor.CALL_QUEUE_TYPE_FIFO_CONF_VALUE, maxPriorityQueueLength, priority, conf,
+ abortable);
}
public SimpleRpcScheduler(Configuration conf, int handlerCount, int priorityHandlerCount,
@@ -143,6 +151,9 @@
if (replicationExecutor != null) {
replicationExecutor.resizeQueues(conf);
}
+ if (rootTransitionExecutor != null) {
+ rootTransitionExecutor.resizeQueues(conf);
+ }
if (metaTransitionExecutor != null) {
metaTransitionExecutor.resizeQueues(conf);
}
@@ -168,10 +179,12 @@
if (replicationExecutor != null) {
replicationExecutor.start(port);
}
+ if (rootTransitionExecutor != null) {
+ rootTransitionExecutor.start(port);
+ }
if (metaTransitionExecutor != null) {
metaTransitionExecutor.start(port);
}
-
}
@Override
@@ -186,7 +199,9 @@
if (metaTransitionExecutor != null) {
metaTransitionExecutor.stop();
}
-
+ if (rootTransitionExecutor != null) {
+ rootTransitionExecutor.stop();
+ }
}
@Override
@@ -197,7 +212,10 @@
if (level == HConstants.PRIORITY_UNSET) {
level = HConstants.NORMAL_QOS;
}
- if (metaTransitionExecutor != null &&
+ if (rootTransitionExecutor != null &&
+ level == MasterAnnotationReadingPriorityFunction.ROOT_TRANSITION_QOS) {
+ return rootTransitionExecutor.dispatch(callTask);
+ } else if (metaTransitionExecutor != null &&
level == MasterAnnotationReadingPriorityFunction.META_TRANSITION_QOS) {
return metaTransitionExecutor.dispatch(callTask);
} else if (priorityExecutor != null && level > highPriorityLevel) {
@@ -208,7 +226,7 @@
return callExecutor.dispatch(callTask);
}
}
-
+
@Override
public int getMetaPriorityQueueLength() {
return metaTransitionExecutor == null ? 0 : metaTransitionExecutor.getQueueLength();
@@ -326,6 +344,13 @@
callQueueInfo.setCallMethodSize(queueName, metaTransitionExecutor.getCallQueueSizeSummary());
}
+ if (null != rootTransitionExecutor) {
+ queueName = "ROOT Transition Queue";
+ callQueueInfo.setCallMethodCount(queueName,
+ rootTransitionExecutor.getCallQueueCountsSummary());
+ callQueueInfo.setCallMethodSize(queueName, rootTransitionExecutor.getCallQueueSizeSummary());
+ }
+
return callQueueInfo;
}
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/MasterAnnotationReadingPriorityFunction.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/MasterAnnotationReadingPriorityFunction.java
index 87f345e..3a6cb5b 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/MasterAnnotationReadingPriorityFunction.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/MasterAnnotationReadingPriorityFunction.java
@@ -50,7 +50,8 @@
@InterfaceAudience.Private
public class MasterAnnotationReadingPriorityFunction extends AnnotationReadingPriorityFunction {
- public static final int META_TRANSITION_QOS = 300;
+ public static final int ROOT_TRANSITION_QOS = 300;
+ public static final int META_TRANSITION_QOS = 299;
public MasterAnnotationReadingPriorityFunction(final RSRpcServices rpcServices) {
this(rpcServices, rpcServices.getClass());
@@ -69,7 +70,7 @@
// every single RPC request.
int priorityByAnnotation = getAnnotatedPriority(header);
if (priorityByAnnotation >= 0) {
- // no one can have higher priority than meta transition.
+ // No one can have higher priority than ROOT and META transition.
if (priorityByAnnotation >= META_TRANSITION_QOS) {
return META_TRANSITION_QOS - 1;
} else {
@@ -77,7 +78,7 @@
}
}
- // If meta is moving then all the other of reports of state transitions will be
+ // If ROOT or meta are moving then all the other of reports of state transitions will be
// un able to edit meta. Those blocked reports should not keep the report that opens meta from
// running. Hence all reports of meta transition should always be in a different thread.
// This keeps from deadlocking the cluster.
@@ -89,7 +90,9 @@
if (rst.getRegionInfoList() != null) {
for (HBaseProtos.RegionInfo info : rst.getRegionInfoList()) {
TableName tn = ProtobufUtil.toTableName(info.getTableName());
- if (TableName.META_TABLE_NAME.equals(tn)) {
+ if (TableName.ROOT_TABLE_NAME.equals(tn)) {
+ return ROOT_TRANSITION_QOS;
+ } else if (TableName.META_TABLE_NAME.equals(tn)) {
return META_TRANSITION_QOS;
}
}