HBASE-5310 HConnectionManager server cache key enhancement (Jimmy Xiang)

git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1239220 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Zhihong Yu 2012-02-01 17:34:04 +00:00
parent 4b698e776d
commit 457d51bec5
2 changed files with 3 additions and 3 deletions

View File

@ -1156,7 +1156,7 @@ public class HConnectionManager {
for (Map<byte[], HRegionLocation> tableLocations :
cachedRegionLocations.values()) {
for (Entry<byte[], HRegionLocation> e : tableLocations.entrySet()) {
if (e.getValue().getServerAddress().toString().equals(server)) {
if (e.getValue().getHostnamePort().equals(server)) {
tableLocations.remove(e.getKey());
deletedSomething = true;
}
@ -1215,7 +1215,7 @@ public class HConnectionManager {
getTableLocations(tableName);
boolean hasNewCache = false;
synchronized (this.cachedRegionLocations) {
cachedServers.add(location.getServerAddress().toString());
cachedServers.add(location.getHostnamePort());
hasNewCache = (tableLocations.put(startKey, location) == null);
}
if (hasNewCache) {

View File

@ -172,7 +172,7 @@ public abstract class ServerCallable<T> implements Callable<T> {
// .META. again to find the new location
HRegionLocation hrl = location;
if (hrl != null) {
getConnection().clearCaches(hrl.getServerAddress().toString());
getConnection().clearCaches(hrl.getHostnamePort());
}
}
RetriesExhaustedException.ThrowableWithExtraContext qt =