hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From st...@apache.org
Subject svn commit: r1004525 - in /hbase/trunk/src/main/java/org/apache/hadoop/hbase/master: AssignmentManager.java handler/DisableTableHandler.java handler/EnableTableHandler.java
Date Tue, 05 Oct 2010 05:03:22 GMT
Author: stack
Date: Tue Oct  5 05:03:22 2010
New Revision: 1004525

URL: http://svn.apache.org/viewvc?rev=1004525&view=rev
Log:
HBASE-3080 TestAdmin hanging on hudson

Modified:
    hbase/trunk/src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java
    hbase/trunk/src/main/java/org/apache/hadoop/hbase/master/handler/DisableTableHandler.java
    hbase/trunk/src/main/java/org/apache/hadoop/hbase/master/handler/EnableTableHandler.java

Modified: hbase/trunk/src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java
URL: http://svn.apache.org/viewvc/hbase/trunk/src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java?rev=1004525&r1=1004524&r2=1004525&view=diff
==============================================================================
--- hbase/trunk/src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java (original)
+++ hbase/trunk/src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java Tue Oct
 5 05:03:22 2010
@@ -1010,6 +1010,27 @@ public class AssignmentManager extends Z
   }
 
   /**
+   * Wait on regions to clean regions-in-transition.
+   * @param hri Region to wait on.
+   * @throws IOException
+   */
+  public void waitOnRegionToClearRegionsInTransition(final HRegionInfo hri)
+  throws IOException {
+    if (isRegionInTransition(hri) == null) return;
+    RegionState rs = null;
+    // There is already a timeout monitor on regions in transition so I
+    // should not have to have one here too?
+    while(!this.master.isStopped() && (rs = isRegionInTransition(hri)) != null) {
+      Threads.sleep(1000);
+      LOG.info("Waiting on " + rs + " to clear regions-in-transition");
+    }
+    if (this.master.isStopped()) {
+      LOG.info("Giving up wait on regions in " +
+        "transition because stoppable.isStopped is set");
+    }
+  }
+
+  /**
    * Checks if the table of the specified region has been disabled by the user.
    * @param regionName
    * @return

Modified: hbase/trunk/src/main/java/org/apache/hadoop/hbase/master/handler/DisableTableHandler.java
URL: http://svn.apache.org/viewvc/hbase/trunk/src/main/java/org/apache/hadoop/hbase/master/handler/DisableTableHandler.java?rev=1004525&r1=1004524&r2=1004525&view=diff
==============================================================================
--- hbase/trunk/src/main/java/org/apache/hadoop/hbase/master/handler/DisableTableHandler.java
(original)
+++ hbase/trunk/src/main/java/org/apache/hadoop/hbase/master/handler/DisableTableHandler.java
Tue Oct  5 05:03:22 2010
@@ -76,8 +76,12 @@ public class DisableTableHandler extends
     // TODO: Confirm we have parallel closing going on.
     List<HRegionInfo> regions = assignmentManager.getRegionsOfTable(tableName);
     // Unassign the online regions
-    for(HRegionInfo region : regions) {
+    for(HRegionInfo region: regions) {
       assignmentManager.unassign(region);
     }
+    // Wait on table's regions to clear region in transition.
+    for (HRegionInfo region: regions) {
+      this.assignmentManager.waitOnRegionToClearRegionsInTransition(region);
+    }
   }
 }
\ No newline at end of file

Modified: hbase/trunk/src/main/java/org/apache/hadoop/hbase/master/handler/EnableTableHandler.java
URL: http://svn.apache.org/viewvc/hbase/trunk/src/main/java/org/apache/hadoop/hbase/master/handler/EnableTableHandler.java?rev=1004525&r1=1004524&r2=1004525&view=diff
==============================================================================
--- hbase/trunk/src/main/java/org/apache/hadoop/hbase/master/handler/EnableTableHandler.java
(original)
+++ hbase/trunk/src/main/java/org/apache/hadoop/hbase/master/handler/EnableTableHandler.java
Tue Oct  5 05:03:22 2010
@@ -75,5 +75,9 @@ public class EnableTableHandler extends 
     for (HRegionInfo region : regions) {
       assignmentManager.assign(region);
     }
+    // Wait on table's regions to clear region in transition.
+    for (HRegionInfo region: regions) {
+      this.assignmentManager.waitOnRegionToClearRegionsInTransition(region);
+    }
   }
 }
\ No newline at end of file



Mime
View raw message