Package org.apache.hadoop.hdfs

Examples of org.apache.hadoop.hdfs.MiniDFSCluster.restartNameNode()


          TEST_FILE_PATH, 6000, (short)1, 1L);
     
      cluster.getConfiguration(0).setInt(
          DFSConfigKeys.DFS_NAMENODE_SAFEMODE_EXTENSION_KEY, 60000);

      cluster.restartNameNode(0);
      NameNode nn = cluster.getNameNode(0);
     
      banner("Started in state 1.");
      assertTrue(nn.isStandbyState());
      assertTrue(nn.isInSafeMode());
View Full Code Here


      assertTrue(fs.delete(new Path("/test1"), true));
      inodeCount -= 2; // test1 and file2 is deleted
      assertEquals(inodeCount, fsn.dir.getInodeMapSize());

      // Make sure editlog is loaded correctly
      cluster.restartNameNode();
      cluster.waitActive();
      fsn = cluster.getNamesystem();
      assertEquals(expectedLastInodeId, fsn.getLastInodeId());
      assertEquals(inodeCount, fsn.dir.getInodeMapSize());
View Full Code Here

      fsn.leaveSafeMode();

      outStream.close();

      // The lastInodeId in fsimage should remain the same after reboot
      cluster.restartNameNode();
      cluster.waitActive();
      fsn = cluster.getNamesystem();
      assertEquals(expectedLastInodeId, fsn.getLastInodeId());
      assertEquals(inodeCount, fsn.dir.getInodeMapSize());
    } finally {
View Full Code Here

          TEST_FILE_PATH, 6000, (short)1, 1L);
     
      cluster.getConfiguration(0).setInt(
          DFSConfigKeys.DFS_NAMENODE_SAFEMODE_EXTENSION_KEY, 60000);

      cluster.restartNameNode(0);
      NameNode nn = cluster.getNameNode(0);
     
      banner("Started in state 1.");
      assertTrue(nn.isStandbyState());
      assertTrue(nn.isInSafeMode());
View Full Code Here

        modifier.modify(editFile);
      }

      try {
        //restart namenode.
        cluster.restartNameNode();
       
        //No exception: the modification must be tolerable.
        Assert.assertTrue(modifier.isTolerable());
      } catch (IOException e) {
        //Got an exception: the modification must be intolerable.
View Full Code Here

      assertTrue(testPath1 + " should exist after bad checkpoint, before restart",
          fs.exists(testPath1));
      assertTrue(testPath2 + " should exist after bad checkpoint, before restart",
          fs.exists(testPath2));
     
      cluster.restartNameNode();
     
      // After restarting the NN, it will read the HDFS metadata from disk.
      // Things should still be good.
      assertTrue(testPath1 + " should exist after bad checkpoint, after restart",
          fs.exists(testPath1));
View Full Code Here

       * previous test, this test should also run while namenode is down. The
       * setup for this test depends on the previous test.
       */

      // restart the namenode and then shut it down for test
      cluster.restartNameNode();
      cluster.shutdownNameNode();

      // verify blockSeekTo() still works (forced to use cached tokens)
      in1.seek(0);
      assertTrue(checkFile1(in1));
View Full Code Here

       * re-fetching tokens and is able to re-fetch tokens transparently. The
       * setup of this test depends on the previous test.
       */

      // restore the cluster and restart the datanodes for test
      cluster.restartNameNode();
      assertTrue(cluster.restartDataNodes(true));
      cluster.waitActive();
      assertEquals(numDataNodes, cluster.getDataNodes().size());

      // shutdown namenode so that DFSClient can't get new tokens from namenode
View Full Code Here

      assertFalse(checkFile1(in1));
      // verify fetchBlockByteRange() fails (cached tokens become invalid)
      assertFalse(checkFile2(in3));

      // restart the namenode to allow DFSClient to re-fetch tokens
      cluster.restartNameNode();
      // verify blockSeekTo() works again (by transparently re-fetching
      // tokens from namenode)
      in1.seek(0);
      assertTrue(checkFile1(in1));
      in2.seekToNewSource(0);
View Full Code Here

    try {
      cluster.getFileSystem().mkdirs(TEST_PATH);
     
      // Restart the NN and make sure the edit was persisted
      // and loaded again
      cluster.restartNameNode();
     
      assertTrue(cluster.getFileSystem().exists(TEST_PATH));
      cluster.getFileSystem().mkdirs(TEST_PATH_2);
     
      // Restart the NN again and make sure both edits are persisted.
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.