HDFS-2143. Federation: In cluster web console, add link to namenode page that displays live and dead datanodes. Contributed by Ravi Prakash.

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1147964 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Suresh Srinivas 2011-07-18 16:45:28 +00:00
parent 341b4a444e
commit 8a77d0b289
2 changed files with 13 additions and 10 deletions

View File

@ -317,6 +317,9 @@ Trunk (unreleased changes)
HDFS-1547. Improve decommission mechanism. (suresh)
HDFS-2143. Federation: In cluster web console, add link to namenode page
that displays live and dead datanodes. (Ravi Prakash via suresh)
HDFS-1588. Remove hardcoded strings for configuration keys, "dfs.hosts"
and "dfs.hosts.exlude". (Erik Steffl via suresh)

View File

@ -584,12 +584,12 @@ class ClusterJspHelper {
toXmlItemBlock(doc, "Blocks", Long.toString(nn.blocksCount));
toXmlItemBlock(doc, "Missing Blocks",
Long.toString(nn.missingBlocksCount));
toXmlItemBlock(doc, "Live Datanode (Decommissioned)",
Integer.toString(nn.liveDatanodeCount) + " ("
+ Integer.toString(nn.liveDecomCount) + ")");
toXmlItemBlock(doc, "Dead Datanode (Decommissioned)",
Integer.toString(nn.deadDatanodeCount) + " ("
+ Integer.toString(nn.deadDecomCount) + ")");
toXmlItemBlockWithLink(doc, nn.liveDatanodeCount + " (" +
nn.liveDecomCount + ")", nn.httpAddress+"/dfsnodelist.jsp?whatNodes=LIVE",
"Live Datanode (Decommissioned)");
toXmlItemBlockWithLink(doc, nn.deadDatanodeCount + " (" +
nn.deadDecomCount + ")", nn.httpAddress+"/dfsnodelist.jsp?whatNodes=DEAD"
, "Dead Datanode (Decommissioned)");
doc.endTag(); // node
}
doc.endTag(); // namenodes
@ -812,11 +812,11 @@ class ClusterJspHelper {
* Generate a XML block as such, <item label="Node" value="hostname"
* link="http://hostname:50070" />
*/
private static void toXmlItemBlockWithLink(XMLOutputter doc, String host,
String url, String nodetag) throws IOException {
private static void toXmlItemBlockWithLink(XMLOutputter doc, String value,
String url, String label) throws IOException {
doc.startTag("item");
doc.attribute("label", nodetag);
doc.attribute("value", host);
doc.attribute("label", label);
doc.attribute("value", value);
doc.attribute("link", "http://" + url);
doc.endTag(); // item
}