Examples of restartNameNode()


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

      // checkpoint
      fs.setSafeMode(SafeModeAction.SAFEMODE_ENTER);
      fs.saveNamespace();
      fs.setSafeMode(SafeModeAction.SAFEMODE_LEAVE);

      cluster.restartNameNode();
      cluster.waitActive();
      fs = cluster.getFileSystem();

      assertTrue(fs.isDirectory(dir));
      assertTrue(fs.exists(file1));
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()

          assertExceptionContains(
              "does not exist or it is not under construction", ioe);
        }
       
        // Make sure the NN can restart with the edit logs as we have them now.
        cluster.restartNameNode(true);
      } finally {
        IOUtils.closeStream(out);
      }
    } finally {
      cluster.shutdown();
View Full Code Here

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

      // when this DN starts up.
      DataNodeProperties dnProps = cluster.stopDataNode(0);
     
      // Restart the namenode so that when the DN comes up it will see an initial
      // block report.
      cluster.restartNameNode(1, false);
      assertTrue(cluster.restartDataNode(dnProps, true));
     
      // Wait until the standby NN queues up the corrupt block in the pending DN
      // message queue.
      while (cluster.getNamesystem(1).getBlockManager()
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

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

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