--- src/main/java/org/apache/hadoop/hbase/client/HConnectionManager.java (revision 1155226) +++ src/main/java/org/apache/hadoop/hbase/client/HConnectionManager.java (working copy) @@ -1166,8 +1166,13 @@ throws IOException { if (master) getMaster(); HRegionInterface server; - String rsName = isa != null? - isa.toString(): Addressing.createHostAndPortStr(hostname, port); + String rsName = null; + if (isa != null) { + rsName = Addressing.createHostAndPortStr(isa.getHostName(), + isa.getPort()); + } else { + rsName = Addressing.createHostAndPortStr(hostname, port); + } // See if we already have a connection (common case) server = this.servers.get(rsName); if (server == null) { @@ -1190,7 +1195,8 @@ serverInterfaceClass, HRegionInterface.VERSION, address, this.conf, this.maxRPCAttempts, this.rpcTimeout, this.rpcTimeout); - this.servers.put(address.toString(), server); + this.servers.put(Addressing.createHostAndPortStr( + address.getHostName(), address.getPort()), server); } catch (RemoteException e) { LOG.warn("RemoteException connecting to RS", e); // Throw what the RemoteException was carrying.