* @param serverInfo
* @throws Leases.LeaseStillHeldException
*/
public void regionServerStartup(final HServerInfo serverInfo)
throws Leases.LeaseStillHeldException {
HServerInfo info = new HServerInfo(serverInfo);
String serverName = HServerInfo.getServerName(info);
if (serversToServerInfo.containsKey(serverName) ||
deadServers.contains(serverName)) {
LOG.debug("Server start was rejected: " + serverInfo);
LOG.debug("serversToServerInfo.containsKey: " + serversToServerInfo.containsKey(serverName));
LOG.debug("deadServers.contains: " + deadServers.contains(serverName));
throw new Leases.LeaseStillHeldException(serverName);
}
LOG.info("Received start message from: " + serverName);
// Go on to process the regionserver registration.
HServerLoad load = serversToLoad.remove(serverName);
if (load != null) {
// The startup message was from a known server.
// Remove stale information about the server's load.
synchronized (loadToServers) {
Set<String> servers = loadToServers.get(load);
if (servers != null) {
servers.remove(serverName);
if (servers.size() > 0)
loadToServers.put(load, servers);
else
loadToServers.remove(load);
}
}
}
HServerInfo storedInfo = serversToServerInfo.remove(serverName);
if (storedInfo != null && !master.closed.get()) {
// The startup message was from a known server with the same name.
// Timeout the old one right away.
master.getRootRegionLocation();
try {