hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jdcry...@apache.org
Subject svn commit: r1090060 - in /hbase/branches/0.90: CHANGES.txt src/main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java
Date Thu, 07 Apr 2011 23:21:38 GMT
Author: jdcryans
Date: Thu Apr  7 23:21:38 2011
New Revision: 1090060

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

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

Modified: hbase/branches/0.90/CHANGES.txt
URL: http://svn.apache.org/viewvc/hbase/branches/0.90/CHANGES.txt?rev=1090060&r1=1090059&r2=1090060&view=diff
==============================================================================
--- hbase/branches/0.90/CHANGES.txt (original)
+++ hbase/branches/0.90/CHANGES.txt Thu Apr  7 23:21:38 2011
@@ -12,6 +12,7 @@ Release 0.90.3 - Unreleased
    HBASE-3717  deprecate HTable isTableEnabled() methods in favor of HBaseAdmin
                methods (David Butler via Stack)
    HBASE-3747  ReplicationSource should differanciate remote and local exceptions
+   HBASE-3734  HBaseAdmin creates new configurations in getCatalogTracker
 
   TASK
    HBASE-3748  Add rolling of thrift/rest daemons to graceful_stop.sh script

Modified: hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java?rev=1090060&r1=1090059&r2=1090060&view=diff
==============================================================================
--- hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java (original)
+++ hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java Thu Apr
 7 23:21:38 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
@@ -820,7 +819,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);
@@ -829,7 +828,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;
@@ -1072,7 +1071,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);
@@ -1081,7 +1080,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



Mime
View raw message