hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From st...@apache.org
Subject svn commit: r800952 - in /hadoop/hbase/trunk: 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:35:41 GMT
Author: stack
Date: Tue Aug  4 20:35:40 2009
New Revision: 800952

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

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

Modified: hadoop/hbase/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/hbase/trunk/CHANGES.txt?rev=800952&r1=800951&r2=800952&view=diff
==============================================================================
--- hadoop/hbase/trunk/CHANGES.txt (original)
+++ hadoop/hbase/trunk/CHANGES.txt Tue Aug  4 20:35:40 2009
@@ -315,6 +315,7 @@
    HBASE-1737  Regions unbalanced when adding new node
    HBASE-1739  hbase-1683 broke splitting; only split three logs no matter
                what N was
+   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/trunk/src/java/org/apache/hadoop/hbase/master/HMaster.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/master/HMaster.java?rev=800952&r1=800951&r2=800952&view=diff
==============================================================================
--- hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/master/HMaster.java (original)
+++ hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/master/HMaster.java Tue Aug  4 20:35:40
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/trunk/src/java/org/apache/hadoop/hbase/master/RegionManager.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/master/RegionManager.java?rev=800952&r1=800951&r2=800952&view=diff
==============================================================================
--- hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/master/RegionManager.java (original)
+++ hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/master/RegionManager.java Tue Aug
 4 20:35:40 2009
@@ -1436,6 +1436,26 @@
     return result;
   }
 
+  /**
+   * @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;
+  }
+
   /*
    * State of a Region as it transitions from closed to open, etc.  See
    * note on regionsInTransition data member above for listing of state



Mime
View raw message