You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by li...@apache.org on 2016/12/01 05:29:16 UTC

hbase git commit: HBASE-17212 Should add null checker on table name in HTable and RegionServerCallable constructor (addendum)

Repository: hbase
Updated Branches:
  refs/heads/master b2086873a -> 15fe3d327


HBASE-17212 Should add null checker on table name in HTable and RegionServerCallable constructor (addendum)


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

Branch: refs/heads/master
Commit: 15fe3d3279e84d9db41b29b5f8ac7ece31490fc3
Parents: b208687
Author: Yu Li <li...@apache.org>
Authored: Thu Dec 1 13:28:24 2016 +0800
Committer: Yu Li <li...@apache.org>
Committed: Thu Dec 1 13:28:24 2016 +0800

----------------------------------------------------------------------
 .../org/apache/hadoop/hbase/client/RegionServerCallable.java  | 7 ++-----
 .../apache/hadoop/hbase/client/TestRpcControllerFactory.java  | 2 +-
 2 files changed, 3 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/15fe3d32/hbase-client/src/main/java/org/apache/hadoop/hbase/client/RegionServerCallable.java
----------------------------------------------------------------------
diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/RegionServerCallable.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/RegionServerCallable.java
index 96434f9..a8e17c6 100644
--- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/RegionServerCallable.java
+++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/RegionServerCallable.java
@@ -78,9 +78,6 @@ public abstract class RegionServerCallable<T, S> implements RetryingCallable<T>
       RpcController rpcController) {
     super();
     this.connection = connection;
-    if (tableName == null) {
-      throw new IllegalArgumentException("Given tableName is null");
-    }
     this.tableName = tableName;
     this.row = row;
     this.rpcController = rpcController;
@@ -208,8 +205,8 @@ public abstract class RegionServerCallable<T, S> implements RetryingCallable<T>
 
   public void prepare(final boolean reload) throws IOException {
     // check table state if this is a retry
-    if (reload && !tableName.equals(TableName.META_TABLE_NAME) &&
-        getConnection().isTableDisabled(tableName)) {
+    if (reload && tableName != null && !tableName.equals(TableName.META_TABLE_NAME)
+        && getConnection().isTableDisabled(tableName)) {
       throw new TableNotEnabledException(tableName.getNameAsString() + " is disabled.");
     }
     try (RegionLocator regionLocator = connection.getRegionLocator(tableName)) {

http://git-wip-us.apache.org/repos/asf/hbase/blob/15fe3d32/hbase-endpoint/src/test/java/org/apache/hadoop/hbase/client/TestRpcControllerFactory.java
----------------------------------------------------------------------
diff --git a/hbase-endpoint/src/test/java/org/apache/hadoop/hbase/client/TestRpcControllerFactory.java b/hbase-endpoint/src/test/java/org/apache/hadoop/hbase/client/TestRpcControllerFactory.java
index aac020d..3fdd8cb 100644
--- a/hbase-endpoint/src/test/java/org/apache/hadoop/hbase/client/TestRpcControllerFactory.java
+++ b/hbase-endpoint/src/test/java/org/apache/hadoop/hbase/client/TestRpcControllerFactory.java
@@ -92,7 +92,7 @@ public class TestRpcControllerFactory {
       super.setPriority(tn);
       // ignore counts for system tables - it could change and we really only want to check on what
       // the client should change
-      if (!tn.isSystemTable()) {
+      if (tn != null && !tn.isSystemTable()) {
         TABLE_PRIORITY.incrementAndGet();
       }