You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by te...@apache.org on 2012/05/05 20:20:55 UTC
svn commit: r1334464 -
/hbase/trunk/src/main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java
Author: tedyu
Date: Sat May 5 18:20:54 2012
New Revision: 1334464
URL: http://svn.apache.org/viewvc?rev=1334464&view=rev
Log:
HBASE-5894 Table deletion failed but HBaseAdmin#deletetable reports it as success (Xufeng)
Modified:
hbase/trunk/src/main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java
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=1334464&r1=1334463&r2=1334464&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 Sat May 5 18:20:54 2012
@@ -510,6 +510,7 @@ public class HBaseAdmin implements Abort
public void deleteTable(final byte [] tableName) throws IOException {
HTableDescriptor.isLegalTableName(tableName);
HRegionLocation firstMetaServer = getFirstMetaServerForTable(tableName);
+ boolean tableExists = true;
execute(new MasterCallable<Void>() {
@Override
@@ -541,7 +542,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 || values.length == 0) {
- boolean tableExists = false;
+ tableExists = false;
HTableDescriptor[] htds;
MasterKeepAliveConnection master = connection.getKeepAliveMaster();
try {
@@ -576,6 +577,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));