hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From st...@apache.org
Subject svn commit: r800954 - in /hadoop/hbase/branches/0.20: CHANGES.txt src/java/org/apache/hadoop/hbase/master/HMaster.java src/java/org/apache/hadoop/hbase/master/RegionManager.java
Date Tue, 04 Aug 2009 20:39:37 GMT
Author: stack
Date: Tue Aug  4 20:39:36 2009
New Revision: 800954

URL: http://svn.apache.org/viewvc?rev=800954&view=rev
Log:
HBASE-1745 [tools] Tool to kick region out of inTransistion

Modified:
    hadoop/hbase/branches/0.20/CHANGES.txt
    hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/master/HMaster.java
    hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/master/RegionManager.java

Modified: hadoop/hbase/branches/0.20/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/hbase/branches/0.20/CHANGES.txt?rev=800954&r1=800953&r2=800954&view=diff
==============================================================================
--- hadoop/hbase/branches/0.20/CHANGES.txt (original)
+++ hadoop/hbase/branches/0.20/CHANGES.txt Tue Aug  4 20:39:36 2009
@@ -314,6 +314,7 @@
    HBASE-1739  hbase-1683 broke splitting; only split three logs no matter
                what N was
    HBASE-1737  Regions unbalanced when adding new node
+   HBASE-1745  [tools] Tool to kick region out of inTransistion
 
   IMPROVEMENTS
    HBASE-1089  Add count of regions on filesystem to master UI; add percentage

Modified: hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/master/HMaster.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/master/HMaster.java?rev=800954&r1=800953&r2=800954&view=diff
==============================================================================
--- hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/master/HMaster.java (original)
+++ hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/master/HMaster.java Tue Aug
 4 20:39:36 2009
@@ -1025,6 +1025,11 @@
         servername = 
           Bytes.toString(rr.getValue(CATALOG_FAMILY, SERVER_QUALIFIER));
       }
+      // Take region out of the intransistions in case it got stuck there doing
+      // an open or whatever.
+      this.regionManager.clearFromInTransition(regionname);
+      // If servername is still null, then none, exit.
+      if (servername == null) break;
       // Need to make up a HServerInfo 'servername' for that is how
       // items are keyed in regionmanager Maps.
       HServerAddress addr = new HServerAddress(servername);

Modified: hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/master/RegionManager.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/master/RegionManager.java?rev=800954&r1=800953&r2=800954&view=diff
==============================================================================
--- hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/master/RegionManager.java
(original)
+++ hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/master/RegionManager.java
Tue Aug  4 20:39:36 2009
@@ -1423,6 +1423,26 @@
   }
 
   /**
+   * @param regionname Name to clear from regions in transistion.
+   * @return True if we removed an element for the passed regionname.
+   */
+  boolean clearFromInTransition(final byte [] regionname) {
+    boolean result = false;
+    synchronized (this.regionsInTransition) {
+      if (this.regionsInTransition.isEmpty()) return result;
+      for (Map.Entry<String, RegionState> e: this.regionsInTransition.entrySet()) {
+        if (Bytes.equals(regionname, e.getValue().getRegionName())) {
+          this.regionsInTransition.remove(e.getKey());
+          LOG.debug("Removed " + e.getKey() + ", " + e.getValue());
+          result = true;
+          break;
+        }
+      }
+    }
+    return result;
+  }
+
+  /**
    * @return Snapshot of regionsintransition as a sorted Map.
    */
   NavigableMap<String, String> getRegionsInTransition() {



Mime
View raw message