From 70d1b35a4b37753b85200dea69c565f3a1c14d7b Mon Sep 17 00:00:00 2001 From: Sanjeet Nishad Date: Tue, 21 Jul 2020 12:32:28 +0530 Subject: [PATCH] HBASE-24714 Error message is displayed in UI of table's compaction state if any region of that table is not open Closes #2047 Signed-off-by: Mingliang Liu Signed-off-by: Viraj Jasani --- .../main/resources/hbase-webapps/master/table.jsp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 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 9fe58bcf234..8a218d6e8dd 100644 --- a/hbase-server/src/main/resources/hbase-webapps/master/table.jsp +++ b/hbase-server/src/main/resources/hbase-webapps/master/table.jsp @@ -34,6 +34,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" @@ -610,11 +611,16 @@ CompactionState compactionState = admin.getCompactionState(table.getName()).get(); %><%= compactionState %><% } catch (Exception e) { + + if(e.getCause() != null && e.getCause().getCause() instanceof NotServingRegionException) { + %><%= CompactionState.NONE %><% + } else { // Nothing really to do here for(StackTraceElement element : e.getStackTrace()) { - %><%= StringEscapeUtils.escapeHtml4(element.toString()) %><% - } - %> Unknown <% + %><%= StringEscapeUtils.escapeHtml4(element.toString()) %><% + } + %> Unknown <% + } } } else { %><%= CompactionState.NONE %><%