Examples of transitionToStandby()


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

      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

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

      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

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

      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

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

      }
     
      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

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

      fs.mkdirs(new Path("/test1"));
      fs.mkdirs(new Path("/test2"));
     
      runFsck(conf);
     
      cluster.transitionToStandby(0);
      cluster.transitionToActive(1);
     
      runFsck(conf);
    } finally {
      if (fs != null) {
View Full Code Here

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

      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

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

      // 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

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