Index: src/main/java/org/apache/hadoop/hbase/master/HMaster.java =================================================================== --- src/main/java/org/apache/hadoop/hbase/master/HMaster.java (revision 1041287) +++ src/main/java/org/apache/hadoop/hbase/master/HMaster.java (working copy) @@ -804,7 +804,7 @@ } 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) Index: src/main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java =================================================================== --- src/main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java (revision 1041287) +++ src/main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java (working copy) @@ -68,6 +68,10 @@ 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 @@ 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 @@ 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 @@ // 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.retryLongerMultipler); tries++) { enabled = isTableEnabled(tableName); if (enabled) { break; @@ -534,7 +539,7 @@ } /** - * 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 @@ 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;