HBASE-16657 addendum handle null RegionLoad

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

View File

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