hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From la...@apache.org
Subject svn commit: r1363193 - in /hbase/branches/0.94/src: main/java/org/apache/hadoop/hbase/master/ test/java/org/apache/hadoop/hbase/ test/java/org/apache/hadoop/hbase/regionserver/
Date Thu, 19 Jul 2012 00:52:32 GMT
Author: larsh
Date: Thu Jul 19 00:52:32 2012
New Revision: 1363193

URL: http://svn.apache.org/viewvc?rev=1363193&view=rev
Log:
HBASE-6389 revert

Modified:
    hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/master/ServerManager.java
    hbase/branches/0.94/src/test/java/org/apache/hadoop/hbase/HBaseTestingUtility.java
    hbase/branches/0.94/src/test/java/org/apache/hadoop/hbase/regionserver/TestRSKilledWhenMasterInitializing.java

Modified: hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/master/ServerManager.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/master/ServerManager.java?rev=1363193&r1=1363192&r2=1363193&view=diff
==============================================================================
--- hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/master/ServerManager.java (original)
+++ hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/master/ServerManager.java Thu
Jul 19 00:52:32 2012
@@ -557,12 +557,12 @@ public class ServerManager {
    * Wait for the region servers to report in.
    * We will wait until one of this condition is met:
    *  - the master is stopped
+   *  - the 'hbase.master.wait.on.regionservers.timeout' is reached
    *  - the 'hbase.master.wait.on.regionservers.maxtostart' number of
    *    region servers is reached
    *  - the 'hbase.master.wait.on.regionservers.mintostart' is reached AND
    *   there have been no new region server in for
-   *      'hbase.master.wait.on.regionservers.interval' time AND
-   *   the 'hbase.master.wait.on.regionservers.timeout' is reached
+   *      'hbase.master.wait.on.regionservers.interval' time
    *
    * @throws InterruptedException
    */
@@ -571,18 +571,11 @@ public class ServerManager {
     final long interval = this.master.getConfiguration().
       getLong("hbase.master.wait.on.regionservers.interval", 1500);
     final long timeout = this.master.getConfiguration().
-      getLong("hbase.master.wait.on.regionservers.timeout", 4500);
+    getLong("hbase.master.wait.on.regionservers.timeout", 4500);
     final int minToStart = this.master.getConfiguration().
-      getInt("hbase.master.wait.on.regionservers.mintostart", 1);
-    int maxToStart = this.master.getConfiguration().
-      getInt("hbase.master.wait.on.regionservers.maxtostart", Integer.MAX_VALUE);
-    if (maxToStart < minToStart) {
-        LOG.warn(String.format(
-            "The value of 'hbase.master.wait.on.regionservers.maxtostart' (%d)" +
-            " is set less than 'hbase.master.wait.on.regionservers.mintostart'" +
-            " (%d), ignoring.", maxToStart, minToStart));
-        maxToStart = Integer.MAX_VALUE;
-    }
+    getInt("hbase.master.wait.on.regionservers.mintostart", 1);
+    final int maxToStart = this.master.getConfiguration().
+    getInt("hbase.master.wait.on.regionservers.maxtostart", Integer.MAX_VALUE);
 
     long now =  System.currentTimeMillis();
     final long startTime = now;
@@ -593,8 +586,9 @@ public class ServerManager {
     int oldCount = 0;
     while (
       !this.master.isStopped() &&
+        slept < timeout &&
         count < maxToStart &&
-        (lastCountChange+interval > now || timeout > slept || count < minToStart)
+        (lastCountChange+interval > now || count < minToStart)
       ){
 
       // Log some info at every interval time or if there is a change

Modified: hbase/branches/0.94/src/test/java/org/apache/hadoop/hbase/HBaseTestingUtility.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.94/src/test/java/org/apache/hadoop/hbase/HBaseTestingUtility.java?rev=1363193&r1=1363192&r2=1363193&view=diff
==============================================================================
--- hbase/branches/0.94/src/test/java/org/apache/hadoop/hbase/HBaseTestingUtility.java (original)
+++ hbase/branches/0.94/src/test/java/org/apache/hadoop/hbase/HBaseTestingUtility.java Thu
Jul 19 00:52:32 2012
@@ -624,9 +624,8 @@ public class HBaseTestingUtility {
 
     // These settings will make the server waits until this exact number of
     //  regions servers are connected.
-    String count = String.valueOf(numSlaves);
-    conf.setIfUnset("hbase.master.wait.on.regionservers.mintostart", count);
-    conf.setIfUnset("hbase.master.wait.on.regionservers.maxtostart", count);
+    conf.setInt("hbase.master.wait.on.regionservers.mintostart", numSlaves);
+    conf.setInt("hbase.master.wait.on.regionservers.maxtostart", numSlaves);
 
     Configuration c = new Configuration(this.conf);
     this.hbaseCluster = new MiniHBaseCluster(c, numMasters, numSlaves);

Modified: hbase/branches/0.94/src/test/java/org/apache/hadoop/hbase/regionserver/TestRSKilledWhenMasterInitializing.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.94/src/test/java/org/apache/hadoop/hbase/regionserver/TestRSKilledWhenMasterInitializing.java?rev=1363193&r1=1363192&r2=1363193&view=diff
==============================================================================
--- hbase/branches/0.94/src/test/java/org/apache/hadoop/hbase/regionserver/TestRSKilledWhenMasterInitializing.java
(original)
+++ hbase/branches/0.94/src/test/java/org/apache/hadoop/hbase/regionserver/TestRSKilledWhenMasterInitializing.java
Thu Jul 19 00:52:32 2012
@@ -66,11 +66,8 @@ public class TestRSKilledWhenMasterIniti
   @BeforeClass
   public static void setUpBeforeClass() throws Exception {
     // Set it so that this test runs with my custom master
-    Configuration conf = TESTUTIL.getConfiguration();      
-    conf.setClass(HConstants.MASTER_IMPL, TestingMaster.class, HMaster.class);
-    conf.setInt("hbase.master.wait.on.regionservers.mintostart", 3);
-    conf.setInt("hbase.master.wait.on.regionservers.maxtostart", 4);
-    
+    TESTUTIL.getConfiguration().setClass(HConstants.MASTER_IMPL,
+        TestingMaster.class, HMaster.class);
     // Start up the cluster.
     TESTUTIL.startMiniCluster(NUM_MASTERS, NUM_RS);
   }



Mime
View raw message