hadoop-hdfs-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From t...@apache.org
Subject svn commit: r1150969 [3/3] - in /hadoop/common/branches/HDFS-1073/hdfs: ./ src/c++/libhdfs/ src/contrib/hdfsproxy/ src/contrib/hdfsproxy/src/java/org/apache/hadoop/hdfsproxy/ src/java/ src/java/org/apache/hadoop/hdfs/server/blockmanagement/ src/java/or...
Date Tue, 26 Jul 2011 01:53:21 GMT
Modified: hadoop/common/branches/HDFS-1073/hdfs/src/test/hdfs/org/apache/hadoop/hdfs/server/namenode/NameNodeAdapter.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/HDFS-1073/hdfs/src/test/hdfs/org/apache/hadoop/hdfs/server/namenode/NameNodeAdapter.java?rev=1150969&r1=1150968&r2=1150969&view=diff
==============================================================================
--- hadoop/common/branches/HDFS-1073/hdfs/src/test/hdfs/org/apache/hadoop/hdfs/server/namenode/NameNodeAdapter.java
(original)
+++ hadoop/common/branches/HDFS-1073/hdfs/src/test/hdfs/org/apache/hadoop/hdfs/server/namenode/NameNodeAdapter.java
Tue Jul 26 01:53:10 2011
@@ -50,7 +50,7 @@ public class NameNodeAdapter {
    * @param namenode to proxy the invocation to
    */
   public static void refreshBlockCounts(NameNode namenode) {
-    namenode.getNamesystem().blockManager.updateState();
+    namenode.getNamesystem().getBlockManager().updateState();
   }
 
   /**
@@ -60,21 +60,6 @@ public class NameNodeAdapter {
   public static Server getRpcServer(NameNode namenode) {
     return namenode.server;
   }
-
-  /**
-   * Return a tuple of the replica state (number racks, number live
-   * replicas, and number needed replicas) for the given block.
-   * @param namenode to proxy the invocation to.
-   */
-  public static int[] getReplicaInfo(NameNode namenode, Block b) {
-    FSNamesystem ns = namenode.getNamesystem();
-    ns.readLock();
-    int[] r = {ns.blockManager.getNumberOfRacks(b),
-               ns.blockManager.countNodes(b).liveReplicas(),
-               ns.blockManager.neededReplications.contains(b) ? 1 : 0};
-    ns.readUnlock();
-    return r;
-  }
   
   public static String getLeaseHolderForPath(NameNode namenode, String path) {
     return namenode.getNamesystem().leaseManager.getLeaseByPath(path).getHolder();

Modified: hadoop/common/branches/HDFS-1073/hdfs/src/test/hdfs/org/apache/hadoop/hdfs/server/namenode/TestBlockUnderConstruction.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/HDFS-1073/hdfs/src/test/hdfs/org/apache/hadoop/hdfs/server/namenode/TestBlockUnderConstruction.java?rev=1150969&r1=1150968&r2=1150969&view=diff
==============================================================================
--- hadoop/common/branches/HDFS-1073/hdfs/src/test/hdfs/org/apache/hadoop/hdfs/server/namenode/TestBlockUnderConstruction.java
(original)
+++ hadoop/common/branches/HDFS-1073/hdfs/src/test/hdfs/org/apache/hadoop/hdfs/server/namenode/TestBlockUnderConstruction.java
Tue Jul 26 01:53:10 2011
@@ -100,7 +100,7 @@ public class TestBlockUnderConstruction 
       assertTrue("Block is not complete: " + curBlock,
           curBlock.isComplete());
       assertTrue("Block is not in BlocksMap: " + curBlock,
-          ns.blockManager.getStoredBlock(curBlock) == curBlock);
+          ns.getBlockManager().getStoredBlock(curBlock) == curBlock);
     }
 
     // the penultimate block is either complete or
@@ -115,7 +115,7 @@ public class TestBlockUnderConstruction 
             (curBlock.getBlockUCState() ==
               BlockUCState.COMMITTED)));
       assertTrue("Block is not in BlocksMap: " + curBlock,
-          ns.blockManager.getStoredBlock(curBlock) == curBlock);
+          ns.getBlockManager().getStoredBlock(curBlock) == curBlock);
     }
 
     // The last block is complete if the file is closed.
@@ -126,7 +126,7 @@ public class TestBlockUnderConstruction 
           curBlock.isComplete());
     }
     assertTrue("Block is not in BlocksMap: " + curBlock,
-        ns.blockManager.getStoredBlock(curBlock) == curBlock);
+        ns.getBlockManager().getStoredBlock(curBlock) == curBlock);
   }
 
   @Test

Modified: hadoop/common/branches/HDFS-1073/hdfs/src/test/hdfs/org/apache/hadoop/hdfs/server/namenode/TestComputeInvalidateWork.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/HDFS-1073/hdfs/src/test/hdfs/org/apache/hadoop/hdfs/server/namenode/TestComputeInvalidateWork.java?rev=1150969&r1=1150968&r2=1150969&view=diff
==============================================================================
--- hadoop/common/branches/HDFS-1073/hdfs/src/test/hdfs/org/apache/hadoop/hdfs/server/namenode/TestComputeInvalidateWork.java
(original)
+++ hadoop/common/branches/HDFS-1073/hdfs/src/test/hdfs/org/apache/hadoop/hdfs/server/namenode/TestComputeInvalidateWork.java
Tue Jul 26 01:53:10 2011
@@ -51,23 +51,23 @@ public class TestComputeInvalidateWork e
           for(int j=0; j<3*namesystem.blockInvalidateLimit+1; j++) {
             Block block = new Block(i*(namesystem.blockInvalidateLimit+1)+j, 0, 
                 GenerationStamp.FIRST_VALID_STAMP);
-            namesystem.blockManager.addToInvalidates(block, nodes[i]);
+            namesystem.getBlockManager().addToInvalidates(block, nodes[i]);
           }
         }
         
         assertEquals(namesystem.blockInvalidateLimit*NUM_OF_DATANODES, 
-            namesystem.blockManager.computeInvalidateWork(NUM_OF_DATANODES+1));
+            namesystem.getBlockManager().computeInvalidateWork(NUM_OF_DATANODES+1));
         assertEquals(namesystem.blockInvalidateLimit*NUM_OF_DATANODES, 
-            namesystem.blockManager.computeInvalidateWork(NUM_OF_DATANODES));
+            namesystem.getBlockManager().computeInvalidateWork(NUM_OF_DATANODES));
         assertEquals(namesystem.blockInvalidateLimit*(NUM_OF_DATANODES-1), 
-            namesystem.blockManager.computeInvalidateWork(NUM_OF_DATANODES-1));
-        int workCount = namesystem.blockManager.computeInvalidateWork(1);
+            namesystem.getBlockManager().computeInvalidateWork(NUM_OF_DATANODES-1));
+        int workCount = namesystem.getBlockManager().computeInvalidateWork(1);
         if (workCount == 1) {
           assertEquals(namesystem.blockInvalidateLimit+1, 
-              namesystem.blockManager.computeInvalidateWork(2));
+              namesystem.getBlockManager().computeInvalidateWork(2));
         } else {
           assertEquals(workCount, namesystem.blockInvalidateLimit);
-          assertEquals(2, namesystem.blockManager.computeInvalidateWork(2));
+          assertEquals(2, namesystem.getBlockManager().computeInvalidateWork(2));
         }
       } finally {
         namesystem.writeUnlock();

Modified: hadoop/common/branches/HDFS-1073/hdfs/src/test/hdfs/org/apache/hadoop/hdfs/server/namenode/TestLargeDirectoryDelete.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/HDFS-1073/hdfs/src/test/hdfs/org/apache/hadoop/hdfs/server/namenode/TestLargeDirectoryDelete.java?rev=1150969&r1=1150968&r2=1150969&view=diff
==============================================================================
--- hadoop/common/branches/HDFS-1073/hdfs/src/test/hdfs/org/apache/hadoop/hdfs/server/namenode/TestLargeDirectoryDelete.java
(original)
+++ hadoop/common/branches/HDFS-1073/hdfs/src/test/hdfs/org/apache/hadoop/hdfs/server/namenode/TestLargeDirectoryDelete.java
Tue Jul 26 01:53:10 2011
@@ -78,7 +78,7 @@ public class TestLargeDirectoryDelete {
     Assert.assertNotNull("No Namenode in cluster", mc.getNameNode());
     FSNamesystem namesystem = mc.getNamesystem();
     Assert.assertNotNull("Null Namesystem in cluster", namesystem);
-    Assert.assertNotNull("Null Namesystem.blockmanager", namesystem.blockManager);
+    Assert.assertNotNull("Null Namesystem.blockmanager", namesystem.getBlockManager());
     return (int) namesystem.getBlocksTotal();
   }
 

Modified: hadoop/common/branches/HDFS-1073/hdfs/src/test/hdfs/org/apache/hadoop/hdfs/server/namenode/TestNodeCount.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/HDFS-1073/hdfs/src/test/hdfs/org/apache/hadoop/hdfs/server/namenode/TestNodeCount.java?rev=1150969&r1=1150968&r2=1150969&view=diff
==============================================================================
--- hadoop/common/branches/HDFS-1073/hdfs/src/test/hdfs/org/apache/hadoop/hdfs/server/namenode/TestNodeCount.java
(original)
+++ hadoop/common/branches/HDFS-1073/hdfs/src/test/hdfs/org/apache/hadoop/hdfs/server/namenode/TestNodeCount.java
Tue Jul 26 01:53:10 2011
@@ -102,12 +102,12 @@ public class TestNodeCount extends TestC
       }
       
       // find out a non-excess node
-      Iterator<DatanodeDescriptor> iter = namesystem.blockManager.blocksMap
+      Iterator<DatanodeDescriptor> iter = namesystem.getBlockManager().blocksMap
           .nodeIterator(block.getLocalBlock());
       DatanodeDescriptor nonExcessDN = null;
       while (iter.hasNext()) {
         DatanodeDescriptor dn = iter.next();
-        Collection<Block> blocks = namesystem.blockManager.excessReplicateMap.get(dn.getStorageID());
+        Collection<Block> blocks = namesystem.getBlockManager().excessReplicateMap.get(dn.getStorageID());
         if (blocks == null || !blocks.contains(block) ) {
           nonExcessDN = dn;
           break;
@@ -184,7 +184,7 @@ public class TestNodeCount extends TestC
     namesystem.readLock();
     try {
       lastBlock = block;
-      lastNum = namesystem.blockManager.countNodes(block);
+      lastNum = namesystem.getBlockManager().countNodes(block);
       return lastNum;
     }
     finally {

Modified: hadoop/common/branches/HDFS-1073/hdfs/src/test/hdfs/org/apache/hadoop/hdfs/server/namenode/TestOverReplicatedBlocks.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/HDFS-1073/hdfs/src/test/hdfs/org/apache/hadoop/hdfs/server/namenode/TestOverReplicatedBlocks.java?rev=1150969&r1=1150968&r2=1150969&view=diff
==============================================================================
--- hadoop/common/branches/HDFS-1073/hdfs/src/test/hdfs/org/apache/hadoop/hdfs/server/namenode/TestOverReplicatedBlocks.java
(original)
+++ hadoop/common/branches/HDFS-1073/hdfs/src/test/hdfs/org/apache/hadoop/hdfs/server/namenode/TestOverReplicatedBlocks.java
Tue Jul 26 01:53:10 2011
@@ -100,7 +100,7 @@ public class TestOverReplicatedBlocks ex
 
           // corrupt one won't be chosen to be excess one
           // without 4910 the number of live replicas would be 0: block gets lost
-          assertEquals(1, namesystem.blockManager.countNodes(block.getLocalBlock())
+          assertEquals(1, namesystem.getBlockManager().countNodes(block.getLocalBlock())
               .liveReplicas());
         }
       } finally {

Modified: hadoop/common/branches/HDFS-1073/hdfs/src/test/hdfs/org/apache/hadoop/hdfs/server/namenode/TestStreamFile.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/HDFS-1073/hdfs/src/test/hdfs/org/apache/hadoop/hdfs/server/namenode/TestStreamFile.java?rev=1150969&r1=1150968&r2=1150969&view=diff
==============================================================================
--- hadoop/common/branches/HDFS-1073/hdfs/src/test/hdfs/org/apache/hadoop/hdfs/server/namenode/TestStreamFile.java
(original)
+++ hadoop/common/branches/HDFS-1073/hdfs/src/test/hdfs/org/apache/hadoop/hdfs/server/namenode/TestStreamFile.java
Tue Jul 26 01:53:10 2011
@@ -18,6 +18,9 @@
 package org.apache.hadoop.hdfs.server.namenode;
 
 import static org.junit.Assert.assertArrayEquals;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
 
 import java.io.ByteArrayOutputStream;
 import java.io.DataOutputStream;
@@ -32,9 +35,6 @@ import javax.servlet.ServletOutputStream
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
-import org.junit.Test;
-import static org.junit.Assert.*;
-
 import org.apache.hadoop.fs.FSInputStream;
 import org.apache.hadoop.fs.FileSystem;
 import org.apache.hadoop.fs.Path;
@@ -43,6 +43,7 @@ import org.apache.hadoop.hdfs.DFSInputSt
 import org.apache.hadoop.hdfs.HdfsConfiguration;
 import org.apache.hadoop.hdfs.MiniDFSCluster;
 import org.apache.hadoop.hdfs.server.common.JspHelper;
+import org.junit.Test;
 import org.mockito.Mockito;
 import org.mortbay.jetty.InclusiveByteRange;
 
@@ -65,137 +66,10 @@ class MockFSInputStream extends FSInputS
   public long getPos() throws IOException {
     return currentPos;
   }
-  
-  public boolean seekToNewSource(long targetPos) throws IOException {
-    return false;
-  }
-}
-
-
-class MockHttpServletResponse implements HttpServletResponse {
-
-  private int status = -1;
-  
-  public MockHttpServletResponse() {
-  }
-  
-  public int getStatus() {
-    return status;
-  }
-  
-  
-  public void setStatus(int sc) {
-    status = sc;
-  }
-  
-  @Deprecated
-  public void setStatus(int sc, java.lang.String sm) {
-  }
-  
-  public void addIntHeader(String name, int value) {
-  }
 
-  public void setIntHeader(String name, int value) { 
-  }
-  
-  public void addHeader(String name, String value) {
-  }
-
-  public void setHeader(String name, String value) {
-  }
-  
-  public void addDateHeader(java.lang.String name, long date) {
-  }
-  
-  public void setDateHeader(java.lang.String name, long date) {
-  }
-
-  public void sendRedirect(java.lang.String location) { 
-  }
-  
-  public void sendError(int e) {
-  }
-  
-  public void sendError(int a, java.lang.String b) {
-  }
-  
-  @Deprecated
-  public String encodeRedirectUrl(java.lang.String a) {
-    return null;
-  }
-  
-  @Deprecated
-  public String encodeUrl(java.lang.String url) {
-    return null;
-  }
-  
-  public String encodeRedirectURL(java.lang.String url) {
-    return null;
-  }
-  
-  @Deprecated
-  public String encodeURL(java.lang.String url) {
-    return null;
-  }
-  
-  public boolean containsHeader(java.lang.String name) {
-    return false;
-  }
-  
-  public void addCookie(javax.servlet.http.Cookie cookie) {
-  }
-  
-  public java.util.Locale getLocale() {
-    return null;
-  }
-  
-  public void setLocale(java.util.Locale loc) {
-  }
-  
-  public void reset() {
-  }
-  
-  public boolean isCommitted() {
+  public boolean seekToNewSource(long targetPos) throws IOException {
     return false;
   }
-  
-  public void resetBuffer() {
-  }
-  
-  public void flushBuffer() {
-  }
-  
-  public int getBufferSize() {
-    return 0;
-  }
-  
-  public void setBufferSize(int size) {
-  }
-  
-  public void setContentType(java.lang.String type) {
-  }
-  
-  public void setContentLength(int len) {
-  }
-  
-  public void setCharacterEncoding(java.lang.String charset) {
-  }
-  
-  public java.io.PrintWriter getWriter() {
-    return null;
-  }
-  
-  public javax.servlet.ServletOutputStream getOutputStream() {
-    return null;
-  }
-  
-  public java.lang.String getContentType() {
-    return null;
-  }
-  
-  public java.lang.String getCharacterEncoding() {
-    return null;
-  }
 }
 
 
@@ -235,7 +109,7 @@ public class TestStreamFile {
   }
   
   @Test
-  public void testWriteTo() throws IOException, InterruptedException {
+  public void testWriteTo() throws IOException {
 
     FSInputStream fsin = new MockFSInputStream();
     ByteArrayOutputStream os = new ByteArrayOutputStream();
@@ -272,45 +146,50 @@ public class TestStreamFile {
   }
   
   @Test
-  public void testSendPartialData() throws IOException, InterruptedException {
+  public void testSendPartialData() throws IOException {
     FSInputStream in = new MockFSInputStream();
     ByteArrayOutputStream os = new ByteArrayOutputStream();
 
     // test if multiple ranges, then 416
     { 
       List<InclusiveByteRange> ranges = strToRanges("0-,10-300", 500);
-      MockHttpServletResponse response = new MockHttpServletResponse();
+      HttpServletResponse response = Mockito.mock(HttpServletResponse.class);
       StreamFile.sendPartialData(in, os, response, 500, ranges);
-      assertEquals("Multiple ranges should result in a 416 error",
-                   416, response.getStatus());
+
+      // Multiple ranges should result in a 416 error
+      Mockito.verify(response).setStatus(416);
     }
                               
     // test if no ranges, then 416
     { 
       os.reset();
-      MockHttpServletResponse response = new MockHttpServletResponse();
+      HttpServletResponse response = Mockito.mock(HttpServletResponse.class);
       StreamFile.sendPartialData(in, os, response, 500, null);
-      assertEquals("No ranges should result in a 416 error",
-                   416, response.getStatus());
+
+      // No ranges should result in a 416 error
+      Mockito.verify(response).setStatus(416);
     }
 
     // test if invalid single range (out of bounds), then 416
     { 
       List<InclusiveByteRange> ranges = strToRanges("600-800", 500);
-      MockHttpServletResponse response = new MockHttpServletResponse();
+      HttpServletResponse response = Mockito.mock(HttpServletResponse.class);
       StreamFile.sendPartialData(in, os, response, 500, ranges);
-      assertEquals("Single (but invalid) range should result in a 416",
-                   416, response.getStatus());
+
+      // Single (but invalid) range should result in a 416
+      Mockito.verify(response).setStatus(416);
     }
 
       
     // test if one (valid) range, then 206
     { 
       List<InclusiveByteRange> ranges = strToRanges("100-300", 500);
-      MockHttpServletResponse response = new MockHttpServletResponse();
+      HttpServletResponse response = Mockito.mock(HttpServletResponse.class);
       StreamFile.sendPartialData(in, os, response, 500, ranges);
-      assertEquals("Single (valid) range should result in a 206",
-                   206, response.getStatus());
+
+      // Single (valid) range should result in a 206
+      Mockito.verify(response).setStatus(206);
+
       assertArrayEquals("Byte range from 100-300",
                         getOutputArray(100, 201),
                         os.toByteArray());
@@ -380,8 +259,7 @@ public class TestStreamFile {
     }
   }
 
-  private void setUpForDoGetTest(MiniDFSCluster cluster, Path testFile)
-      throws IOException {
+  private void setUpForDoGetTest(MiniDFSCluster cluster, Path testFile) {
 
     Mockito.doReturn(CONF).when(mockServletContext).getAttribute(
         JspHelper.CURRENT_CONF);

Modified: hadoop/common/branches/HDFS-1073/hdfs/src/test/unit/org/apache/hadoop/hdfs/server/namenode/TestINodeFile.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/HDFS-1073/hdfs/src/test/unit/org/apache/hadoop/hdfs/server/namenode/TestINodeFile.java?rev=1150969&r1=1150968&r2=1150969&view=diff
==============================================================================
--- hadoop/common/branches/HDFS-1073/hdfs/src/test/unit/org/apache/hadoop/hdfs/server/namenode/TestINodeFile.java
(original)
+++ hadoop/common/branches/HDFS-1073/hdfs/src/test/unit/org/apache/hadoop/hdfs/server/namenode/TestINodeFile.java
Tue Jul 26 01:53:10 2011
@@ -23,6 +23,7 @@ import static org.junit.Assert.*;
 import org.apache.hadoop.fs.Path;
 import org.apache.hadoop.fs.permission.FsPermission;
 import org.apache.hadoop.fs.permission.PermissionStatus;
+import org.apache.hadoop.hdfs.server.blockmanagement.BlockInfo;
 
 import org.junit.Test;
 
@@ -150,4 +151,56 @@ public class TestINodeFile {
     assertEquals(Path.SEPARATOR, root.getLocalParentDir());
     
   }
+  
+  @Test
+  public void testAppendBlocks() {
+    INodeFile origFile = createINodeFiles(1, "origfile")[0];
+    assertEquals("Number of blocks didn't match", origFile.numBlocks(), 1L);
+
+    INodeFile[] appendFiles =   createINodeFiles(4, "appendfile");
+    origFile.appendBlocks(appendFiles, getTotalBlocks(appendFiles));
+    assertEquals("Number of blocks didn't match", origFile.numBlocks(), 5L);
+    
+    for(int i=0; i< origFile.numBlocks(); i++) {
+      assertSame("INodeFiles didn't Match", origFile, origFile.getBlocks()[i].getINode());
+    }
+  }
+
+  /** 
+   * Gives the count of blocks for a given number of files
+   * @param files Array of INode files
+   * @return total count of blocks
+   */
+  private int getTotalBlocks(INodeFile[] files) {
+    int nBlocks=0;
+    for(int i=0; i < files.length; i++) {
+       nBlocks += files[i].numBlocks();
+    }
+    return nBlocks;
+  }
+  
+  /** 
+   * Creates the required number of files with one block each
+   * @param nCount Number of INodes to create
+   * @return Array of INode files
+   */
+  private INodeFile[] createINodeFiles(int nCount, String fileNamePrefix) {
+    if(nCount <= 0)
+      return new INodeFile[1];
+
+    replication = 3;
+    preferredBlockSize = 128 * 1024 * 1024;
+    INodeFile[] iNodes = new INodeFile[nCount];
+    for (int i = 0; i < nCount; i++) {
+      PermissionStatus perms = new PermissionStatus(userName, null,
+          FsPermission.getDefault());
+      iNodes[i] = new INodeFile(perms, null, replication, 0L, 0L,
+          preferredBlockSize);
+      iNodes[i].setLocalName(fileNamePrefix +  Integer.toString(i));
+      BlockInfo newblock = new BlockInfo(replication);
+      iNodes[i].addBlock(newblock);
+    }
+    
+    return iNodes;
+  }
 }

Modified: hadoop/common/branches/HDFS-1073/hdfs/src/test/unit/org/apache/hadoop/hdfs/server/namenode/TestNNLeaseRecovery.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/HDFS-1073/hdfs/src/test/unit/org/apache/hadoop/hdfs/server/namenode/TestNNLeaseRecovery.java?rev=1150969&r1=1150968&r2=1150969&view=diff
==============================================================================
--- hadoop/common/branches/HDFS-1073/hdfs/src/test/unit/org/apache/hadoop/hdfs/server/namenode/TestNNLeaseRecovery.java
(original)
+++ hadoop/common/branches/HDFS-1073/hdfs/src/test/unit/org/apache/hadoop/hdfs/server/namenode/TestNNLeaseRecovery.java
Tue Jul 26 01:53:10 2011
@@ -455,7 +455,7 @@ public class TestNNLeaseRecovery {
     fsn.leaseManager.addLease("mock-lease", file.toString());
     if (setStoredBlock) {
       when(b1.getINode()).thenReturn(iNFmock);
-      fsn.blockManager.blocksMap.addINode(b1, iNFmock);
+      fsn.getBlockManager().blocksMap.addINode(b1, iNFmock);
     }
 
     when(fsDir.getFileINode(anyString())).thenReturn(iNFmock);

Propchange: hadoop/common/branches/HDFS-1073/hdfs/src/webapps/datanode/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Jul 26 01:53:10 2011
@@ -1,4 +1,4 @@
-/hadoop/common/trunk/hdfs/src/webapps/datanode:1134994-1148523
+/hadoop/common/trunk/hdfs/src/webapps/datanode:1134994-1150966
 /hadoop/core/branches/branch-0.19/hdfs/src/webapps/datanode:713112
 /hadoop/core/trunk/src/webapps/datanode:776175-784663
 /hadoop/hdfs/branches/HDFS-1052/src/webapps/datanode:987665-1095512

Propchange: hadoop/common/branches/HDFS-1073/hdfs/src/webapps/hdfs/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Jul 26 01:53:10 2011
@@ -1,4 +1,4 @@
-/hadoop/common/trunk/hdfs/src/webapps/hdfs:1134994-1148523
+/hadoop/common/trunk/hdfs/src/webapps/hdfs:1134994-1150966
 /hadoop/core/branches/branch-0.19/hdfs/src/webapps/hdfs:713112
 /hadoop/core/trunk/src/webapps/hdfs:776175-784663
 /hadoop/hdfs/branches/HDFS-1052/src/webapps/hdfs:987665-1095512

Modified: hadoop/common/branches/HDFS-1073/hdfs/src/webapps/hdfs/block_info_xml.jsp
URL: http://svn.apache.org/viewvc/hadoop/common/branches/HDFS-1073/hdfs/src/webapps/hdfs/block_info_xml.jsp?rev=1150969&r1=1150968&r2=1150969&view=diff
==============================================================================
--- hadoop/common/branches/HDFS-1073/hdfs/src/webapps/hdfs/block_info_xml.jsp (original)
+++ hadoop/common/branches/HDFS-1073/hdfs/src/webapps/hdfs/block_info_xml.jsp Tue Jul 26 01:53:10
2011
@@ -68,7 +68,7 @@
   private static final long serialVersionUID = 1L;  
 %>
 <%
-NameNode nn = (NameNode)application.getAttribute("name.node");
+NameNode nn = NameNodeHttpServer.getNameNodeFromContext(application);
 String namenodeRole = nn.getRole().toString();
 FSNamesystem fsn = nn.getNamesystem();
 

Modified: hadoop/common/branches/HDFS-1073/hdfs/src/webapps/hdfs/corrupt_files.jsp
URL: http://svn.apache.org/viewvc/hadoop/common/branches/HDFS-1073/hdfs/src/webapps/hdfs/corrupt_files.jsp?rev=1150969&r1=1150968&r2=1150969&view=diff
==============================================================================
--- hadoop/common/branches/HDFS-1073/hdfs/src/webapps/hdfs/corrupt_files.jsp (original)
+++ hadoop/common/branches/HDFS-1073/hdfs/src/webapps/hdfs/corrupt_files.jsp Tue Jul 26 01:53:10
2011
@@ -28,7 +28,7 @@
 <%!//for java.io.Serializable
   private static final long serialVersionUID = 1L;%>
 <%
-  NameNode nn = (NameNode) application.getAttribute("name.node");
+  NameNode nn = NameNodeHttpServer.getNameNodeFromContext(application);
   FSNamesystem fsn = nn.getNamesystem();
   String namenodeRole = nn.getRole().toString();
   String namenodeLabel = nn.getNameNodeAddress().getHostName() + ":"

Modified: hadoop/common/branches/HDFS-1073/hdfs/src/webapps/hdfs/corrupt_replicas_xml.jsp
URL: http://svn.apache.org/viewvc/hadoop/common/branches/HDFS-1073/hdfs/src/webapps/hdfs/corrupt_replicas_xml.jsp?rev=1150969&r1=1150968&r2=1150969&view=diff
==============================================================================
--- hadoop/common/branches/HDFS-1073/hdfs/src/webapps/hdfs/corrupt_replicas_xml.jsp (original)
+++ hadoop/common/branches/HDFS-1073/hdfs/src/webapps/hdfs/corrupt_replicas_xml.jsp Tue Jul
26 01:53:10 2011
@@ -62,7 +62,7 @@
 %>
 <%
 
-  NameNode nn = (NameNode)application.getAttribute("name.node");
+  NameNode nn = NameNodeHttpServer.getNameNodeFromContext(application);
   FSNamesystem fsn = nn.getNamesystem();
 
   Integer numCorruptBlocks = 10;

Modified: hadoop/common/branches/HDFS-1073/hdfs/src/webapps/hdfs/dfshealth.jsp
URL: http://svn.apache.org/viewvc/hadoop/common/branches/HDFS-1073/hdfs/src/webapps/hdfs/dfshealth.jsp?rev=1150969&r1=1150968&r2=1150969&view=diff
==============================================================================
--- hadoop/common/branches/HDFS-1073/hdfs/src/webapps/hdfs/dfshealth.jsp (original)
+++ hadoop/common/branches/HDFS-1073/hdfs/src/webapps/hdfs/dfshealth.jsp Tue Jul 26 01:53:10
2011
@@ -27,7 +27,7 @@
 %>
 <%
   final NamenodeJspHelper.HealthJsp healthjsp  = new NamenodeJspHelper.HealthJsp();
-  NameNode nn = (NameNode)application.getAttribute("name.node");
+  NameNode nn = NameNodeHttpServer.getNameNodeFromContext(application);
   FSNamesystem fsn = nn.getNamesystem();
   String namenodeRole = nn.getRole().toString();
   String namenodeLabel = nn.getNameNodeAddress().getHostName() + ":" + nn.getNameNodeAddress().getPort();

Modified: hadoop/common/branches/HDFS-1073/hdfs/src/webapps/hdfs/dfsnodelist.jsp
URL: http://svn.apache.org/viewvc/hadoop/common/branches/HDFS-1073/hdfs/src/webapps/hdfs/dfsnodelist.jsp?rev=1150969&r1=1150968&r2=1150969&view=diff
==============================================================================
--- hadoop/common/branches/HDFS-1073/hdfs/src/webapps/hdfs/dfsnodelist.jsp (original)
+++ hadoop/common/branches/HDFS-1073/hdfs/src/webapps/hdfs/dfsnodelist.jsp Tue Jul 26 01:53:10
2011
@@ -27,7 +27,7 @@
 %>
 <%
 final NamenodeJspHelper.NodeListJsp nodelistjsp = new NamenodeJspHelper.NodeListJsp();
-NameNode nn = (NameNode)application.getAttribute("name.node");
+NameNode nn = NameNodeHttpServer.getNameNodeFromContext(application);
 String namenodeRole = nn.getRole().toString();
 FSNamesystem fsn = nn.getNamesystem();
 String namenodeLabel = nn.getNameNodeAddress().getHostName() + ":" + nn.getNameNodeAddress().getPort();

Propchange: hadoop/common/branches/HDFS-1073/hdfs/src/webapps/secondary/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Jul 26 01:53:10 2011
@@ -1,4 +1,4 @@
-/hadoop/common/trunk/hdfs/src/webapps/secondary:1134994-1148523
+/hadoop/common/trunk/hdfs/src/webapps/secondary:1134994-1150966
 /hadoop/core/branches/branch-0.19/hdfs/src/webapps/secondary:713112
 /hadoop/core/trunk/src/webapps/secondary:776175-784663
 /hadoop/hdfs/branches/HDFS-1052/src/webapps/secondary:987665-1095512



Mime
View raw message