Package org.apache.hadoop.hdfs

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


        .checkExitOnShutdown(false)
        .build();
      NameNode nn1 = cluster.getNameNode(0);
      NameNode nn2 = cluster.getNameNode(1);
      cluster.waitActive();
      cluster.transitionToActive(0);

      FileSystem fs = HATestUtil.configureFailoverFs(cluster, conf);
      fs.mkdirs(p1);
      nn1.getRpcServer().rollEditLog();
      cluster.transitionToActive(1);
View Full Code Here


      cluster.transitionToActive(0);

      FileSystem fs = HATestUtil.configureFailoverFs(cluster, conf);
      fs.mkdirs(p1);
      nn1.getRpcServer().rollEditLog();
      cluster.transitionToActive(1);
      fs = cluster.getFileSystem(0); // get the older active server.

      try {
        fs.delete(p1, true);
        fail("Log update on older active should cause it to exit");
View Full Code Here

          .nnTopology(MiniDFSNNTopology.simpleHATopology()).numDataNodes(0)
          .manageNameDfsSharedDirs(false).build();
      NameNode nn1 = cluster.getNameNode(0);
      NameNode nn2 = cluster.getNameNode(1);
      cluster.waitActive();
      cluster.transitionToActive(0);
      nn1.getRpcServer().rollEditLog(); // Roll Edits from current Active.
      // Transition to standby current active gracefully.
      cluster.transitionToStandby(0);
      // Make the other Active and Roll edits multiple times
      cluster.transitionToActive(1);
View Full Code Here

      cluster.transitionToActive(0);
      nn1.getRpcServer().rollEditLog(); // Roll Edits from current Active.
      // Transition to standby current active gracefully.
      cluster.transitionToStandby(0);
      // Make the other Active and Roll edits multiple times
      cluster.transitionToActive(1);
      nn2.getRpcServer().rollEditLog();
      nn2.getRpcServer().rollEditLog();
      // Now One more failover. So NN1 should be able to failover successfully.
      cluster.transitionToStandby(1);
      cluster.transitionToActive(0);
View Full Code Here

      cluster.transitionToActive(1);
      nn2.getRpcServer().rollEditLog();
      nn2.getRpcServer().rollEditLog();
      // Now One more failover. So NN1 should be able to failover successfully.
      cluster.transitionToStandby(1);
      cluster.transitionToActive(0);
    } finally {
      if (cluster != null) {
        cluster.shutdown();
      }
    }
View Full Code Here

        .nnTopology(MiniDFSNNTopology.simpleHATopology()).numDataNodes(0)
        .build();
    try {
      cluster.waitActive();

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

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

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

    MiniDFSCluster cluster = new MiniDFSCluster.Builder(conf)
        .nnTopology(MiniDFSNNTopology.simpleHATopology())
        .numDataNodes(3).build();
    FileSystem fs = null;
    try {
      cluster.transitionToActive(0);
      fs = HATestUtil.configureFailoverFs(cluster, conf);

      Path fileToAppend = new Path("/FileToAppend");

      // Create file, write some data, and hflush so that the first
View Full Code Here

      // arriving.
      cluster.triggerBlockReports();

      // Failover the current standby to active.
      cluster.shutdownNameNode(0);
      cluster.transitionToActive(1);
     
      // Check the FSCK doesn't detect any bad blocks on the SBN.
      int rc = ToolRunner.run(new DFSck(cluster.getConfiguration(1)),
          new String[] { "/", "-files", "-blocks" });
      assertEquals(0, rc);
View Full Code Here

      .nnTopology(MiniDFSNNTopology.simpleHATopology())
      .numDataNodes(0)
      .build();
    cluster.waitActive();
   
    cluster.transitionToActive(0);
   
    NameNode nn1 = cluster.getNameNode(0);
    NameNode nn2 = cluster.getNameNode(1);
    try {
      for (int i = 0; i < DIRS_TO_MAKE / 2; i++) {
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.