You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by st...@apache.org on 2011/08/09 18:22:38 UTC
svn commit: r1155424 - in /hbase/trunk: CHANGES.txt
src/main/java/org/apache/hadoop/hbase/client/HConnectionManager.java
Author: stack
Date: Tue Aug 9 16:22:38 2011
New Revision: 1155424
URL: http://svn.apache.org/viewvc?rev=1155424&view=rev
Log:
HBASE-4181 HConnectionManager can't find cached HRegionInterface and makes clients work very slow
Modified:
hbase/trunk/CHANGES.txt
hbase/trunk/src/main/java/org/apache/hadoop/hbase/client/HConnectionManager.java
Modified: hbase/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hbase/trunk/CHANGES.txt?rev=1155424&r1=1155423&r2=1155424&view=diff
==============================================================================
--- hbase/trunk/CHANGES.txt (original)
+++ hbase/trunk/CHANGES.txt Tue Aug 9 16:22:38 2011
@@ -194,6 +194,8 @@ Release 0.91.0 - Unreleased
if it already exists (Mikhail Bautin)
HBASE-4179 Failed to run RowCounter on top of Hadoop branch-0.22
(Michael Weng)
+ HBASE-4181 HConnectionManager can't find cached HRegionInterface and makes clients
+ work very slow (Jia Liu)
IMPROVEMENTS
HBASE-3290 Max Compaction Size (Nicolas Spiegelberg via Stack)
Modified: hbase/trunk/src/main/java/org/apache/hadoop/hbase/client/HConnectionManager.java
URL: http://svn.apache.org/viewvc/hbase/trunk/src/main/java/org/apache/hadoop/hbase/client/HConnectionManager.java?rev=1155424&r1=1155423&r2=1155424&view=diff
==============================================================================
--- hbase/trunk/src/main/java/org/apache/hadoop/hbase/client/HConnectionManager.java (original)
+++ hbase/trunk/src/main/java/org/apache/hadoop/hbase/client/HConnectionManager.java Tue Aug 9 16:22:38 2011
@@ -1166,8 +1166,13 @@ public class HConnectionManager {
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 @@ public class HConnectionManager {
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.