Examples of restartNameNode()


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

      System.out.println(contents);
      assertTrue(Pattern.compile("1 txns/\\d+ms behind").matcher(contents)
          .find());

      // Restart NN while JN0 is still down.
      cluster.restartNameNode();

      contents = DFSTestUtil.urlGet(url);
      System.out.println(contents);
      assertTrue(Pattern.compile("never written").matcher(contents)
          .find());
View Full Code Here

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

      } catch (IOException ioe) {
        // This is expected.
      }
      Mockito.reset(faultInjector);
      // Namenode should still restart successfully
      cluster.restartNameNode();
    } finally {
      if (fs != null) {
        fs.close();
      }
      cleanup(secondary);
View Full Code Here

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

    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

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

    try {
      cluster = new MiniDFSCluster.Builder(config)
      .numDataNodes(numDatanodes).setupHostsFile(true).build();
      cluster.waitActive();
 
      cluster.restartNameNode();
      NamenodeProtocols nn = cluster.getNameNodeRpc();
      assertNotNull(nn);
      assertTrue(cluster.isDataNodeUp());
     
      DatanodeInfo[] info = nn.getDatanodeReport(DatanodeReportType.LIVE);
View Full Code Here

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

       * 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(0);
      cluster.shutdownNameNode(0);

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

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

       * 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(0);
      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

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

      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(0);
      // verify blockSeekTo() works again (by transparently re-fetching
      // tokens from namenode)
      in1.seek(0);
      assertTrue(checkFile1(in1));
      in2.seekToNewSource(0);
View Full Code Here

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

        // and one current copy. This test wants to ensure that the old genstamp
        // copy is the one that is deleted.

        LOG.info("=========================== restarting cluster");
        DataNodeProperties otherNode = cluster.stopDataNode(0);
        cluster.restartNameNode();
       
        // Restart the datanode with the corrupt replica first.
        cluster.restartDataNode(oldGenstampNode);
        cluster.waitActive();
View Full Code Here

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

      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

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

      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
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.