hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From apurt...@apache.org
Subject [5/5] hbase git commit: HBASE-13994 Backport HBASE-13917 (Remove string comparison to identify request priority) to 0.98
Date Wed, 01 Jul 2015 22:02:03 GMT
HBASE-13994 Backport HBASE-13917 (Remove string comparison to identify request priority) to
0.98


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

Branch: refs/heads/0.98
Commit: f04a68f73fc7a7b08091dbac199ace2ed3c7e0a6
Parents: 1c43473
Author: Andrew Purtell <apurtell@apache.org>
Authored: Wed Jul 1 12:08:45 2015 -0700
Committer: Andrew Purtell <apurtell@apache.org>
Committed: Wed Jul 1 14:33:09 2015 -0700

----------------------------------------------------------------------
 .../java/org/apache/hadoop/hbase/ipc/RWQueueRpcExecutor.java  | 7 ++++---
 .../hbase/regionserver/AnnotationReadingPriorityFunction.java | 6 +++---
 2 files changed, 7 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/f04a68f7/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 55889ea..1b4aeee 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
@@ -33,6 +33,8 @@ import org.apache.hadoop.hbase.classification.InterfaceAudience;
 import org.apache.hadoop.hbase.classification.InterfaceStability;
 import org.apache.hadoop.hbase.protobuf.generated.ClientProtos.Action;
 import org.apache.hadoop.hbase.protobuf.generated.ClientProtos.MultiRequest;
+import org.apache.hadoop.hbase.protobuf.generated
+  .RegionServerStatusProtos.ReportRegionStateTransitionRequest;
 import org.apache.hadoop.hbase.protobuf.generated.ClientProtos.RegionAction;
 import org.apache.hadoop.hbase.protobuf.generated.RPCProtos.RequestHeader;
 import org.apache.hadoop.hbase.util.ReflectionUtils;
@@ -127,8 +129,7 @@ public class RWQueueRpcExecutor extends RpcExecutor {
 
   private boolean isWriteRequest(final RequestHeader header, final Message param) {
     // TODO: Is there a better way to do this?
-    String methodName = header.getMethodName();
-    if (methodName.equalsIgnoreCase("multi") && param instanceof MultiRequest) {
+    if (param instanceof MultiRequest) {
       MultiRequest multi = (MultiRequest)param;
       for (RegionAction regionAction : multi.getRegionActionList()) {
         for (Action action: regionAction.getActionList()) {
@@ -138,7 +139,7 @@ public class RWQueueRpcExecutor extends RpcExecutor {
         }
       }
     }
-    if (methodName.equalsIgnoreCase("ReportRegionStateTransition")) {
+    if (param instanceof ReportRegionStateTransitionRequest) {
       return true;
     }
     return false;

http://git-wip-us.apache.org/repos/asf/hbase/blob/f04a68f7/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/AnnotationReadingPriorityFunction.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/AnnotationReadingPriorityFunction.java
b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/AnnotationReadingPriorityFunction.java
index 3786af1..16e49f0 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/AnnotationReadingPriorityFunction.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/AnnotationReadingPriorityFunction.java
@@ -156,7 +156,7 @@ class AnnotationReadingPriorityFunction implements PriorityFunction {
     if (param == null) {
       return HConstants.NORMAL_QOS;
     }
-    if (methodName.equalsIgnoreCase("multi") && param instanceof MultiRequest) {
+    if (param instanceof MultiRequest) {
       // The multi call has its priority set in the header.  All calls should work this way
but
       // only this one has been converted so far.  No priority == NORMAL_QOS.
       return header.hasPriority()? header.getPriority(): HConstants.NORMAL_QOS;
@@ -189,7 +189,7 @@ class AnnotationReadingPriorityFunction implements PriorityFunction {
       return HConstants.NORMAL_QOS;
     }
 
-    if (methodName.equalsIgnoreCase("scan")) { // scanner methods...
+    if (param instanceof ScanRequest) { // scanner methods...
       ScanRequest request = (ScanRequest)param;
       if (!request.hasScannerId()) {
         return HConstants.NORMAL_QOS;
@@ -206,7 +206,7 @@ class AnnotationReadingPriorityFunction implements PriorityFunction {
 
     // If meta is moving then all the rest of report the report state transitions will be
     // blocked. We shouldn't be in the same queue.
-    if (methodName.equalsIgnoreCase("ReportRegionStateTransition")) { // Regions are moving
+    if (param instanceof ReportRegionStateTransitionRequest) { // Regions are moving
       ReportRegionStateTransitionRequest tRequest = (ReportRegionStateTransitionRequest)
param;
       for (RegionStateTransition transition : tRequest.getTransitionList()) {
         if (transition.getRegionInfoList() != null) {


Mime
View raw message