HBASE-2174 Stop from resolving HRegionServer addresses to names using DNS on every heartbeat
git-svn-id: https://svn.apache.org/repos/asf/hadoop/hbase/trunk@922000 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
8102fb3269
commit
59955d1a5b
|
@ -417,6 +417,8 @@ Release 0.21.0 - Unreleased
|
|||
HBASE-2282 More directories should be ignored when using git for development
|
||||
(Alexey Kovyrin via Stack)
|
||||
HBASE-2267 More improvements to the Maven build (Lars Francke via Stack)
|
||||
HBASE-2174 Stop from resolving HRegionServer addresses to names using DNS on
|
||||
every heartbeat (Karthik Ranganathan via Stack)
|
||||
|
||||
NEW FEATURES
|
||||
HBASE-1961 HBase EC2 scripts
|
||||
|
|
|
@ -137,8 +137,15 @@ public class HServerInfo implements WritableComparable<HServerInfo> {
|
|||
*/
|
||||
public synchronized String getServerName() {
|
||||
if (this.serverName == null) {
|
||||
// if we have the hostname of the RS, use it
|
||||
if(this.name != null) {
|
||||
this.serverName = getServerName(this.name, this.serverAddress.getPort(), this.startCode);
|
||||
}
|
||||
// go to DNS name resolution only if we dont have the name of the RS
|
||||
else {
|
||||
this.serverName = getServerName(this.serverAddress, this.startCode);
|
||||
}
|
||||
}
|
||||
return this.serverName;
|
||||
}
|
||||
|
||||
|
@ -219,7 +226,7 @@ public class HServerInfo implements WritableComparable<HServerInfo> {
|
|||
* @param info
|
||||
* @return the server name in the form hostname_startcode_port
|
||||
*/
|
||||
public static String getServerName(HServerInfo info) {
|
||||
private static String getServerName(HServerInfo info) {
|
||||
return getServerName(info.getServerAddress(), info.getStartCode());
|
||||
}
|
||||
|
||||
|
|
|
@ -53,7 +53,7 @@ class ProcessRegionOpen extends ProcessRegionStatusChange {
|
|||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "PendingOpenOperation from " + HServerInfo.getServerName(serverInfo);
|
||||
return "PendingOpenOperation from " + serverInfo.getServerName();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -69,7 +69,7 @@ class ProcessServerShutdown extends RegionServerOperation {
|
|||
*/
|
||||
public ProcessServerShutdown(HMaster master, HServerInfo serverInfo) {
|
||||
super(master);
|
||||
this.deadServer = HServerInfo.getServerName(serverInfo);
|
||||
this.deadServer = serverInfo.getServerName();
|
||||
this.deadServerAddress = serverInfo.getServerAddress();
|
||||
this.logSplit = false;
|
||||
this.rootRescanned = false;
|
||||
|
|
|
@ -163,7 +163,7 @@ public class ServerManager implements HConstants {
|
|||
void regionServerStartup(final HServerInfo serverInfo)
|
||||
throws Leases.LeaseStillHeldException {
|
||||
HServerInfo info = new HServerInfo(serverInfo);
|
||||
String serverName = HServerInfo.getServerName(info);
|
||||
String serverName = info.getServerName();
|
||||
if (this.serversToServerInfo.containsKey(serverName) ||
|
||||
this.deadServers.contains(serverName)) {
|
||||
LOG.debug("Server start was rejected: " + serverInfo);
|
||||
|
@ -217,7 +217,7 @@ public class ServerManager implements HConstants {
|
|||
*/
|
||||
void recordNewServer(HServerInfo info, boolean useInfoLoad) {
|
||||
HServerLoad load = useInfoLoad ? info.getLoad() : new HServerLoad();
|
||||
String serverName = HServerInfo.getServerName(info);
|
||||
String serverName = info.getServerName();
|
||||
info.setLoad(load);
|
||||
// We must set this watcher here because it can be set on a fresh start
|
||||
// or on a failover
|
||||
|
@ -809,7 +809,7 @@ public class ServerManager implements HConstants {
|
|||
serverAddressToServerInfo.remove(serverAddress);
|
||||
HServerInfo info = serversToServerInfo.remove(server);
|
||||
if (info != null) {
|
||||
String serverName = HServerInfo.getServerName(info);
|
||||
String serverName = info.getServerName();
|
||||
HServerLoad load = serversToLoad.remove(serverName);
|
||||
if (load != null) {
|
||||
synchronized (loadToServers) {
|
||||
|
|
|
@ -1336,7 +1336,7 @@ public class HLog implements HConstants, Syncable {
|
|||
* @return the HLog directory name
|
||||
*/
|
||||
public static String getHLogDirectoryName(HServerInfo info) {
|
||||
return getHLogDirectoryName(HServerInfo.getServerName(info));
|
||||
return getHLogDirectoryName(info.getServerName());
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue