hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From syuanji...@apache.org
Subject [1/9] hbase git commit: HBASE-16657 addendum handle null RegionLoad
Date Mon, 10 Oct 2016 19:00:43 GMT
Repository: hbase
Updated Branches:
  refs/heads/hbase-12439 bc9a97245 -> 3c35a722d


HBASE-16657 addendum handle null RegionLoad


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/723d5615
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/723d5615
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/723d5615

Branch: refs/heads/hbase-12439
Commit: 723d56153f908421dc5abcea8471bacf995cb6d3
Parents: bc9a972
Author: Gary Helmling <garyh@apache.org>
Authored: Fri Oct 7 12:01:46 2016 -0700
Committer: Gary Helmling <garyh@apache.org>
Committed: Fri Oct 7 13:29:19 2016 -0700

----------------------------------------------------------------------
 .../hbase/tmpl/regionserver/RegionListTmpl.jamon | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/723d5615/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/regionserver/RegionListTmpl.jamon
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/regionserver/RegionListTmpl.jamon
b/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/regionserver/RegionListTmpl.jamon
index b393137..96c3a96 100644
--- a/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/regionserver/RegionListTmpl.jamon
+++ b/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/regionserver/RegionListTmpl.jamon
@@ -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 %>


Mime
View raw message