Examples of transitionToActive()


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

      cluster.transitionToActive(0);
      NameNode nn0 = cluster.getNameNode(0);
      nn0.getRpcServer().rollEditLog();
      cluster.shutdownNameNode(0);
      createEmptyInProgressEditLog(cluster, nn0, writeHeader);
      cluster.transitionToActive(1);
    } finally {
      IOUtils.cleanup(LOG, fs);
      cluster.shutdown();
    }
  }
View Full Code Here

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

        .nnTopology(MiniDFSNNTopology.simpleHATopology())
        .numDataNodes(1)
         .waitSafeMode(false)
        .build();
    try {
      cluster.transitionToActive(0);
      DFSTestUtil.createFile(cluster.getFileSystem(0),
          TEST_FILE_PATH, 6000, (short)1, 1L);
     
      cluster.getConfiguration(0).setInt(
          DFSConfigKeys.DFS_NAMENODE_SAFEMODE_EXTENSION_KEY, 60000);
View Full Code Here

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

      .numDataNodes(3)
      .build();
    Runtime mockRuntime = mock(Runtime.class);
    try {
      cluster.waitActive();
      cluster.transitionToActive(0);
     
      NameNode nn1 = cluster.getNameNode(0);
      NameNode nn2 = cluster.getNameNode(1);
     
      nn2.getNamesystem().getEditLogTailer().setRuntime(mockRuntime);
View Full Code Here

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

      .build();
    try {
      NameNode nn0 = cluster.getNameNode(0);
      NameNode nn1 = cluster.getNameNode(1);

      cluster.transitionToActive(0);
     
      // Create 5 blocks.
      DFSTestUtil.createFile(cluster.getFileSystem(0),
          TEST_FILE_PATH, 5*1024, (short)1, 1L);
     
View Full Code Here

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

      cluster.waitActive();
      Runtime mockRuntime = mock(Runtime.class);
      cluster.getNameNode(0).setRuntimeForTesting(mockRuntime);
      verify(mockRuntime, times(0)).exit(anyInt());
      try {
        cluster.transitionToActive(0);
        fail("Transitioned to active but should not have been able to.");
      } catch (ServiceFailedException sfe) {
        assertExceptionContains("Error encountered requiring NN shutdown. " +
            "Shutting down immediately.", sfe);
        LOG.info("got expected exception", sfe);
View Full Code Here

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

        .nnTopology(MiniDFSNNTopology.simpleHATopology())
        .numDataNodes(0)
        .build();
     
      cluster.waitActive();
      cluster.transitionToActive(0);
     
      FileSystem fs = HATestUtil.configureFailoverFs(cluster, conf);
     
      assertTrue(fs.mkdirs(new Path("/test1")));
     
View Full Code Here

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

        DFSConfigKeys.DFS_BLOCKREPORT_INTERVAL_MSEC_KEY, 1000);

    final MiniDFSCluster cluster = harness.startCluster();
    try {
      cluster.waitActive();
      cluster.transitionToActive(0);
     
      FileSystem fs = harness.getFailoverFs();
      TestContext togglers = new TestContext();
      for (int i = 0; i < NUM_THREADS; i++) {
        Path p = new Path("/test-" + i);
View Full Code Here

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

      .nnTopology(MiniDFSNNTopology.simpleHATopology())
      .numDataNodes(3)
      .build();
    try {
      cluster.waitActive();
      cluster.transitionToActive(0);
      Thread.sleep(500);

      LOG.info("Starting with NN 0 active");
      FileSystem fs = HATestUtil.configureFailoverFs(cluster, conf);
      stm = fs.create(TEST_PATH);
View Full Code Here

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

      // Make sure all of the blocks are written out before failover.
      stm.hflush();

      LOG.info("Failing over to NN 1");
      cluster.transitionToStandby(0);
      cluster.transitionToActive(1);

      assertTrue(fs.exists(TEST_PATH));
      FSNamesystem ns1 = cluster.getNameNode(1).getNamesystem();
      BlockManagerTestUtil.updateState(ns1.getBlockManager());
      assertEquals(0, ns1.getPendingReplicationBlocks());
View Full Code Here

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

      .nnTopology(MiniDFSNNTopology.simpleHATopology())
      .numDataNodes(5)
      .build();
    try {
      cluster.waitActive();
      cluster.transitionToActive(0);
      Thread.sleep(500);

      LOG.info("Starting with NN 0 active");
      FileSystem fs = HATestUtil.configureFailoverFs(cluster, conf);
      stm = fs.create(TEST_PATH);
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.