HBASE-6433 Improve HBaseServer#getRemoteAddress by utilizing HBaseServer.Connection.hostAddress (binlijin)

git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1363905 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Zhihong Yu 2012-07-20 19:16:28 +00:00
parent ce00f26e71
commit 75e5903748
1 changed files with 5 additions and 2 deletions

View File

@ -223,8 +223,11 @@ public abstract class HBaseServer implements RpcServer {
* @return String
*/
public static String getRemoteAddress() {
InetAddress addr = getRemoteIp();
return (addr == null) ? null : addr.getHostAddress();
Call call = CurCall.get();
if (call != null) {
return call.connection.getHostAddress();
}
return null;
}
protected String bindAddress;