Examples of transitionToStandby()


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

          nn1t1, nn1t1 > nn0t0);
         
      Thread.sleep(5); // make sure time advances!
     
      LOG.info("Failing over to NN 1");
      cluster.transitionToStandby(0);
      cluster.transitionToActive(1);
      long nn1t2 = NameNodeAdapter.getLeaseRenewalTime(nn1, TEST_FILE_STR);
      assertTrue("Lease should have been renewed by failover process",
          nn1t2 > nn1t1);
    } finally {
View Full Code Here

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

      String renewer = UserGroupInformation.getLoginUser().getUserName();
      Token<DelegationTokenIdentifier> token = nn1.getRpcServer()
          .getDelegationToken(new Text(renewer));

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

      nn2.getRpcServer().renewDelegationToken(token);
      nn2.getRpcServer().cancelDelegationToken(token);
      token = nn2.getRpcServer().getDelegationToken(new Text(renewer));
View Full Code Here

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

     
      // 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());
View Full Code Here

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

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

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

      assertTrue(fs.exists(TEST_PATH));
     
      cluster.stopDataNode(0);
View Full Code Here

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

      // write another block and a half
      AppendTestUtil.write(stm, BLOCK_AND_A_HALF, BLOCK_AND_A_HALF);
      stm.hflush();
     
      LOG.info("Failing back to NN 0");
      cluster.transitionToStandby(0);
      cluster.transitionToActive(1);
     
      cluster.stopDataNode(1);
     
      AppendTestUtil.write(stm, BLOCK_AND_A_HALF*2, BLOCK_AND_A_HALF);
View Full Code Here

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

      AppendTestUtil.write(stm, 0, BLOCK_AND_A_HALF);
      stm.hflush();
     
      LOG.info("Failing over to NN 1");
     
      cluster.transitionToStandby(0);
      cluster.transitionToActive(1);
     
      assertTrue(fs.exists(TEST_PATH));

      FileSystem fsOtherUser = createFsAsOtherUser(cluster, conf);
View Full Code Here

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

     
      AppendTestUtil.check(fs, TEST_PATH, BLOCK_AND_A_HALF);
     
      // Fail back to ensure that the block locations weren't lost on the
      // original node.
      cluster.transitionToStandby(1);
      cluster.transitionToActive(0);
      AppendTestUtil.check(fs, TEST_PATH, BLOCK_AND_A_HALF);     
    } finally {
      IOUtils.closeStream(stm);
      cluster.shutdown();
View Full Code Here

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

      LOG.info("Waiting for commitBlockSynchronization call from primary");
      delayer.waitForCall();

      LOG.info("Failing over to NN 1");
     
      cluster.transitionToStandby(0);
      cluster.transitionToActive(1);
     
      // Let the commitBlockSynchronization call go through, and check that
      // it failed with the correct exception.
      delayer.proceed();
View Full Code Here

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

          + NameNode.getHttpAddress(cluster.getConfiguration(0)).getPort()
          + "/dfshealth.jsp"));
      assertTrue(pageContents.contains("Browse the filesystem"));
      assertTrue(pageContents.contains("Number of Under-Replicated Blocks"));

      cluster.transitionToStandby(0);
      pageContents = DFSTestUtil.urlGet(new URL("http://localhost:"
          + NameNode.getHttpAddress(cluster.getConfiguration(0)).getPort()
          + "/dfshealth.jsp"));
      assertFalse(pageContents.contains("Browse the filesystem"));
      assertFalse(pageContents.contains("Number of Under-Replicated Blocks"));
View Full Code Here

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

      cluster.waitActive();
      cluster.transitionToActive(0);
      FileSystem fs = cluster.getFileSystem(0);
     
      fs.mkdirs(TEST_DIR);
      cluster.transitionToStandby(0);
      try {
        fs.mkdirs(new Path("/x"));
        fail("Didn't throw trying to mutate FS in standby state");
      } catch (Throwable t) {
        GenericTestUtils.assertExceptionContains(
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.