From a857c6d90c7574e4957bec7ca92799e3bba70f2d Mon Sep 17 00:00:00 2001 From: Sanjeet Nishad Date: Mon, 20 Jul 2020 21:36:15 +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 | 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 23a66c887f1..fef2ed50385 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() != null && 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 %><%