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-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" HDFS-1588. Remove hardcoded strings for configuration keys, "dfs.hosts"
and "dfs.hosts.exlude". (Erik Steffl via suresh) 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, "Blocks", Long.toString(nn.blocksCount));
toXmlItemBlock(doc, "Missing Blocks", toXmlItemBlock(doc, "Missing Blocks",
Long.toString(nn.missingBlocksCount)); Long.toString(nn.missingBlocksCount));
toXmlItemBlock(doc, "Live Datanode (Decommissioned)", toXmlItemBlockWithLink(doc, nn.liveDatanodeCount + " (" +
Integer.toString(nn.liveDatanodeCount) + " (" nn.liveDecomCount + ")", nn.httpAddress+"/dfsnodelist.jsp?whatNodes=LIVE",
+ Integer.toString(nn.liveDecomCount) + ")"); "Live Datanode (Decommissioned)");
toXmlItemBlock(doc, "Dead Datanode (Decommissioned)", toXmlItemBlockWithLink(doc, nn.deadDatanodeCount + " (" +
Integer.toString(nn.deadDatanodeCount) + " (" nn.deadDecomCount + ")", nn.httpAddress+"/dfsnodelist.jsp?whatNodes=DEAD"
+ Integer.toString(nn.deadDecomCount) + ")"); , "Dead Datanode (Decommissioned)");
doc.endTag(); // node doc.endTag(); // node
} }
doc.endTag(); // namenodes doc.endTag(); // namenodes
@ -812,11 +812,11 @@ class ClusterJspHelper {
* Generate a XML block as such, <item label="Node" value="hostname" * Generate a XML block as such, <item label="Node" value="hostname"
* link="http://hostname:50070" /> * link="http://hostname:50070" />
*/ */
private static void toXmlItemBlockWithLink(XMLOutputter doc, String host, private static void toXmlItemBlockWithLink(XMLOutputter doc, String value,
String url, String nodetag) throws IOException { String url, String label) throws IOException {
doc.startTag("item"); doc.startTag("item");
doc.attribute("label", nodetag); doc.attribute("label", label);
doc.attribute("value", host); doc.attribute("value", value);
doc.attribute("link", "http://" + url); doc.attribute("link", "http://" + url);
doc.endTag(); // item doc.endTag(); // item
} }