HBASE-16657 addendum handle null RegionLoad

This commit is contained in:
Gary Helmling 2016-10-07 12:01:46 -07:00
parent fa98c506d0
commit bbaa0e851d
1 changed files with 9 additions and 8 deletions

View File

@ -201,15 +201,16 @@
<%java>
RegionLoad load = regionServer.createRegionLoad(r.getEncodedName());
String percentDone = "";
if (load != null && load.getTotalCompactingKVs() > 0) {
String compactTime = "";
if (load != null) {
if (load.getTotalCompactingKVs() > 0) {
percentDone = String.format("%.2f", 100 *
((float) load.getCurrentCompactedKVs() / load.getTotalCompactingKVs())) + "%";
}
long lastMajorCompactionTs = load.getLastMajorCompactionTs();
String compactTime = "";
if (lastMajorCompactionTs > 0) {
if (load.getLastMajorCompactionTs() > 0) {
FastDateFormat fdf = FastDateFormat.getInstance("yyyy-MM-dd HH:mm ZZ");
compactTime = fdf.format(lastMajorCompactionTs);
compactTime = fdf.format(load.getLastMajorCompactionTs());
}
}
</%java>
<td><a href="region.jsp?name=<% r.getEncodedName() %>">