HBASE-1745 [tools] Tool to kick region out of inTransistion

git-svn-id: https://svn.apache.org/repos/asf/hadoop/hbase/trunk@800952 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Michael Stack 2009-08-04 20:35:40 +00:00
parent b3653a6295
commit 7b355d83c5
3 changed files with 26 additions and 0 deletions

View File

@ -315,6 +315,7 @@ Release 0.20.0 - Unreleased
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

View File

@ -1025,6 +1025,11 @@ public class HMaster extends Thread implements HConstants, HMasterInterface,
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);

View File

@ -1436,6 +1436,26 @@ class RegionManager implements HConstants {
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