HBASE-1651 client is broken, it requests ROOT region location from ZK too much

git-svn-id: https://svn.apache.org/repos/asf/hadoop/hbase/trunk@793999 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Michael Stack 2009-07-14 18:08:56 +00:00
parent 503cc3b990
commit 6c7ef5bfc7
4 changed files with 10 additions and 6 deletions

View File

@ -260,6 +260,8 @@ Release 0.20.0 - Unreleased
HBASE-1646 Scan-s can't set a Filter (Doğacan Güney via Stack)
HBASE-1649 ValueFilter may not reset its internal state
(Doğacan Güney via Stack)
HBASE-1651 client is broken, it requests ROOT region location from ZK too
much
IMPROVEMENTS
HBASE-1089 Add count of regions on filesystem to master UI; add percentage

View File

@ -834,4 +834,4 @@ public class HBaseAdmin {
copyOfConf.setInt("hbase.client.retries.number", 1);
new HBaseAdmin(copyOfConf);
}
}
}

View File

@ -65,6 +65,7 @@ import org.apache.zookeeper.Watcher.Event.KeeperState;
* Used by {@link HTable} and {@link HBaseAdmin}
*/
public class HConnectionManager implements HConstants {
private static final Log LOG = LogFactory.getLog(HConnectionManager.class);
/*
* Not instantiable.
@ -77,7 +78,7 @@ public class HConnectionManager implements HConstants {
// instance. Note that although the Map is synchronized, the objects it
// contains are mutable and hence require synchronized access to them
private static
final Map<HBaseConfiguration, TableServers> HBASE_INSTANCES =
final Map<HBaseConfiguration, TableServers> HBASE_INSTANCES =
new WeakHashMap<HBaseConfiguration, TableServers>();
/**
@ -93,6 +94,7 @@ public class HConnectionManager implements HConstants {
if (connection == null) {
connection = new TableServers(conf);
HBASE_INSTANCES.put(conf, connection);
LOG.debug("Created new HBASE_INSTANCES");
}
}
return connection;
@ -512,9 +514,9 @@ public class HConnectionManager implements HConstants {
// second waits. The second thread will not do find.
if (!useCache || rootRegionLocation == null) {
return locateRootRegion();
this.rootRegionLocation = locateRootRegion();
}
return rootRegionLocation;
return this.rootRegionLocation;
}
} else if (Bytes.equals(tableName, META_TABLE_NAME)) {
synchronized (metaRegionLock) {

View File

@ -24,7 +24,7 @@ import org.apache.hadoop.hbase.HBaseConfiguration;
/**
* Used by server processes to expose HServerConnection method
* setRootRegionLocation
* do can call {@link HConnectionManager#setRootRegionLocation}
*/
public class ServerConnectionManager extends HConnectionManager {
/*
@ -41,4 +41,4 @@ public class ServerConnectionManager extends HConnectionManager {
public static ServerConnection getConnection(HBaseConfiguration conf) {
return (ServerConnection) HConnectionManager.getConnection(conf);
}
}
}