hadoop-hdfs-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From t...@apache.org
Subject svn commit: r1165463 [3/3] - in /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs: ./ src/main/java/org/apache/hadoop/hdfs/server/namenode/ src/test/java/org/apache/hadoop/hdfs/ src/test/java/org/apache/hadoop/hdfs/security/token/block/ src/test/jav...
Date Tue, 06 Sep 2011 00:41:49 GMT
Modified: hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestBackupNode.java
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestBackupNode.java?rev=1165463&r1=1165462&r2=1165463&view=diff
==============================================================================
--- hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestBackupNode.java
(original)
+++ hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestBackupNode.java
Tue Sep  6 00:41:47 2011
@@ -34,6 +34,7 @@ import org.apache.hadoop.hdfs.MiniDFSClu
 import org.apache.hadoop.hdfs.server.common.HdfsServerConstants.StartupOption;
 import org.apache.hadoop.hdfs.server.common.Storage.StorageDirectory;
 import org.apache.hadoop.hdfs.server.namenode.FileJournalManager.EditLogFile;
+import org.apache.hadoop.hdfs.server.protocol.NamenodeProtocols;
 import org.apache.hadoop.hdfs.DFSConfigKeys;
 import org.apache.hadoop.test.GenericTestUtils;
 import org.apache.log4j.Level;
@@ -128,12 +129,13 @@ public class TestBackupNode extends Test
       fileSys = cluster.getFileSystem();
       backup = startBackupNode(conf, StartupOption.BACKUP, 1);
       
-      BackupImage bnImage = backup.getBNImage();
+      BackupImage bnImage = (BackupImage) backup.getFSImage();
       testBNInSync(cluster, backup, 1);
       
       // Force a roll -- BN should roll with NN.
       NameNode nn = cluster.getNameNode();
-      nn.rollEditLog();
+      NamenodeProtocols nnRpc = nn.getRpcServer();
+      nnRpc.rollEditLog();
       assertEquals(bnImage.getEditLog().getCurSegmentTxId(),
           nn.getFSImage().getEditLog().getCurSegmentTxId());
       
@@ -207,7 +209,9 @@ public class TestBackupNode extends Test
           LOG.info("Checking for " + src + " on BN");
           try {
             boolean hasFile = backup.getNamesystem().getFileInfo(src, false) != null;
-            boolean txnIdMatch = backup.getTransactionID() == nn.getTransactionID();
+            boolean txnIdMatch =
+              backup.getRpcServer().getTransactionID() ==
+              nn.getRpcServer().getTransactionID();
             return hasFile && txnIdMatch;
           } catch (Exception e) {
             throw new RuntimeException(e);
@@ -264,7 +268,7 @@ public class TestBackupNode extends Test
       //
       // Take a checkpoint
       //
-      long txid = cluster.getNameNode().getTransactionID();
+      long txid = cluster.getNameNodeRpc().getTransactionID();
       backup = startBackupNode(conf, op, 1);
       waitCheckpointDone(cluster, backup, txid);
     } catch(IOException e) {
@@ -300,18 +304,18 @@ public class TestBackupNode extends Test
       // Take a checkpoint
       //
       backup = startBackupNode(conf, op, 1);
-      long txid = cluster.getNameNode().getTransactionID();
+      long txid = cluster.getNameNodeRpc().getTransactionID();
       waitCheckpointDone(cluster, backup, txid);
 
       for (int i = 0; i < 10; i++) {
         fileSys.mkdirs(new Path("file_" + i));
       }
 
-      txid = cluster.getNameNode().getTransactionID();
+      txid = cluster.getNameNodeRpc().getTransactionID();
       backup.doCheckpoint();
       waitCheckpointDone(cluster, backup, txid);
 
-      txid = cluster.getNameNode().getTransactionID();
+      txid = cluster.getNameNodeRpc().getTransactionID();
       backup.doCheckpoint();
       waitCheckpointDone(cluster, backup, txid);
 

Modified: hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestBlockUnderConstruction.java
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestBlockUnderConstruction.java?rev=1165463&r1=1165462&r2=1165463&view=diff
==============================================================================
--- hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestBlockUnderConstruction.java
(original)
+++ hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestBlockUnderConstruction.java
Tue Sep  6 00:41:47 2011
@@ -38,6 +38,7 @@ import org.apache.hadoop.hdfs.protocol.L
 import org.apache.hadoop.hdfs.server.blockmanagement.BlockInfo;
 import org.apache.hadoop.hdfs.server.blockmanagement.BlockInfoUnderConstruction;
 import org.apache.hadoop.hdfs.server.common.HdfsServerConstants.BlockUCState;
+import org.apache.hadoop.hdfs.server.protocol.NamenodeProtocols;
 import org.junit.AfterClass;
 import org.junit.BeforeClass;
 import org.junit.Test;
@@ -152,7 +153,7 @@ public class TestBlockUnderConstruction 
    */
   @Test
   public void testGetBlockLocations() throws IOException {
-    final NameNode namenode = cluster.getNameNode();
+    final NamenodeProtocols namenode = cluster.getNameNodeRpc();
     final Path p = new Path(BASE_DIR, "file2.dat");
     final String src = p.toString();
     final FSDataOutputStream out = TestFileCreation.createFile(hdfs, p, 3);

Modified: hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestCheckpoint.java
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestCheckpoint.java?rev=1165463&r1=1165462&r2=1165463&view=diff
==============================================================================
--- hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestCheckpoint.java
(original)
+++ hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestCheckpoint.java
Tue Sep  6 00:41:47 2011
@@ -52,6 +52,7 @@ import org.apache.hadoop.hdfs.server.com
 import org.apache.hadoop.hdfs.server.namenode.NNStorage.NameNodeDirType;
 import org.apache.hadoop.hdfs.server.namenode.SecondaryNameNode.CheckpointStorage;
 import org.apache.hadoop.hdfs.server.protocol.NamenodeProtocol;
+import org.apache.hadoop.hdfs.server.protocol.NamenodeProtocols;
 import org.apache.hadoop.hdfs.server.protocol.RemoteEditLog;
 import org.apache.hadoop.hdfs.server.protocol.RemoteEditLogManifest;
 import org.apache.hadoop.hdfs.tools.DFSAdmin;
@@ -982,11 +983,12 @@ public class TestCheckpoint extends Test
     cluster = new MiniDFSCluster.Builder(conf).numDataNodes(numDatanodes)
         .format(true).build();
     NameNode nn = cluster.getNameNode();
+    NamenodeProtocols nnRpc = nn.getRpcServer();
 
     SecondaryNameNode secondary = startSecondaryNameNode(conf);
     // prepare checkpoint image
     secondary.doCheckpoint();
-    CheckpointSignature sig = nn.rollEditLog();
+    CheckpointSignature sig = nnRpc.rollEditLog();
     // manipulate the CheckpointSignature fields
     sig.setBlockpoolID("somerandomebpid");
     sig.clusterID = "somerandomcid";
@@ -1073,8 +1075,10 @@ public class TestCheckpoint extends Test
         .nameNodePort(9928).build();
     Configuration snConf1 = new HdfsConfiguration(cluster.getConfiguration(0));
     Configuration snConf2 = new HdfsConfiguration(cluster.getConfiguration(1));
-    InetSocketAddress nn1RpcAddress = cluster.getNameNode(0).rpcAddress;
-    InetSocketAddress nn2RpcAddress = cluster.getNameNode(1).rpcAddress;
+    InetSocketAddress nn1RpcAddress =
+      cluster.getNameNode(0).getNameNodeAddress();
+    InetSocketAddress nn2RpcAddress =
+      cluster.getNameNode(1).getNameNodeAddress();
     String nn1 = nn1RpcAddress.getHostName() + ":" + nn1RpcAddress.getPort();
     String nn2 = nn2RpcAddress.getHostName() + ":" + nn2RpcAddress.getPort();
 
@@ -1444,9 +1448,9 @@ public class TestCheckpoint extends Test
       cluster = new MiniDFSCluster.Builder(conf).numDataNodes(0)
           .format(true).build();
       
-      NameNode nn = cluster.getNameNode();
-      String fsName = NameNode.getHostPortString(nn.getHttpAddress());
-
+      NamenodeProtocols nn = cluster.getNameNodeRpc();
+      String fsName = NameNode.getHostPortString(
+          cluster.getNameNode().getHttpAddress());
 
       // Make a finalized log on the server side. 
       nn.rollEditLog();
@@ -1515,8 +1519,8 @@ public class TestCheckpoint extends Test
 
       // Now primary NN experiences failure of a volume -- fake by
       // setting its current dir to a-x permissions
-      NameNode nn = cluster.getNameNode();
-      NNStorage storage = nn.getFSImage().getStorage();
+      NamenodeProtocols nn = cluster.getNameNodeRpc();
+      NNStorage storage = cluster.getNameNode().getFSImage().getStorage();
       StorageDirectory sd0 = storage.getStorageDir(0);
       StorageDirectory sd1 = storage.getStorageDir(1);
       
@@ -1590,8 +1594,8 @@ public class TestCheckpoint extends Test
 
       // Now primary NN experiences failure of its only name dir -- fake by
       // setting its current dir to a-x permissions
-      NameNode nn = cluster.getNameNode();
-      NNStorage storage = nn.getFSImage().getStorage();
+      NamenodeProtocols nn = cluster.getNameNodeRpc();
+      NNStorage storage = cluster.getNameNode().getFSImage().getStorage();
       StorageDirectory sd0 = storage.getStorageDir(0);
       assertEquals(NameNodeDirType.IMAGE, sd0.getStorageDirType());
       currentDir = sd0.getCurrentDir();
@@ -1704,7 +1708,7 @@ public class TestCheckpoint extends Test
       secondary.doCheckpoint();
 
       // Now primary NN saves namespace 3 times
-      NameNode nn = cluster.getNameNode();
+      NamenodeProtocols nn = cluster.getNameNodeRpc();
       nn.setSafeMode(SafeModeAction.SAFEMODE_ENTER);
       for (int i = 0; i < 3; i++) {
         nn.saveNamespace();

Modified: hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestDeadDatanode.java
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestDeadDatanode.java?rev=1165463&r1=1165462&r2=1165463&view=diff
==============================================================================
--- hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestDeadDatanode.java
(original)
+++ hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestDeadDatanode.java
Tue Sep  6 00:41:47 2011
@@ -103,7 +103,7 @@ public class TestDeadDatanode {
     dn.shutdown();
     waitForDatanodeState(reg.getStorageID(), false, 20000);
 
-    DatanodeProtocol dnp = cluster.getNameNode();
+    DatanodeProtocol dnp = cluster.getNameNodeRpc();
     
     ReceivedDeletedBlockInfo[] blocks = { new ReceivedDeletedBlockInfo(
         new Block(0), "") };

Modified: hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestFsck.java
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestFsck.java?rev=1165463&r1=1165462&r2=1165463&view=diff
==============================================================================
--- hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestFsck.java
(original)
+++ hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestFsck.java
Tue Sep  6 00:41:47 2011
@@ -47,6 +47,7 @@ import org.apache.hadoop.hdfs.MiniDFSClu
 import org.apache.hadoop.hdfs.protocol.ExtendedBlock;
 import org.apache.hadoop.hdfs.protocol.CorruptFileBlocks;
 import org.apache.hadoop.hdfs.protocol.LocatedBlocks;
+import org.apache.hadoop.hdfs.server.protocol.NamenodeProtocols;
 import org.apache.hadoop.hdfs.tools.DFSck;
 import org.apache.hadoop.io.IOUtils;
 import org.apache.hadoop.security.UserGroupInformation;
@@ -481,7 +482,7 @@ public class TestFsck extends TestCase {
       }
 
       // wait for the namenode to see the corruption
-      final NameNode namenode = cluster.getNameNode();
+      final NamenodeProtocols namenode = cluster.getNameNodeRpc();
       CorruptFileBlocks corruptFileBlocks = namenode
           .listCorruptFileBlocks("/corruptData", null);
       int numCorrupt = corruptFileBlocks.getFiles().length;

Modified: hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestHDFSConcat.java
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestHDFSConcat.java?rev=1165463&r1=1165462&r2=1165463&view=diff
==============================================================================
--- hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestHDFSConcat.java
(original)
+++ hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestHDFSConcat.java
Tue Sep  6 00:41:47 2011
@@ -40,6 +40,7 @@ import org.apache.hadoop.hdfs.Distribute
 import org.apache.hadoop.hdfs.MiniDFSCluster;
 import org.apache.hadoop.hdfs.protocol.HdfsFileStatus;
 import org.apache.hadoop.hdfs.protocol.LocatedBlocks;
+import org.apache.hadoop.hdfs.server.protocol.NamenodeProtocols;
 import org.apache.hadoop.hdfs.tools.DFSAdmin;
 import org.apache.hadoop.security.UserGroupInformation;
 import org.junit.After;
@@ -52,7 +53,7 @@ public class TestHDFSConcat {
   private static final short REPL_FACTOR = 2;
   
   private MiniDFSCluster cluster;
-  private NameNode nn;
+  private NamenodeProtocols nn;
   private DistributedFileSystem dfs;
 
   private static long blockSize = 512;
@@ -72,7 +73,7 @@ public class TestHDFSConcat {
     cluster.waitClusterUp();
     dfs = (DistributedFileSystem) cluster.getFileSystem();
     assertNotNull("Failed to get FileSystem", dfs);
-    nn = cluster.getNameNode();
+    nn = cluster.getNameNodeRpc();
     assertNotNull("Failed to get NameNode", nn);
   }
 
@@ -283,7 +284,7 @@ public class TestHDFSConcat {
     Path filePath1 = new Path(name1);
     DFSTestUtil.createFile(dfs, filePath1, trgFileLen, REPL_FACTOR, 1);
     
-    HdfsFileStatus fStatus = cluster.getNameNode().getFileInfo(name1);
+    HdfsFileStatus fStatus = nn.getFileInfo(name1);
     long fileLen = fStatus.getLen();
     assertEquals(fileLen, trgFileLen);
     
@@ -293,11 +294,11 @@ public class TestHDFSConcat {
     stm.readFully(0, byteFile1);
     stm.close();
     
-    LocatedBlocks lb1 = cluster.getNameNode().getBlockLocations(name1, 0, trgFileLen);
+    LocatedBlocks lb1 = nn.getBlockLocations(name1, 0, trgFileLen);
     
     Path filePath2 = new Path(name2);
     DFSTestUtil.createFile(dfs, filePath2, srcFileLen, REPL_FACTOR, 1);
-    fStatus = cluster.getNameNode().getFileInfo(name2);
+    fStatus = nn.getFileInfo(name2);
     fileLen = fStatus.getLen();
     assertEquals(srcFileLen, fileLen);
     
@@ -307,7 +308,7 @@ public class TestHDFSConcat {
     stm.readFully(0, byteFile2);
     stm.close();
     
-    LocatedBlocks lb2 = cluster.getNameNode().getBlockLocations(name2, 0, srcFileLen);
+    LocatedBlocks lb2 = nn.getBlockLocations(name2, 0, srcFileLen);
     
     
     System.out.println("trg len="+trgFileLen+"; src len="+srcFileLen);
@@ -316,7 +317,7 @@ public class TestHDFSConcat {
     dfs.concat(filePath1, new Path [] {filePath2});
     
     long totalLen = trgFileLen + srcFileLen;
-    fStatus = cluster.getNameNode().getFileInfo(name1);
+    fStatus = nn.getFileInfo(name1);
     fileLen = fStatus.getLen();
     
     // read the resulting file
@@ -325,7 +326,7 @@ public class TestHDFSConcat {
     stm.readFully(0, byteFileConcat);
     stm.close();
     
-    LocatedBlocks lbConcat = cluster.getNameNode().getBlockLocations(name1, 0, fileLen);
+    LocatedBlocks lbConcat = nn.getBlockLocations(name1, 0, fileLen);
     
     //verifications
     // 1. number of blocks
@@ -337,7 +338,7 @@ public class TestHDFSConcat {
     assertEquals(fileLen, totalLen);
     
     // 3. removal of the src file
-    fStatus = cluster.getNameNode().getFileInfo(name2);
+    fStatus = nn.getFileInfo(name2);
     assertNull("File "+name2+ "still exists", fStatus); // file shouldn't exist
   
     // 4. content

Modified: hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestListCorruptFileBlocks.java
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestListCorruptFileBlocks.java?rev=1165463&r1=1165462&r2=1165463&view=diff
==============================================================================
--- hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestListCorruptFileBlocks.java
(original)
+++ hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestListCorruptFileBlocks.java
Tue Sep  6 00:41:47 2011
@@ -147,7 +147,7 @@ public class TestListCorruptFileBlocks {
       conf.setFloat(DFSConfigKeys.DFS_NAMENODE_REPL_QUEUE_THRESHOLD_PCT_KEY,
                     0f);
       cluster = new MiniDFSCluster.Builder(conf).waitSafeMode(false).build();
-      cluster.getNameNode().
+      cluster.getNameNodeRpc().
         setSafeMode(HdfsConstants.SafeModeAction.SAFEMODE_LEAVE);
       FileSystem fs = cluster.getFileSystem();
 
@@ -244,7 +244,7 @@ public class TestListCorruptFileBlocks {
                  cluster.getNameNode().isInSafeMode());
 
       // now leave safe mode so that we can clean up
-      cluster.getNameNode().
+      cluster.getNameNodeRpc().
         setSafeMode(HdfsConstants.SafeModeAction.SAFEMODE_LEAVE);
 
       util.cleanup(fs, "/srcdat10");

Modified: hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestNNStorageRetentionFunctional.java
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestNNStorageRetentionFunctional.java?rev=1165463&r1=1165462&r2=1165463&view=diff
==============================================================================
--- hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestNNStorageRetentionFunctional.java
(original)
+++ hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestNNStorageRetentionFunctional.java
Tue Sep  6 00:41:47 2011
@@ -148,8 +148,8 @@ public class TestNNStorageRetentionFunct
 
   private static void doSaveNamespace(NameNode nn) throws IOException {
     LOG.info("Saving namespace...");
-    nn.setSafeMode(SafeModeAction.SAFEMODE_ENTER);
-    nn.saveNamespace();
-    nn.setSafeMode(SafeModeAction.SAFEMODE_LEAVE);
+    nn.getRpcServer().setSafeMode(SafeModeAction.SAFEMODE_ENTER);
+    nn.getRpcServer().saveNamespace();
+    nn.getRpcServer().setSafeMode(SafeModeAction.SAFEMODE_LEAVE);
   }
 }

Modified: hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestNameNodeJspHelper.java
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestNameNodeJspHelper.java?rev=1165463&r1=1165462&r2=1165463&view=diff
==============================================================================
--- hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestNameNodeJspHelper.java
(original)
+++ hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestNameNodeJspHelper.java
Tue Sep  6 00:41:47 2011
@@ -28,6 +28,7 @@ import org.apache.hadoop.conf.Configurat
 import org.apache.hadoop.hdfs.DFSConfigKeys;
 import org.apache.hadoop.hdfs.HdfsConfiguration;
 import org.apache.hadoop.hdfs.MiniDFSCluster;
+import org.apache.hadoop.hdfs.server.protocol.NamenodeProtocols;
 import org.apache.hadoop.security.UserGroupInformation;
 import org.junit.After;
 import org.junit.Assert;
@@ -54,7 +55,7 @@ public class TestNameNodeJspHelper {
 
   @Test
   public void testDelegationToken() throws IOException, InterruptedException {
-    NameNode nn = cluster.getNameNode();
+    NamenodeProtocols nn = cluster.getNameNodeRpc();
     HttpServletRequest request = mock(HttpServletRequest.class);
     UserGroupInformation ugi = UserGroupInformation.createRemoteUser("auser");
     String tokenString = NamenodeJspHelper.getDelegationToken(nn, request,

Modified: hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestParallelImageWrite.java
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestParallelImageWrite.java?rev=1165463&r1=1165462&r2=1165463&view=diff
==============================================================================
--- hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestParallelImageWrite.java
(original)
+++ hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestParallelImageWrite.java
Tue Sep  6 00:41:47 2011
@@ -108,7 +108,7 @@ public class TestParallelImageWrite exte
       files.cleanup(fs, dir);
       files.createFiles(fs, dir);
       fsn.setSafeMode(SafeModeAction.SAFEMODE_ENTER);
-      cluster.getNameNode().saveNamespace();
+      cluster.getNameNodeRpc().saveNamespace();
       final String checkAfterModify = checkImages(fsn, numNamenodeDirs);
       assertFalse("Modified namespace should change fsimage contents. " +
           "was: " + checkAfterRestart + " now: " + checkAfterModify,

Modified: hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestStartup.java
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestStartup.java?rev=1165463&r1=1165462&r2=1165463&view=diff
==============================================================================
--- hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestStartup.java
(original)
+++ hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestStartup.java
Tue Sep  6 00:41:47 2011
@@ -51,6 +51,7 @@ import org.apache.hadoop.hdfs.protocol.H
 import org.apache.hadoop.hdfs.server.common.Storage.StorageDirectory;
 import org.apache.hadoop.hdfs.server.namenode.NNStorage.NameNodeDirType;
 import org.apache.hadoop.hdfs.server.namenode.NNStorage.NameNodeFile;
+import org.apache.hadoop.hdfs.server.protocol.NamenodeProtocols;
 import org.apache.hadoop.hdfs.util.MD5FileUtils;
 import org.apache.hadoop.io.MD5Hash;
 import org.apache.hadoop.util.StringUtils;
@@ -379,9 +380,10 @@ public class TestStartup extends TestCas
     NameNode namenode = new NameNode(conf);
     namenode.getNamesystem().mkdirs("/test",
         new PermissionStatus("hairong", null, FsPermission.getDefault()), true);
-    assertTrue(namenode.getFileInfo("/test").isDir());
-    namenode.setSafeMode(SafeModeAction.SAFEMODE_ENTER);
-    namenode.saveNamespace();
+    NamenodeProtocols nnRpc = namenode.getRpcServer();
+    assertTrue(nnRpc.getFileInfo("/test").isDir());
+    nnRpc.setSafeMode(SafeModeAction.SAFEMODE_ENTER);
+    nnRpc.saveNamespace();
     namenode.stop();
     namenode.join();
 
@@ -408,9 +410,10 @@ public class TestStartup extends TestCas
 
   private void checkNameSpace(Configuration conf) throws IOException {
     NameNode namenode = new NameNode(conf);
-    assertTrue(namenode.getFileInfo("/test").isDir());
-    namenode.setSafeMode(SafeModeAction.SAFEMODE_ENTER);
-    namenode.saveNamespace();
+    NamenodeProtocols nnRpc = namenode.getRpcServer();
+    assertTrue(nnRpc.getFileInfo("/test").isDir());
+    nnRpc.setSafeMode(SafeModeAction.SAFEMODE_ENTER);
+    nnRpc.saveNamespace();
     namenode.stop();
     namenode.join();
   }
@@ -515,7 +518,7 @@ public class TestStartup extends TestCas
       cluster.waitActive();
   
       cluster.restartNameNode();
-      NameNode nn = cluster.getNameNode();
+      NamenodeProtocols nn = cluster.getNameNodeRpc();
       assertNotNull(nn);
       Assert.assertTrue(cluster.isDataNodeUp());
       

Modified: hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestStorageRestore.java
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestStorageRestore.java?rev=1165463&r1=1165462&r2=1165463&view=diff
==============================================================================
--- hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestStorageRestore.java
(original)
+++ hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestStorageRestore.java
Tue Sep  6 00:41:47 2011
@@ -339,7 +339,7 @@ public class TestStorageRestore {
       
       // Simulate a 2NN beginning a checkpoint, but not finishing. This will
       // cause name1 to be restored.
-      cluster.getNameNode().rollEditLog();
+      cluster.getNameNodeRpc().rollEditLog();
       
       printStorages(fsImage);
       

Modified: hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/metrics/TestNNMetricFilesInGetListingOps.java
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/metrics/TestNNMetricFilesInGetListingOps.java?rev=1165463&r1=1165462&r2=1165463&view=diff
==============================================================================
--- hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/metrics/TestNNMetricFilesInGetListingOps.java
(original)
+++ hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/metrics/TestNNMetricFilesInGetListingOps.java
Tue Sep  6 00:41:47 2011
@@ -74,9 +74,9 @@ public class TestNNMetricFilesInGetListi
     createFile("/tmp1/t2", 3200, (short)3);
     createFile("/tmp2/t1", 3200, (short)3);
     createFile("/tmp2/t2", 3200, (short)3);
-    cluster.getNameNode().getListing("/tmp1", HdfsFileStatus.EMPTY_NAME, false);
+    cluster.getNameNodeRpc().getListing("/tmp1", HdfsFileStatus.EMPTY_NAME, false);
     assertCounter("FilesInGetListingOps", 2L, getMetrics(NN_METRICS));
-    cluster.getNameNode().getListing("/tmp2", HdfsFileStatus.EMPTY_NAME, false);
+    cluster.getNameNodeRpc().getListing("/tmp2", HdfsFileStatus.EMPTY_NAME, false);
     assertCounter("FilesInGetListingOps", 4L, getMetrics(NN_METRICS));
   }
 }

Modified: hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/tools/offlineImageViewer/TestOfflineImageViewer.java
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/tools/offlineImageViewer/TestOfflineImageViewer.java?rev=1165463&r1=1165462&r2=1165463&view=diff
==============================================================================
--- hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/tools/offlineImageViewer/TestOfflineImageViewer.java
(original)
+++ hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/tools/offlineImageViewer/TestOfflineImageViewer.java
Tue Sep  6 00:41:47 2011
@@ -124,8 +124,8 @@ public class TestOfflineImageViewer exte
       }
 
       // Write results to the fsimage file
-      cluster.getNameNode().setSafeMode(SafeModeAction.SAFEMODE_ENTER);
-      cluster.getNameNode().saveNamespace();
+      cluster.getNameNodeRpc().setSafeMode(SafeModeAction.SAFEMODE_ENTER);
+      cluster.getNameNodeRpc().saveNamespace();
       
       // Determine location of fsimage file
       orig = FSImageTestUtil.findLatestImageFile(



Mime
View raw message