From 021647b624ac8395f81ddc6ee5e6e6fbfd231d09 Mon Sep 17 00:00:00 2001 From: Sanjeet Nishad Date: Mon, 20 Jul 2020 00:17:58 +0530 Subject: [PATCH 1/2] [HBASE-24714] Error message is displayed in the UI of table's compaction state if any region of that table is not open. --- .../main/resources/hbase-webapps/master/table.jsp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/hbase-server/src/main/resources/hbase-webapps/master/table.jsp b/hbase-server/src/main/resources/hbase-webapps/master/table.jsp index 1a34b7fe8d05..5704d54c7012 100644 --- a/hbase-server/src/main/resources/hbase-webapps/master/table.jsp +++ b/hbase-server/src/main/resources/hbase-webapps/master/table.jsp @@ -35,6 +35,7 @@ import="org.apache.hadoop.hbase.HConstants" import="org.apache.hadoop.hbase.HRegionLocation" import="org.apache.hadoop.hbase.HTableDescriptor" + import="org.apache.hadoop.hbase.NotServingRegionException" import="org.apache.hadoop.hbase.RegionMetrics" import="org.apache.hadoop.hbase.RegionMetricsBuilder" import="org.apache.hadoop.hbase.ServerMetrics" @@ -655,11 +656,16 @@ CompactionState compactionState = admin.getCompactionState(table.getName()).get(); %><%= compactionState %><% } catch (Exception e) { - // Nothing really to do here - for(StackTraceElement element : e.getStackTrace()) { - %><%= StringEscapeUtils.escapeHtml4(element.toString()) %><% + + if(e.getCause().getCause() instanceof NotServingRegionException) { + %><%= CompactionState.NONE %><% + } else { + // Nothing really to do here + for(StackTraceElement element : e.getStackTrace()) { + %><%= StringEscapeUtils.escapeHtml4(element.toString()) %><% + } + %> Unknown <% } - %> Unknown <% } } else { %><%= CompactionState.NONE %><% From 77fd2dd1e173799e43acf5dc88cc0194a0266df1 Mon Sep 17 00:00:00 2001 From: Sanjeet Nishad Date: Mon, 20 Jul 2020 18:42:59 +0530 Subject: [PATCH 2/2] [HBASE-24714] Error message is displayed in the UI of table's compaction state if any region of that table is not open. --- hbase-server/src/main/resources/hbase-webapps/master/table.jsp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hbase-server/src/main/resources/hbase-webapps/master/table.jsp b/hbase-server/src/main/resources/hbase-webapps/master/table.jsp index 5704d54c7012..163e1e69127c 100644 --- a/hbase-server/src/main/resources/hbase-webapps/master/table.jsp +++ b/hbase-server/src/main/resources/hbase-webapps/master/table.jsp @@ -657,7 +657,7 @@ %><%= compactionState %><% } catch (Exception e) { - if(e.getCause().getCause() instanceof NotServingRegionException) { + if(e.getCause() != null && e.getCause().getCause() instanceof NotServingRegionException) { %><%= CompactionState.NONE %><% } else { // Nothing really to do here