hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jg...@apache.org
Subject svn commit: r1033617 - in /hbase/trunk: CHANGES.txt src/main/java/org/apache/hadoop/hbase/LocalHBaseCluster.java src/test/java/org/apache/hadoop/hbase/MiniHBaseCluster.java
Date Wed, 10 Nov 2010 17:54:48 GMT
Author: jgray
Date: Wed Nov 10 17:54:48 2010
New Revision: 1033617

URL: http://svn.apache.org/viewvc?rev=1033617&view=rev
Log:
HBASE-3214 TestMasterFailover.testMasterFailoverWithMockedRITOnDeadRS is failing (Gary via
jgray)

Modified:
    hbase/trunk/CHANGES.txt
    hbase/trunk/src/main/java/org/apache/hadoop/hbase/LocalHBaseCluster.java
    hbase/trunk/src/test/java/org/apache/hadoop/hbase/MiniHBaseCluster.java

Modified: hbase/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hbase/trunk/CHANGES.txt?rev=1033617&r1=1033616&r2=1033617&view=diff
==============================================================================
--- hbase/trunk/CHANGES.txt (original)
+++ hbase/trunk/CHANGES.txt Wed Nov 10 17:54:48 2010
@@ -671,6 +671,8 @@ Release 0.90.0 - Unreleased
    	       corrupted data
    HBASE-3213  If do abort of backup master will get NPE instead of graceful
                abort
+   HBASE-3214  TestMasterFailover.testMasterFailoverWithMockedRITOnDeadRS is
+               failing (Gary via jgray)
 
 
   IMPROVEMENTS

Modified: hbase/trunk/src/main/java/org/apache/hadoop/hbase/LocalHBaseCluster.java
URL: http://svn.apache.org/viewvc/hbase/trunk/src/main/java/org/apache/hadoop/hbase/LocalHBaseCluster.java?rev=1033617&r1=1033616&r2=1033617&view=diff
==============================================================================
--- hbase/trunk/src/main/java/org/apache/hadoop/hbase/LocalHBaseCluster.java (original)
+++ hbase/trunk/src/main/java/org/apache/hadoop/hbase/LocalHBaseCluster.java Wed Nov 10 17:54:48
2010
@@ -144,7 +144,7 @@ public class LocalHBaseCluster {
       (Class<? extends HMaster>)conf.getClass(HConstants.MASTER_IMPL,
           masterClass);
     for (int i = 0; i < noMasters; i++) {
-      addMaster(i);
+      addMaster(new Configuration(conf), i);
     }
     // Start the HRegionServers.
     this.regionServerClass =
@@ -152,60 +152,62 @@ public class LocalHBaseCluster {
        regionServerClass);
 
     for (int i = 0; i < noRegionServers; i++) {
-      addRegionServer(i);
+      addRegionServer(new Configuration(conf), i);
     }
   }
 
-  public JVMClusterUtil.RegionServerThread addRegionServer() throws IOException {
-    return addRegionServer(this.regionThreads.size());
+  public JVMClusterUtil.RegionServerThread addRegionServer()
+      throws IOException {
+    return addRegionServer(new Configuration(conf), this.regionThreads.size());
   }
 
-  public JVMClusterUtil.RegionServerThread addRegionServer(final int index)
+  public JVMClusterUtil.RegionServerThread addRegionServer(
+      Configuration config, final int index)
   throws IOException {
     // Create each regionserver with its own Configuration instance so each has
     // its HConnection instance rather than share (see HBASE_INSTANCES down in
     // the guts of HConnectionManager.
     JVMClusterUtil.RegionServerThread rst =
-      JVMClusterUtil.createRegionServerThread(new Configuration(this.conf),
-        this.regionServerClass, index);
+      JVMClusterUtil.createRegionServerThread(config,
+          this.regionServerClass, index);
     this.regionThreads.add(rst);
     return rst;
   }
 
   public JVMClusterUtil.RegionServerThread addRegionServer(
-      final int index, User user)
+      final Configuration config, final int index, User user)
   throws IOException, InterruptedException {
     return user.runAs(
         new PrivilegedExceptionAction<JVMClusterUtil.RegionServerThread>() {
           public JVMClusterUtil.RegionServerThread run() throws Exception {
-            return addRegionServer(index);
+            return addRegionServer(config, index);
           }
         });
   }
 
   public JVMClusterUtil.MasterThread addMaster() throws IOException {
-    return addMaster(this.masterThreads.size());
+    return addMaster(new Configuration(conf), this.masterThreads.size());
   }
 
-  public JVMClusterUtil.MasterThread addMaster(final int index)
+  public JVMClusterUtil.MasterThread addMaster(Configuration c, final int index)
   throws IOException {
     // Create each master with its own Configuration instance so each has
     // its HConnection instance rather than share (see HBASE_INSTANCES down in
     // the guts of HConnectionManager.
     JVMClusterUtil.MasterThread mt =
-      JVMClusterUtil.createMasterThread(new Configuration(this.conf),
+      JVMClusterUtil.createMasterThread(c,
         this.masterClass, index);
     this.masterThreads.add(mt);
     return mt;
   }
 
   public JVMClusterUtil.MasterThread addMaster(
-      final int index, User user)
+      final Configuration c, final int index, User user)
   throws IOException, InterruptedException {
     return user.runAs(
         new PrivilegedExceptionAction<JVMClusterUtil.MasterThread>() {
           public JVMClusterUtil.MasterThread run() throws Exception {
-            return addMaster(index);
+            return addMaster(c, index);
           }
         });
   }

Modified: hbase/trunk/src/test/java/org/apache/hadoop/hbase/MiniHBaseCluster.java
URL: http://svn.apache.org/viewvc/hbase/trunk/src/test/java/org/apache/hadoop/hbase/MiniHBaseCluster.java?rev=1033617&r1=1033616&r2=1033617&view=diff
==============================================================================
--- hbase/trunk/src/test/java/org/apache/hadoop/hbase/MiniHBaseCluster.java (original)
+++ hbase/trunk/src/test/java/org/apache/hadoop/hbase/MiniHBaseCluster.java Wed Nov 10 17:54:48
2010
@@ -265,9 +265,10 @@ public class MiniHBaseCluster {
 
       // manually add the regionservers as other users
       for (int i=0; i<nRegionNodes; i++) {
-        User user = HBaseTestingUtility.getDifferentUser(conf,
+        Configuration rsConf = HBaseConfiguration.create(conf);
+        User user = HBaseTestingUtility.getDifferentUser(rsConf,
             ".hfs."+index++);
-        hbaseCluster.addRegionServer(i, user);
+        hbaseCluster.addRegionServer(rsConf, i, user);
       }
 
       hbaseCluster.startup();
@@ -289,16 +290,13 @@ public class MiniHBaseCluster {
    */
   public JVMClusterUtil.RegionServerThread startRegionServer()
       throws IOException {
+    final Configuration newConf = HBaseConfiguration.create(conf);
     User rsUser =
-        HBaseTestingUtility.getDifferentUser(conf, ".hfs."+index++);
+        HBaseTestingUtility.getDifferentUser(newConf, ".hfs."+index++);
     JVMClusterUtil.RegionServerThread t =  null;
     try {
-      t = rsUser.runAs(
-          new PrivilegedExceptionAction<JVMClusterUtil.RegionServerThread>() {
-            public JVMClusterUtil.RegionServerThread run() throws Exception {
-              return hbaseCluster.addRegionServer();
-            }
-      });
+      t = hbaseCluster.addRegionServer(
+          newConf, hbaseCluster.getRegionServers().size(), rsUser);
       t.start();
       t.waitForServerOnline();
     } catch (InterruptedException ie) {
@@ -365,9 +363,18 @@ public class MiniHBaseCluster {
    * @return New RegionServerThread
    */
   public JVMClusterUtil.MasterThread startMaster() throws IOException {
-    JVMClusterUtil.MasterThread t = this.hbaseCluster.addMaster();
-    t.start();
-    t.waitForServerOnline();
+    Configuration c = HBaseConfiguration.create(conf);
+    User user =
+        HBaseTestingUtility.getDifferentUser(c, ".hfs."+index++);
+
+    JVMClusterUtil.MasterThread t = null;
+    try {
+      t = hbaseCluster.addMaster(c, hbaseCluster.getMasters().size(), user);
+      t.start();
+      t.waitForServerOnline();
+    } catch (InterruptedException ie) {
+      throw new IOException("Interrupted executing UserGroupInformation.doAs()", ie);
+    }
     return t;
   }
 



Mime
View raw message