Index: src/main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java =================================================================== --- src/main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java (revision 1089699) +++ src/main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java (working copy) @@ -75,17 +75,17 @@ /** * Constructor * - * @param conf Configuration object + * @param c Configuration object * @throws MasterNotRunningException if the master is not running * @throws ZooKeeperConnectionException if unable to connect to zookeeper */ - public HBaseAdmin(Configuration conf) + public HBaseAdmin(Configuration c) throws MasterNotRunningException, ZooKeeperConnectionException { - this.connection = HConnectionManager.getConnection(conf); - this.conf = conf; - this.pause = conf.getLong("hbase.client.pause", 1000); - this.numRetries = conf.getInt("hbase.client.retries.number", 10); - this.retryLongerMultiplier = conf.getInt("hbase.client.retries.longer.multiplier", 10); + this.conf = HBaseConfiguration.create(c); + this.connection = HConnectionManager.getConnection(this.conf); + this.pause = this.conf.getLong("hbase.client.pause", 1000); + this.numRetries = this.conf.getInt("hbase.client.retries.number", 10); + this.retryLongerMultiplier = this.conf.getInt("hbase.client.retries.longer.multiplier", 10); this.connection.getMaster(); } @@ -101,7 +101,7 @@ CatalogTracker ct = null; try { HConnection connection = - HConnectionManager.getConnection(new Configuration(this.conf)); + HConnectionManager.getConnection(this.conf); ct = new CatalogTracker(connection); ct.start(); } catch (InterruptedException e) { @@ -114,7 +114,6 @@ private void cleanupCatalogTracker(final CatalogTracker ct) { ct.stop(); - HConnectionManager.deleteConnection(ct.getConnection().getConfiguration(), true); } @Override @@ -820,7 +819,7 @@ try { if (isRegionName) { Pair pair = - MetaReader.getRegion(getCatalogTracker(), tableNameOrRegionName); + MetaReader.getRegion(ct, tableNameOrRegionName); if (pair == null || pair.getSecond() == null) { LOG.info("No server in .META. for " + Bytes.toString(tableNameOrRegionName) + "; pair=" + pair); @@ -829,7 +828,7 @@ } } else { List> pairs = - MetaReader.getTableRegionsAndLocations(getCatalogTracker(), + MetaReader.getTableRegionsAndLocations(ct, Bytes.toString(tableNameOrRegionName)); for (Pair pair: pairs) { if (pair.getFirst().isOffline()) continue; @@ -1072,7 +1071,7 @@ if (isRegionName(tableNameOrRegionName)) { // Its a possible region name. Pair pair = - MetaReader.getRegion(getCatalogTracker(), tableNameOrRegionName); + MetaReader.getRegion(ct, tableNameOrRegionName); if (pair == null || pair.getSecond() == null) { LOG.info("No server in .META. for " + Bytes.toString(tableNameOrRegionName) + "; pair=" + pair); @@ -1081,7 +1080,7 @@ } } else { List> pairs = - MetaReader.getTableRegionsAndLocations(getCatalogTracker(), + MetaReader.getTableRegionsAndLocations(ct, Bytes.toString(tableNameOrRegionName)); for (Pair pair: pairs) { // May not be a server for a particular row