You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by jd...@apache.org on 2011/04/08 01:23:49 UTC

svn commit: r1090061 - in /hbase/trunk: CHANGES.txt src/main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java

Author: jdcryans
Date: Thu Apr  7 23:23:48 2011
New Revision: 1090061

URL: http://svn.apache.org/viewvc?rev=1090061&view=rev
Log:
HBASE-3734  HBaseAdmin creates new configurations in getCatalogTracker

Modified:
    hbase/trunk/CHANGES.txt
    hbase/trunk/src/main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java

Modified: hbase/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hbase/trunk/CHANGES.txt?rev=1090061&r1=1090060&r2=1090061&view=diff
==============================================================================
--- hbase/trunk/CHANGES.txt (original)
+++ hbase/trunk/CHANGES.txt Thu Apr  7 23:23:48 2011
@@ -178,6 +178,7 @@ Release 0.90.3 - Unreleased
   BUG FIXES
    HBASE-3746  Clean up CompressionTest to not directly reference
                DistributedFileSystem (todd)
+   HBASE-3734  HBaseAdmin creates new configurations in getCatalogTracker
 
 
   IMPROVEMENTS

Modified: hbase/trunk/src/main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java
URL: http://svn.apache.org/viewvc/hbase/trunk/src/main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java?rev=1090061&r1=1090060&r2=1090061&view=diff
==============================================================================
--- hbase/trunk/src/main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java (original)
+++ hbase/trunk/src/main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java Thu Apr  7 23:23:48 2011
@@ -75,17 +75,17 @@ public class HBaseAdmin implements Abort
   /**
    * 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 @@ public class HBaseAdmin implements Abort
     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 @@ public class HBaseAdmin implements Abort
 
   private void cleanupCatalogTracker(final CatalogTracker ct) {
     ct.stop();
-    HConnectionManager.deleteConnection(ct.getConnection().getConfiguration(), true);
   }
 
   @Override
@@ -822,7 +821,7 @@ public class HBaseAdmin implements Abort
     try {
       if (isRegionName) {
         Pair<HRegionInfo, HServerAddress> 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);
@@ -831,7 +830,7 @@ public class HBaseAdmin implements Abort
         }
       } else {
         List<Pair<HRegionInfo, HServerAddress>> pairs =
-          MetaReader.getTableRegionsAndLocations(getCatalogTracker(),
+          MetaReader.getTableRegionsAndLocations(ct,
               Bytes.toString(tableNameOrRegionName));
         for (Pair<HRegionInfo, HServerAddress> pair: pairs) {
           if (pair.getFirst().isOffline()) continue;
@@ -1079,7 +1078,7 @@ public class HBaseAdmin implements Abort
       if (isRegionName(tableNameOrRegionName)) {
         // Its a possible region name.
         Pair<HRegionInfo, HServerAddress> 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);
@@ -1088,7 +1087,7 @@ public class HBaseAdmin implements Abort
         }
       } else {
         List<Pair<HRegionInfo, HServerAddress>> pairs =
-          MetaReader.getTableRegionsAndLocations(getCatalogTracker(),
+          MetaReader.getTableRegionsAndLocations(ct,
               Bytes.toString(tableNameOrRegionName));
         for (Pair<HRegionInfo, HServerAddress> pair: pairs) {
           // May not be a server for a particular row