hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From te...@apache.org
Subject svn commit: r1334475 - /hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java
Date Sat, 05 May 2012 19:59:06 GMT
Author: tedyu
Date: Sat May  5 19:59:05 2012
New Revision: 1334475

URL: http://svn.apache.org/viewvc?rev=1334475&view=rev
Log:
HBASE-5894 Table deletion failed but HBaseAdmin#deletetable reports it as success (Xufeng)

Modified:
    hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java

Modified: hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java?rev=1334475&r1=1334474&r2=1334475&view=diff
==============================================================================
--- hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java (original)
+++ hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java Sat May
 5 19:59:05 2012
@@ -515,6 +515,7 @@ public class HBaseAdmin implements Abort
     isMasterRunning();
     HTableDescriptor.isLegalTableName(tableName);
     HRegionLocation firstMetaServer = getFirstMetaServerForTable(tableName);
+    boolean tableExists = true;
     try {
       getMaster().deleteTable(tableName);
     } catch (RemoteException e) {
@@ -538,7 +539,7 @@ public class HBaseAdmin implements Abort
         // let us wait until .META. table is updated and
         // HMaster removes the table from its HTableDescriptors
         if (values == null) {
-          boolean tableExists = false;
+          tableExists = false;
           HTableDescriptor[] htds = getMaster().getHTableDescriptors();
           if (htds != null && htds.length > 0) {
             for (HTableDescriptor htd: htds) {
@@ -574,6 +575,11 @@ public class HBaseAdmin implements Abort
         // continue
       }
     }
+    
+    if (tableExists) {
+      throw new IOException("Retries exhausted, it took too long to wait"+
+        " for the table " + Bytes.toString(tableName) + " to be deleted.");
+    }
     // Delete cached information to prevent clients from using old locations
     this.connection.clearRegionCache(tableName);
     LOG.info("Deleted " + Bytes.toString(tableName));



Mime
View raw message