Package org.apache.hadoop.hdfs

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

      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

    try {
      fileSystem = cluster.getFileSystem();
      // Keep open stream
      outStream = writeFileAndSync(fileSystem, src, fileContent);
      // Parameter true will ensure that NN came out of safemode
      cluster.restartNameNode();
      assertEquals(
          "Not able to read the synced block content after NameNode restart (with append support)",
          fileContent, getFileContentFromDFS(fileSystem));
    } finally {
      if (null != fileSystem)
View Full Code Here

          "clientName", false, (short) 2, 1024);
      client.namenode.addBlock("/tmp1.txt", "clientName", new DatanodeInfo[0]);

      // Restart NameNode waiting for exiting safemode, ensure NameNode doesn't
      // get stuck in safemode
      cluster.restartNameNode();

    } finally {
      cluster.shutdown();
    }
  }
View Full Code Here

      LOG.info("Namenode has bad files. " + badFiles.size());
      assertTrue("Namenode has " + badFiles.size() + " bad files. Expecting 1.",
          badFiles.size() == 1);
      // restart namenode
      cluster.restartNameNode(0);
      fs = cluster.getFileSystem();

      // wait until replication queues have been initialized
      while (!cluster.getNameNode().namesystem.isPopulatingReplQueues()) {
        try {
View Full Code Here

    try {
      cluster = new MiniDFSCluster.Builder(conf).numNameNodes(numNameNodes)
      .numDataNodes(numDatanodes).setupHostsFile(true).build();
      cluster.waitActive();
 
      cluster.restartNameNode();
      NamenodeProtocols nn = cluster.getNameNodeRpc();
      assertNotNull(nn);
      Assert.assertTrue(cluster.isDataNodeUp());
     
      DatanodeInfo[] info = nn.getDatanodeReport(DatanodeReportType.LIVE);
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(0);
      cluster.shutdownNameNode(0);

      // 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(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

      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

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.