hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mbau...@apache.org
Subject svn commit: r1309066 - in /hbase/branches/0.89-fb/src: main/java/org/apache/hadoop/hbase/zookeeper/ test/java/org/apache/hadoop/hbase/ test/java/org/apache/hadoop/hbase/util/
Date Tue, 03 Apr 2012 17:44:09 GMT
Author: mbautin
Date: Tue Apr  3 17:44:09 2012
New Revision: 1309066

URL: http://svn.apache.org/viewvc?rev=1309066&view=rev
Log:
[jira] [HBASE-5700] [89-fb] Fix TestMiniClusterLoad* test failures

Summary: Porting TestMiniClusterLoad* tests to 89-fb in HBASE-5679 uncovered
certain problems with mini-cluster setup in 89-fb that need to be fixed. The
mini ZooKeeper cluster was shut down and not instantiated the next time a mini
cluster was started. Also, 89-fb requires separate "namespaces" for
ZooKeeperWrapper when running multiple independent tests in the same unit test.

Test Plan:
Run all unit tests.
Run TestMiniClusterLoad* tests multiple times each.

Reviewers: kannan, pkhemani, liyintang

Reviewed By: kannan

Differential Revision: https://reviews.facebook.net/D2583

Modified:
    hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/zookeeper/ZooKeeperWrapper.java
    hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/HBaseTestingUtility.java
    hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/util/TestMiniClusterLoadEncoded.java
    hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/util/TestMiniClusterLoadSequential.java

Modified: hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/zookeeper/ZooKeeperWrapper.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/zookeeper/ZooKeeperWrapper.java?rev=1309066&r1=1309065&r2=1309066&view=diff
==============================================================================
--- hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/zookeeper/ZooKeeperWrapper.java
(original)
+++ hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/zookeeper/ZooKeeperWrapper.java
Tue Apr  3 17:44:09 2012
@@ -1811,6 +1811,10 @@ public class ZooKeeperWrapper implements
     currentNamespaceForTesting = namespace;
   }
 
+  public static void setNamespaceForTesting(String namespace) {
+    currentNamespaceForTesting = namespace;
+  }
+
   /**
    * Used in unit testing.
    * @return whether all ZK wrappers in the current unit test's "namespace"

Modified: hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/HBaseTestingUtility.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/HBaseTestingUtility.java?rev=1309066&r1=1309065&r2=1309066&view=diff
==============================================================================
--- hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/HBaseTestingUtility.java
(original)
+++ hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/HBaseTestingUtility.java
Tue Apr  3 17:44:09 2012
@@ -319,7 +319,10 @@ public class HBaseTestingUtility {
    * @see #startMiniZKCluster()
    */
   public void shutdownMiniZKCluster() throws IOException {
-    if (this.zkCluster != null) this.zkCluster.shutdown();
+    if (this.zkCluster != null) {
+      this.zkCluster.shutdown();
+      zkCluster = null;
+    }
   }
 
   /**

Modified: hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/util/TestMiniClusterLoadEncoded.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/util/TestMiniClusterLoadEncoded.java?rev=1309066&r1=1309065&r2=1309066&view=diff
==============================================================================
--- hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/util/TestMiniClusterLoadEncoded.java
(original)
+++ hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/util/TestMiniClusterLoadEncoded.java
Tue Apr  3 17:44:09 2012
@@ -21,7 +21,6 @@ import java.util.Collection;
 import java.util.List;
 
 import org.apache.hadoop.hbase.io.encoding.DataBlockEncoding;
-import org.junit.experimental.categories.Category;
 import org.junit.runners.Parameterized.Parameters;
 
 /**

Modified: hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/util/TestMiniClusterLoadSequential.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/util/TestMiniClusterLoadSequential.java?rev=1309066&r1=1309065&r2=1309066&view=diff
==============================================================================
--- hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/util/TestMiniClusterLoadSequential.java
(original)
+++ hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/util/TestMiniClusterLoadSequential.java
Tue Apr  3 17:44:09 2012
@@ -33,6 +33,7 @@ import org.apache.hadoop.hbase.TableNotF
 import org.apache.hadoop.hbase.client.HBaseAdmin;
 import org.apache.hadoop.hbase.io.encoding.DataBlockEncoding;
 import org.apache.hadoop.hbase.io.hfile.Compression;
+import org.apache.hadoop.hbase.zookeeper.ZooKeeperWrapper;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
@@ -90,6 +91,8 @@ public class TestMiniClusterLoadSequenti
 
   @Before
   public void setUp() throws Exception {
+    ZooKeeperWrapper.setNamespaceForTesting("multiPut_" + isMultiPut
+        + "_encoding_" + dataBlockEncoding + "_");
     LOG.debug("Test setup: isMultiPut=" + isMultiPut);
     TEST_UTIL.startMiniCluster(1, NUM_RS);
   }



Mime
View raw message