HBASE-16657 addendum handle null RegionLoad
This commit is contained in:
parent
bc9a972451
commit
723d56153f
|
@ -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 %>
|
||||
|
|
Loading…
Reference in New Issue