hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From st...@apache.org
Subject svn commit: r1041522 - in /hbase/trunk: CHANGES.txt src/main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java src/main/java/org/apache/hadoop/hbase/master/HMaster.java
Date Thu, 02 Dec 2010 18:47:20 GMT
Author: stack
Date: Thu Dec  2 18:47:20 2010
New Revision: 1041522

URL: http://svn.apache.org/viewvc?rev=1041522&view=rev
Log:
HBASE-3295 Dropping a 1k+ regions table likely ends in a client socket timeout and it's very
confusing

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

Modified: hbase/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hbase/trunk/CHANGES.txt?rev=1041522&r1=1041521&r2=1041522&view=diff
==============================================================================
--- hbase/trunk/CHANGES.txt (original)
+++ hbase/trunk/CHANGES.txt Thu Dec  2 18:47:20 2010
@@ -734,6 +734,8 @@ Release 0.90.0 - Unreleased
                (double-remove?) org.apache.hadoop.hbase.regionserver.StoreScanner@76607d3d
    HBASE-3299  If failed open, we don't output the IOE
    HBASE-3291  If split happens while regionserver is going down, we can stick open.
+   HBASE-3295  Dropping a 1k+ regions table likely ends in a client socket timeout
+               and it's very confusing
 
 
   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=1041522&r1=1041521&r2=1041522&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 Dec  2 18:47:20
2010
@@ -68,6 +68,10 @@ public class HBaseAdmin implements Abort
   private volatile Configuration conf;
   private final long pause;
   private final int numRetries;
+  // Some operations can take a long time such as disable of big table.
+  // numRetries is for 'normal' stuff... Mutliply by this factor when
+  // want to wait a long time.
+  private final int retryLongerMultiplier;
 
   /**
    * Constructor
@@ -82,6 +86,7 @@ public class HBaseAdmin implements Abort
     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.connection.getMaster();
   }
 
@@ -367,11 +372,11 @@ public class HBaseAdmin implements Abort
       throw RemoteExceptionHandler.decodeRemoteException(e);
     }
     final int batchCount = this.conf.getInt("hbase.admin.scanner.caching", 10);
-    // Wait until first region is deleted
+    // Wait until all regions deleted
     HRegionInterface server =
       connection.getHRegionConnection(firstMetaServer.getServerAddress());
     HRegionInfo info = new HRegionInfo();
-    for (int tries = 0; tries < numRetries; tries++) {
+    for (int tries = 0; tries < (this.numRetries * this.retryLongerMultiplier); tries++)
{
       long scannerId = -1L;
       try {
         Scan scan = new Scan().addColumn(HConstants.CATALOG_FAMILY,
@@ -449,7 +454,7 @@ public class HBaseAdmin implements Abort
  
     // Wait until all regions are enabled
     boolean enabled = false;
-    for (int tries = 0; tries < this.numRetries; tries++) {
+    for (int tries = 0; tries < (this.numRetries * this.retryLongerMultiplier); tries++)
{
       enabled = isTableEnabled(tableName);
       if (enabled) {
         break;
@@ -534,7 +539,7 @@ public class HBaseAdmin implements Abort
   }
 
   /**
-   * Disable table and wait on completion.  May timeout.  Use
+   * Disable table and wait on completion.  May timeout eventually.  Use
    * {@link #disableTableAsync(byte[])} and {@link #isTableDisabled(String)}
    * instead.
    * @param tableName
@@ -545,7 +550,7 @@ public class HBaseAdmin implements Abort
     disableTableAsync(tableName);
     // Wait until table is disabled
     boolean disabled = false;
-    for (int tries = 0; tries < this.numRetries; tries++) {
+    for (int tries = 0; tries < (this.numRetries * this.retryLongerMultiplier); tries++)
{
       disabled = isTableDisabled(tableName);
       if (disabled) {
         break;

Modified: hbase/trunk/src/main/java/org/apache/hadoop/hbase/master/HMaster.java
URL: http://svn.apache.org/viewvc/hbase/trunk/src/main/java/org/apache/hadoop/hbase/master/HMaster.java?rev=1041522&r1=1041521&r2=1041522&view=diff
==============================================================================
--- hbase/trunk/src/main/java/org/apache/hadoop/hbase/master/HMaster.java (original)
+++ hbase/trunk/src/main/java/org/apache/hadoop/hbase/master/HMaster.java Thu Dec  2 18:47:20
2010
@@ -804,7 +804,7 @@ implements HMasterInterface, HMasterRegi
   }
 
   public void deleteTable(final byte [] tableName) throws IOException {
-    new DeleteTableHandler(tableName, this, this).process();
+    this.executorService.submit(new DeleteTableHandler(tableName, this, this));
   }
 
   public void addColumn(byte [] tableName, HColumnDescriptor column)



Mime
View raw message