HBASE-12044 REST delete operation should not retry disableTable for DoNotRetryIOException (Aditya Kishore)
This commit is contained in:
parent
e925348979
commit
0153a353b2
|
@ -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();
|
||||||
|
|
Loading…
Reference in New Issue