hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cutt...@apache.org
Subject svn commit: r493124 - in /lucene/hadoop/trunk: CHANGES.txt src/webapps/datanode/browseBlock.jsp
Date Fri, 05 Jan 2007 18:32:56 GMT
Author: cutting
Date: Fri Jan  5 10:32:55 2007
New Revision: 493124

URL: http://svn.apache.org/viewvc?view=rev&rev=493124
Log:
HADOOP-470.  In HDFS web ui, list the datanodes containing each copy of a block.  Contributed
by Hairong.

Modified:
    lucene/hadoop/trunk/CHANGES.txt
    lucene/hadoop/trunk/src/webapps/datanode/browseBlock.jsp

Modified: lucene/hadoop/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/CHANGES.txt?view=diff&rev=493124&r1=493123&r2=493124
==============================================================================
--- lucene/hadoop/trunk/CHANGES.txt (original)
+++ lucene/hadoop/trunk/CHANGES.txt Fri Jan  5 10:32:55 2007
@@ -192,6 +192,9 @@
     causes their blocks to be re-replicated on other nodes, so that
     they may be removed from a cluster.  (Dhruba Borthakur via cutting)
 
+55. HADOOP-470.  In HDFS web ui, list the datanodes containing each
+    copy of a block.  (Hairong Kuang via cutting)
+
 
 Release 0.9.2 - 2006-12-15
 

Modified: lucene/hadoop/trunk/src/webapps/datanode/browseBlock.jsp
URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/src/webapps/datanode/browseBlock.jsp?view=diff&rev=493124&r1=493123&r2=493124
==============================================================================
--- lucene/hadoop/trunk/src/webapps/datanode/browseBlock.jsp (original)
+++ lucene/hadoop/trunk/src/webapps/datanode/browseBlock.jsp Fri Jan  5 10:32:55 2007
@@ -120,31 +120,34 @@
     out.print("<a name=\"blockDetails\"></a>");
     out.print("<B>Total number of blocks: "+blocks.length+"</B><br>");
     //generate a table and dump the info
+    out.println("\n<table>");
     for (int i = 0; i < blocks.length; i++) {
+      out.print("<tr>");
       blockId = blocks[i].getBlock().getBlockId();
       blockSize = blocks[i].getBlock().getNumBytes();
       String blk = "blk_" + Long.toString(blockId);
+      out.print("<td>"+blk+":</td>");
       DatanodeInfo[] locs = blocks[i].getLocations();
-      int r = jspHelper.rand.nextInt(locs.length);
-      String datanodeAddr = locs[r].getName();
-      datanodePort = Integer.parseInt(datanodeAddr.substring(
+      for(int j=0; j<locs.length; j++) {
+        String datanodeAddr = locs[j].getName();
+        datanodePort = Integer.parseInt(datanodeAddr.substring(
                                         datanodeAddr.indexOf(':') + 1, 
                                     datanodeAddr.length())); 
-      fqdn = InetAddress.getByName(locs[r].getHost()).getCanonicalHostName();
-      String blockUrl = "http://"+ fqdn + ":" +
-                        locs[r].getInfoPort() +
+        fqdn = InetAddress.getByName(locs[j].getHost()).getCanonicalHostName();
+        String blockUrl = "http://"+ fqdn + ":" +
+                        locs[j].getInfoPort() +
                         "/browseBlock.jsp?blockId=" + Long.toString(blockId) +
                         "&blockSize=" + blockSize +
                "&filename=" + URLEncoder.encode(filename, "UTF-8")+ 
                         "&datanodePort=" + datanodePort + 
                         "&namenodeInfoPort=" + namenodeInfoPort +
                         "&chunkSizeToView=" + chunkSizeToView;
-      out.print("<a href=\"" + blockUrl + "\">" + "blk_" + blockId + 
-                        "</a>");
-      if (i < blocks.length - 1)
-        out.print("&nbsp;&nbsp;&nbsp;&nbsp;");
-      if (i % 3 == 0) out.print("<br>");
+        out.print("<td>&nbsp</td>" 
+          + "<td><a href=\"" + blockUrl + "\">" + datanodeAddr + "</a></td>");
+      }
+      out.println("</tr>");
     }
+    out.println("</table>");
     out.print("<hr>");
     String namenodeHost = jspHelper.nameNodeAddr.getHostName();
     out.print("<br><a href=\"http://" + 



Mime
View raw message