From 75e5903748e23c78dc767966ae21aca49158f2ed Mon Sep 17 00:00:00 2001 From: Zhihong Yu Date: Fri, 20 Jul 2012 19:16:28 +0000 Subject: [PATCH] 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 --- .../main/java/org/apache/hadoop/hbase/ipc/HBaseServer.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/HBaseServer.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/HBaseServer.java index 39ec9a12c5b..1d161cc18d6 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/HBaseServer.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/HBaseServer.java @@ -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;