From 9e9d802f45b2a27c950f7518f9327341adc8d98b Mon Sep 17 00:00:00 2001 From: Todd Lipcon Date: Tue, 30 Aug 2011 18:20:06 +0000 Subject: [PATCH] HBASE-4291 Improve display of regions in transition in UI to be more readable. git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1163321 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES.txt | 2 ++ .../tmpl/master/AssignmentManagerStatusTmpl.jamon | 2 +- .../hadoop/hbase/master/AssignmentManager.java | 14 ++++++++++++++ 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/CHANGES.txt b/CHANGES.txt index 17ad35180ec..50018135059 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -419,6 +419,8 @@ Release 0.91.0 - Unreleased the Thrift API (Anirudh Todi) HBASE-3900 Expose progress of a major compaction in UI and/or in shell (Brad Anderson) + HBASE-4291 Improve display of regions in transition in UI to be more + readable (todd) TASKS HBASE-3559 Move report of split to master OFF the heartbeat channel diff --git a/src/main/jamon/org/apache/hbase/tmpl/master/AssignmentManagerStatusTmpl.jamon b/src/main/jamon/org/apache/hbase/tmpl/master/AssignmentManagerStatusTmpl.jamon index f5279043567..62a63b1f921 100644 --- a/src/main/jamon/org/apache/hbase/tmpl/master/AssignmentManagerStatusTmpl.jamon +++ b/src/main/jamon/org/apache/hbase/tmpl/master/AssignmentManagerStatusTmpl.jamon @@ -36,7 +36,7 @@ No regions in transition. <%for Map.Entry entry : rit.entrySet() %> - +
RegionState
<% entry.getKey() %><% entry.getValue() %>
<% entry.getKey() %><% entry.getValue().toDescriptiveString() %>
\ No newline at end of file diff --git a/src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java b/src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java index 90e1a3c8b75..dee3c229c59 100644 --- a/src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java +++ b/src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java @@ -24,6 +24,7 @@ import java.io.DataOutput; import java.io.IOException; import java.lang.Thread.UncaughtExceptionHandler; import java.util.ArrayList; +import java.util.Date; import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; @@ -2520,6 +2521,19 @@ public class AssignmentManager extends ZooKeeperListener { + ", server=" + serverName; } + /** + * A slower (but more easy-to-read) stringification + */ + public String toDescriptiveString() { + long lstamp = stamp.get(); + long relTime = System.currentTimeMillis() - lstamp; + + return region.getRegionNameAsString() + + " state=" + state + + ", ts=" + new Date(lstamp) + " (" + (relTime/1000) + "s ago)" + + ", server=" + serverName; + } + @Override public void readFields(DataInput in) throws IOException { region = new HRegionInfo();