HBASE-1918 new version to test on Hudson
git-svn-id: https://svn.apache.org/repos/asf/hadoop/hbase/trunk@826920 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
42d9fca0d1
commit
e1f057be13
|
@ -22,6 +22,8 @@ package org.apache.hadoop.hbase;
|
||||||
import java.io.DataInput;
|
import java.io.DataInput;
|
||||||
import java.io.DataOutput;
|
import java.io.DataOutput;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
import org.apache.hadoop.io.WritableComparable;
|
import org.apache.hadoop.io.WritableComparable;
|
||||||
|
|
||||||
|
@ -40,6 +42,7 @@ public class HServerInfo implements WritableComparable<HServerInfo> {
|
||||||
private int infoPort;
|
private int infoPort;
|
||||||
private String serverName = null;
|
private String serverName = null;
|
||||||
private String name;
|
private String name;
|
||||||
|
private static Map<String,String> dnsCache = new HashMap<String,String>();
|
||||||
|
|
||||||
/** default constructor - used by Writable */
|
/** default constructor - used by Writable */
|
||||||
public HServerInfo() {
|
public HServerInfo() {
|
||||||
|
@ -235,11 +238,11 @@ public class HServerInfo implements WritableComparable<HServerInfo> {
|
||||||
String host = serverAddress.substring(0, colonIndex);
|
String host = serverAddress.substring(0, colonIndex);
|
||||||
int port =
|
int port =
|
||||||
Integer.valueOf(serverAddress.substring(colonIndex + 1)).intValue();
|
Integer.valueOf(serverAddress.substring(colonIndex + 1)).intValue();
|
||||||
|
if(!dnsCache.containsKey(host)) {
|
||||||
HServerAddress address = new HServerAddress(serverAddress);
|
HServerAddress address = new HServerAddress(serverAddress);
|
||||||
if(!address.getHostname().equals(host)) {
|
dnsCache.put(host, address.getHostname());
|
||||||
System.out.println("HBASE-1918 debug : " + address.getHostname() + " != " + host);
|
|
||||||
}
|
}
|
||||||
|
host = dnsCache.get(host);
|
||||||
name = getServerName(host, port, startCode);
|
name = getServerName(host, port, startCode);
|
||||||
}
|
}
|
||||||
return name;
|
return name;
|
||||||
|
|
Loading…
Reference in New Issue