From 0153a353b2e6fcfa62cc7c3b31876c3aaa6d89d4 Mon Sep 17 00:00:00 2001 From: Andrew Purtell Date: Mon, 22 Sep 2014 17:37:19 -0700 Subject: [PATCH] HBASE-12044 REST delete operation should not retry disableTable for DoNotRetryIOException (Aditya Kishore) --- .../org/apache/hadoop/hbase/rest/SchemaResource.java | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/rest/SchemaResource.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/rest/SchemaResource.java index f85ddacd12c..2f1fc2a1b26 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/rest/SchemaResource.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/rest/SchemaResource.java @@ -42,6 +42,7 @@ import org.apache.hadoop.hbase.HColumnDescriptor; import org.apache.hadoop.hbase.HTableDescriptor; import org.apache.hadoop.hbase.TableExistsException; import org.apache.hadoop.hbase.TableName; +import org.apache.hadoop.hbase.TableNotEnabledException; import org.apache.hadoop.hbase.TableNotFoundException; import org.apache.hadoop.hbase.client.HBaseAdmin; import org.apache.hadoop.hbase.client.Table; @@ -231,16 +232,9 @@ public class SchemaResource extends ResourceBase { } try { HBaseAdmin admin = servlet.getAdmin(); - boolean success = false; - for (int i = 0; i < 10; i++) try { + try { admin.disableTable(tableResource.getName()); - success = true; - break; - } catch (IOException e) { - } - if (!success) { - throw new IOException("could not disable table"); - } + } catch (TableNotEnabledException e) { /* this is what we want anyway */ } admin.deleteTable(tableResource.getName()); servlet.getMetrics().incrementSucessfulDeleteRequests(1); return Response.ok().build();