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 <liuml07@apache.org>
Signed-off-by: Viraj Jasani <vjasani@apache.org>
This commit is contained in:
Sanjeet Nishad 2020-07-20 21:36:15 +05:30 committed by Viraj Jasani
parent f73b9085ad
commit a857c6d90c
No known key found for this signature in database
GPG Key ID: B3D6C0B41C8ADFD5
1 changed files with 10 additions and 4 deletions

View File

@ -35,6 +35,7 @@
import="org.apache.hadoop.hbase.HConstants" import="org.apache.hadoop.hbase.HConstants"
import="org.apache.hadoop.hbase.HRegionLocation" import="org.apache.hadoop.hbase.HRegionLocation"
import="org.apache.hadoop.hbase.HTableDescriptor" import="org.apache.hadoop.hbase.HTableDescriptor"
import="org.apache.hadoop.hbase.NotServingRegionException"
import="org.apache.hadoop.hbase.RegionMetrics" import="org.apache.hadoop.hbase.RegionMetrics"
import="org.apache.hadoop.hbase.RegionMetricsBuilder" import="org.apache.hadoop.hbase.RegionMetricsBuilder"
import="org.apache.hadoop.hbase.ServerMetrics" import="org.apache.hadoop.hbase.ServerMetrics"
@ -655,11 +656,16 @@
CompactionState compactionState = admin.getCompactionState(table.getName()).get(); CompactionState compactionState = admin.getCompactionState(table.getName()).get();
%><%= compactionState %><% %><%= compactionState %><%
} catch (Exception e) { } catch (Exception e) {
// Nothing really to do here
for(StackTraceElement element : e.getStackTrace()) { if(e.getCause() != null && e.getCause().getCause() instanceof NotServingRegionException) {
%><%= StringEscapeUtils.escapeHtml4(element.toString()) %><% %><%= CompactionState.NONE %><%
} else {
// Nothing really to do here
for(StackTraceElement element : e.getStackTrace()) {
%><%= StringEscapeUtils.escapeHtml4(element.toString()) %><%
}
%> Unknown <%
} }
%> Unknown <%
} }
} else { } else {
%><%= CompactionState.NONE %><% %><%= CompactionState.NONE %><%