HBASE-4033 The shutdown RegionServer could be added to AssignmentManager.servers again

git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1144009 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Michael Stack 2011-07-07 19:58:27 +00:00
parent ee97af7842
commit d0e28d0309
2 changed files with 18 additions and 3 deletions

View File

@ -399,6 +399,8 @@ Release 0.90.4 - Unreleased
HBASE-4045 [replication] NPE in ReplicationSource when ZK is gone HBASE-4045 [replication] NPE in ReplicationSource when ZK is gone
HBASE-4034 HRegionServer should be stopped even if no META regions HBASE-4034 HRegionServer should be stopped even if no META regions
are hosted by the HRegionServer (Akash Ashok) are hosted by the HRegionServer (Akash Ashok)
HBASE-4033 The shutdown RegionServer could be added to
AssignmentManager.servers again (Jieshan Bean)
IMPROVEMENT IMPROVEMENT
HBASE-3882 hbase-config.sh needs to be updated so it can auto-detects the HBASE-3882 hbase-config.sh needs to be updated so it can auto-detects the

View File

@ -882,9 +882,15 @@ public class AssignmentManager extends ZooKeeperListener {
ServerName oldSn = this.regions.get(regionInfo); ServerName oldSn = this.regions.get(regionInfo);
if (oldSn != null) LOG.warn("Overwriting " + regionInfo.getEncodedName() + if (oldSn != null) LOG.warn("Overwriting " + regionInfo.getEncodedName() +
" on " + oldSn + " with " + sn); " on " + oldSn + " with " + sn);
if (isServerOnline(sn)) {
this.regions.put(regionInfo, sn); this.regions.put(regionInfo, sn);
addToServers(sn, regionInfo); addToServers(sn, regionInfo);
this.regions.notifyAll(); this.regions.notifyAll();
} else {
LOG.info("The server is not in online servers, ServerName=" +
sn.getServerName() + ", region=" + regionInfo.getEncodedName());
}
} }
// Remove plan if one. // Remove plan if one.
clearRegionPlan(regionInfo); clearRegionPlan(regionInfo);
@ -2364,4 +2370,11 @@ public class AssignmentManager extends ZooKeeperListener {
public void stop() { public void stop() {
this.timeoutMonitor.interrupt(); this.timeoutMonitor.interrupt();
} }
/**
* Check whether the RegionServer is online.
*/
public boolean isServerOnline(ServerName serverName) {
return this.serverManager.isServerOnline(serverName);
}
} }