Skip to content

Commit

Permalink
HBASE-4291 Improve display of regions in transition in UI to be more …
Browse files Browse the repository at this point in the history
…readable.

git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1163321 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
toddlipcon committed Aug 30, 2011
1 parent 0ad9dac commit 9e9d802
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ No regions in transition.
<table>
<tr><th>Region</th><th>State</th></tr>
<%for Map.Entry<String, RegionState> entry : rit.entrySet() %>
<tr><td><% entry.getKey() %></td><td><% entry.getValue() %></td>
<tr><td><% entry.getKey() %></td><td><% entry.getValue().toDescriptiveString() %></td>
</%for>
</table>
</%if>
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
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;
Expand Down Expand Up @@ -2520,6 +2521,19 @@ public String toString() {
+ ", 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();
Expand Down

0 comments on commit 9e9d802

Please sign in to comment.