Package org.apache.hadoop.hdfs

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


          cluster.getConfiguration(1));
      assertEquals(0, rc);
     
      // Now restart NN1 and make sure that we can do ops against that as well.
      cluster.restartNameNode(1);
      cluster.transitionToStandby(0);
      cluster.transitionToActive(1);
      assertTrue(fs.mkdirs(new Path("/foo4")));
     
      assertCTimesEqual(cluster);
    } finally {
View Full Code Here


          cluster.getConfiguration(1));
      assertEquals(0, rc);
     
      // Now restart NN1 and make sure that we can do ops against that as well.
      cluster.restartNameNode(1);
      cluster.transitionToStandby(0);
      cluster.transitionToActive(1);
      assertTrue(fs.mkdirs(new Path("/foo4")));
     
      assertCTimesEqual(cluster);
    } finally {
View Full Code Here

     
      cluster.restartNameNode(1);
     
      // Make the second NN (not the one that initiated the upgrade) active when
      // the finalize command is run.
      cluster.transitionToStandby(0);
      cluster.transitionToActive(1);
     
      runFinalizeCommand(cluster);
     
      checkClusterPreviousDirExistence(cluster, false);
View Full Code Here

      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);
      nn2.getRpcServer().rollEditLog();
      nn2.getRpcServer().rollEditLog();
      // Now One more failover. So NN1 should be able to failover successfully.
View Full Code Here

      // 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);
    } finally {
      if (cluster != null) {
        cluster.shutdown();
      }
View Full Code Here

      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

      fs.delete(TEST_DIR, true);
     
      // Now if the standby tries to replay the last segment that it just
      // wrote as active, it would fail since it's trying to create a file
      // in a non-existent directory.
      cluster.transitionToStandby(0);
      cluster.transitionToActive(0);
     
      assertFalse(fs.exists(TEST_DIR));

    } finally {
View Full Code Here

      addCrmThreads(cluster, crmThreads);
      cluster.transitionToActive(0);
      addCrmThreads(cluster, crmThreads);
      cluster.transitionToActive(0);
      addCrmThreads(cluster, crmThreads);
      cluster.transitionToStandby(0);
      addCrmThreads(cluster, crmThreads);
      cluster.transitionToStandby(0);
      addCrmThreads(cluster, crmThreads);
    } finally {
      cluster.shutdown();
View Full Code Here

      addCrmThreads(cluster, crmThreads);
      cluster.transitionToActive(0);
      addCrmThreads(cluster, crmThreads);
      cluster.transitionToStandby(0);
      addCrmThreads(cluster, crmThreads);
      cluster.transitionToStandby(0);
      addCrmThreads(cluster, crmThreads);
    } finally {
      cluster.shutdown();
    }
    // Verify that all cacheReplicationMonitor threads shut down
View Full Code Here

      }
     
      ctx.addThread(new RepeatingTestThread(ctx) {
        @Override
        public void doAnAction() throws Exception {
          cluster.transitionToStandby(0);
          Thread.sleep(50);
          cluster.transitionToActive(0);
        }
      });
      ctx.startThreads();
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.