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:
Jean-Daniel Cryans 2009-10-20 00:56:33 +00:00
parent 42d9fca0d1
commit e1f057be13
1 changed files with 7 additions and 4 deletions

View File

@ -22,6 +22,8 @@ package org.apache.hadoop.hbase;
import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
import org.apache.hadoop.io.WritableComparable;
@ -40,6 +42,7 @@ public class HServerInfo implements WritableComparable<HServerInfo> {
private int infoPort;
private String serverName = null;
private String name;
private static Map<String,String> dnsCache = new HashMap<String,String>();
/** default constructor - used by Writable */
public HServerInfo() {
@ -235,11 +238,11 @@ public class HServerInfo implements WritableComparable<HServerInfo> {
String host = serverAddress.substring(0, colonIndex);
int port =
Integer.valueOf(serverAddress.substring(colonIndex + 1)).intValue();
if(!dnsCache.containsKey(host)) {
HServerAddress address = new HServerAddress(serverAddress);
if(!address.getHostname().equals(host)) {
System.out.println("HBASE-1918 debug : " + address.getHostname() + " != " + host);
dnsCache.put(host, address.getHostname());
}
host = dnsCache.get(host);
name = getServerName(host, port, startCode);
}
return name;