You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-commits@hadoop.apache.org by cu...@apache.org on 2006/12/12 22:22:03 UTC
svn commit: r486318 - in /lucene/hadoop/trunk: CHANGES.txt
src/webapps/dfs/dfshealth.jsp src/webapps/static/hadoop.css
Author: cutting
Date: Tue Dec 12 13:22:02 2006
New Revision: 486318
URL: http://svn.apache.org/viewvc?view=rev&rev=486318
Log:
HADOOP-806. Include link to datanodes on front page of namenode web interface. Contributed by Raghu.
Modified:
lucene/hadoop/trunk/CHANGES.txt
lucene/hadoop/trunk/src/webapps/dfs/dfshealth.jsp
lucene/hadoop/trunk/src/webapps/static/hadoop.css
Modified: lucene/hadoop/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/CHANGES.txt?view=diff&rev=486318&r1=486317&r2=486318
==============================================================================
--- lucene/hadoop/trunk/CHANGES.txt (original)
+++ lucene/hadoop/trunk/CHANGES.txt Tue Dec 12 13:22:02 2006
@@ -60,6 +60,9 @@
17. HADOOP-802. Update description of mapred.speculative.execution to
mention reduces. (Nigel Daley via cutting)
+18. HADOOP-806. Include link to datanodes on front page of namenode
+ web interface. (Raghu Angadi via cutting)
+
Release 0.9.1 - 2006-12-06
Modified: lucene/hadoop/trunk/src/webapps/dfs/dfshealth.jsp
URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/src/webapps/dfs/dfshealth.jsp?view=diff&rev=486318&r1=486317&r2=486318
==============================================================================
--- lucene/hadoop/trunk/src/webapps/dfs/dfshealth.jsp (original)
+++ lucene/hadoop/trunk/src/webapps/dfs/dfshealth.jsp Tue Dec 12 13:22:02 2006
@@ -7,7 +7,8 @@
import="org.apache.hadoop.dfs.*"
import="org.apache.hadoop.util.*"
import="java.text.DateFormat"
- import="java.lang.Math"
+ import="java.lang.Math"
+ import="java.net.URLEncoder"
%>
<%!
FSNamesystem fsn = FSNamesystem.getFSNamesystem();
@@ -45,18 +46,28 @@
return ret;
}
- public void generateLiveNodeData( JspWriter out, DatanodeDescriptor d,
+ public void generateNodeData( JspWriter out, DatanodeDescriptor d,
String suffix, boolean alive )
throws IOException {
+ String url = d.getName();
+ if ( url.indexOf( ':' ) >= 0 )
+ url = url.substring( 0, url.indexOf( ':' ) );
+ // from nn_browsedfscontent.jsp:
+ url = "http://" + url + ":" + d.getInfoPort() +
+ "/browseDirectory.jsp?namenodeInfoPort=" +
+ fsn.getNameNodeInfoPort() + "&dir=" +
+ URLEncoder.encode("/", "UTF-8");
+
String name = d.getName();
if ( !name.matches( "\\d+\\.\\d+.\\d+\\.\\d+.*" ) )
- name = name.replaceAll( "\\.[^.:]*", "" );
-
+ name = name.replaceAll( "\\.[^.:]*", "" );
int idx = (suffix != null && name.endsWith( suffix )) ?
- name.indexOf( suffix ) : -1;
+ name.indexOf( suffix ) : -1;
+
out.print( rowTxt() + "<td class=\"name\"><a title=\"" + d.getName() +
- "\">" + (( idx > 0 ) ? name.substring(0, idx) : name) +
+ "\"href=\"" + url + "\">" +
+ (( idx > 0 ) ? name.substring(0, idx) : name) + "</a>" +
(( alive ) ? "" : "\n") );
if ( !alive )
return;
@@ -140,7 +151,7 @@
currentTime = System.currentTimeMillis();
out.print( "<div id=\"dfsnodetable\"> "+
"<a name=\"LiveNodes\" id=\"title\">" +
- "Live Datanodes: " + live.size() + "</a>" +
+ "Live Datanodes : " + live.size() + "</a>" +
"<br><br>\n<table border=1 cellspacing=0>\n" );
counterReset();
@@ -161,7 +172,7 @@
"> Blocks\n" );
for ( int i=0; i < live.size(); i++ ) {
- generateLiveNodeData( out, live.get(i), port_suffix, true );
+ generateNodeData( out, live.get(i), port_suffix, true );
}
}
out.print("</table>\n");
@@ -176,7 +187,7 @@
"<td> Node \n" );
for ( int i=0; i < dead.size() ; i++ ) {
- generateLiveNodeData( out, dead.get(i), port_suffix, false );
+ generateNodeData( out, dead.get(i), port_suffix, false );
}
out.print("</table>\n");
Modified: lucene/hadoop/trunk/src/webapps/static/hadoop.css
URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/src/webapps/static/hadoop.css?view=diff&rev=486318&r1=486317&r2=486318
==============================================================================
--- lucene/hadoop/trunk/src/webapps/static/hadoop.css (original)
+++ lucene/hadoop/trunk/src/webapps/static/hadoop.css Tue Dec 12 13:22:02 2006
@@ -22,13 +22,21 @@
div#dfsnodetable td, th {
border-bottom-style : none;
+ padding-bottom : 4px;
+ padding-top : 4px;
+}
+
+div#dfsnodetable A:link, A:visited {
+ text-decoration : none;
+ color : black;
}
div#dfsnodetable th.header, th.headerASC, th.headerDSC {
- padding-bottom : 4px;
- padding-top : 4px;
+ padding-bottom : 8px;
+ padding-top : 8px;
}
-div#dfsnodetable th.header:hover, th.headerASC:hover, th.headerDSC:hover {
+div#dfsnodetable th.header:hover, th.headerASC:hover, th.headerDSC:hover,
+ td.name:hover {
text-decoration : underline;
cursor : pointer;
}