hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From st...@apache.org
Subject [3/4] hbase git commit: Revert "Revert "HBASE-14909 NPE testing for RIT"" Reverted the wrong patch... putting it back (revert of a revert)
Date Sat, 05 Dec 2015 00:41:19 GMT
Revert "Revert "HBASE-14909 NPE testing for RIT""
Reverted the wrong patch... putting it back (revert of a revert)

This reverts commit 157a60f1b396ab9adc7f934a15352f2dbc5493a9.


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

Branch: refs/heads/master
Commit: a4a44587b3f2236750569f5c032b283dc77942f6
Parents: 157a60f
Author: stack <stack@apache.org>
Authored: Fri Dec 4 16:38:33 2015 -0800
Committer: stack <stack@apache.org>
Committed: Fri Dec 4 16:38:33 2015 -0800

----------------------------------------------------------------------
 .../hadoop/hbase/HBaseTestingUtility.java       | 20 ++++++++++++--------
 1 file changed, 12 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/a4a44587/hbase-server/src/test/java/org/apache/hadoop/hbase/HBaseTestingUtility.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/HBaseTestingUtility.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/HBaseTestingUtility.java
index 5bb25db..006c3e7 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/HBaseTestingUtility.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/HBaseTestingUtility.java
@@ -17,7 +17,10 @@
  */
 package org.apache.hadoop.hbase;
 
-import javax.annotation.Nullable;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
 import java.io.File;
 import java.io.IOException;
 import java.io.OutputStream;
@@ -44,6 +47,8 @@ import java.util.UUID;
 import java.util.concurrent.TimeUnit;
 import java.util.concurrent.atomic.AtomicReference;
 
+import javax.annotation.Nullable;
+
 import org.apache.commons.lang.RandomStringUtils;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
@@ -58,7 +63,6 @@ import org.apache.hadoop.hbase.classification.InterfaceAudience;
 import org.apache.hadoop.hbase.classification.InterfaceStability;
 import org.apache.hadoop.hbase.client.Admin;
 import org.apache.hadoop.hbase.client.BufferedMutator;
-import org.apache.hadoop.hbase.client.ClusterConnection;
 import org.apache.hadoop.hbase.client.Connection;
 import org.apache.hadoop.hbase.client.ConnectionFactory;
 import org.apache.hadoop.hbase.client.Consistency;
@@ -84,6 +88,7 @@ import org.apache.hadoop.hbase.io.hfile.HFile;
 import org.apache.hadoop.hbase.ipc.RpcServerInterface;
 import org.apache.hadoop.hbase.ipc.ServerNotRunningYetException;
 import org.apache.hadoop.hbase.mapreduce.MapreduceTestingShim;
+import org.apache.hadoop.hbase.master.AssignmentManager;
 import org.apache.hadoop.hbase.master.HMaster;
 import org.apache.hadoop.hbase.master.RegionStates;
 import org.apache.hadoop.hbase.master.ServerManager;
@@ -129,10 +134,6 @@ import org.apache.zookeeper.WatchedEvent;
 import org.apache.zookeeper.ZooKeeper;
 import org.apache.zookeeper.ZooKeeper.States;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-
 /**
  * Facility for testing HBase. Replacement for
  * old HBaseTestCase and HBaseClusterTestCase functionality.
@@ -3767,8 +3768,11 @@ public class HBaseTestingUtility extends HBaseCommonTestingUtility
{
 
       @Override
       public boolean evaluate() throws IOException {
-        final RegionStates regionStates = getMiniHBaseCluster().getMaster()
-            .getAssignmentManager().getRegionStates();
+        HMaster master = getMiniHBaseCluster().getMaster();
+        if (master == null) return false;
+        AssignmentManager am = master.getAssignmentManager();
+        if (am == null) return false;
+        final RegionStates regionStates = am.getRegionStates();
         return !regionStates.isRegionsInTransition();
       }
     };


Mime
View raw message