HBASE-12044 REST delete operation should not retry disableTable for DoNotRetryIOException (Aditya Kishore)

This commit is contained in:
Andrew Purtell 2014-09-22 17:37:19 -07:00
parent e925348979
commit 0153a353b2
1 changed files with 3 additions and 9 deletions

View File

@ -42,6 +42,7 @@ import org.apache.hadoop.hbase.HColumnDescriptor;
import org.apache.hadoop.hbase.HTableDescriptor; import org.apache.hadoop.hbase.HTableDescriptor;
import org.apache.hadoop.hbase.TableExistsException; import org.apache.hadoop.hbase.TableExistsException;
import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.TableName;
import org.apache.hadoop.hbase.TableNotEnabledException;
import org.apache.hadoop.hbase.TableNotFoundException; import org.apache.hadoop.hbase.TableNotFoundException;
import org.apache.hadoop.hbase.client.HBaseAdmin; import org.apache.hadoop.hbase.client.HBaseAdmin;
import org.apache.hadoop.hbase.client.Table; import org.apache.hadoop.hbase.client.Table;
@ -231,16 +232,9 @@ public class SchemaResource extends ResourceBase {
} }
try { try {
HBaseAdmin admin = servlet.getAdmin(); HBaseAdmin admin = servlet.getAdmin();
boolean success = false; try {
for (int i = 0; i < 10; i++) try {
admin.disableTable(tableResource.getName()); admin.disableTable(tableResource.getName());
success = true; } catch (TableNotEnabledException e) { /* this is what we want anyway */ }
break;
} catch (IOException e) {
}
if (!success) {
throw new IOException("could not disable table");
}
admin.deleteTable(tableResource.getName()); admin.deleteTable(tableResource.getName());
servlet.getMetrics().incrementSucessfulDeleteRequests(1); servlet.getMetrics().incrementSucessfulDeleteRequests(1);
return Response.ok().build(); return Response.ok().build();