Examples of killCurrentActiveZooKeeperServer()


Examples of org.apache.hadoop.hbase.zookeeper.MiniZooKeeperCluster.killCurrentActiveZooKeeperServer()

  @Test public void testMiniZooKeeper() throws Exception {
    HBaseTestingUtility hbt = new HBaseTestingUtility();
    MiniZooKeeperCluster cluster1 = hbt.startMiniZKCluster();
    try {
      assertEquals(0, cluster1.getBackupZooKeeperServerNum());
      assertTrue((cluster1.killCurrentActiveZooKeeperServer() == -1));
    } finally {
      hbt.shutdownMiniZKCluster();
    }

    // set up zookeeper cluster with 5 zk servers
View Full Code Here

Examples of org.apache.hadoop.hbase.zookeeper.MiniZooKeeperCluster.killCurrentActiveZooKeeperServer()

    cluster2.setDefaultClientPort(defaultClientPort);
    try {
      assertEquals(4, cluster2.getBackupZooKeeperServerNum());

      // killing the current active zk server
      assertTrue((cluster2.killCurrentActiveZooKeeperServer() >= defaultClientPort));
      assertTrue((cluster2.killCurrentActiveZooKeeperServer() >= defaultClientPort));
      assertEquals(2, cluster2.getBackupZooKeeperServerNum());
      assertEquals(3, cluster2.getZooKeeperServerNum());

      // killing the backup zk servers
View Full Code Here

Examples of org.apache.hadoop.hbase.zookeeper.MiniZooKeeperCluster.killCurrentActiveZooKeeperServer()

    try {
      assertEquals(4, cluster2.getBackupZooKeeperServerNum());

      // killing the current active zk server
      assertTrue((cluster2.killCurrentActiveZooKeeperServer() >= defaultClientPort));
      assertTrue((cluster2.killCurrentActiveZooKeeperServer() >= defaultClientPort));
      assertEquals(2, cluster2.getBackupZooKeeperServerNum());
      assertEquals(3, cluster2.getZooKeeperServerNum());

      // killing the backup zk servers
      cluster2.killOneBackupZooKeeperServer();
View Full Code Here

Examples of org.apache.hadoop.hbase.zookeeper.MiniZooKeeperCluster.killCurrentActiveZooKeeperServer()

      cluster2.killOneBackupZooKeeperServer();
      assertEquals(0, cluster2.getBackupZooKeeperServerNum());
      assertEquals(1, cluster2.getZooKeeperServerNum());

      // killing the last zk server
      assertTrue((cluster2.killCurrentActiveZooKeeperServer() == -1));
      // this should do nothing.
      cluster2.killOneBackupZooKeeperServer();
      assertEquals(-1, cluster2.getBackupZooKeeperServerNum());
      assertEquals(0, cluster2.getZooKeeperServerNum());
    } finally {
View Full Code Here

Examples of org.apache.hadoop.hbase.zookeeper.MiniZooKeeperCluster.killCurrentActiveZooKeeperServer()

  @Test public void testMiniZooKeeper() throws Exception {
    HBaseTestingUtility hbt = new HBaseTestingUtility();
    MiniZooKeeperCluster cluster1 = hbt.startMiniZKCluster();
    try {
      assertEquals(0, cluster1.getBackupZooKeeperServerNum());
      assertTrue((cluster1.killCurrentActiveZooKeeperServer() == -1));
    } finally {
      hbt.shutdownMiniZKCluster();
    }

    // set up zookeeper cluster with 5 zk servers
View Full Code Here

Examples of org.apache.hadoop.hbase.zookeeper.MiniZooKeeperCluster.killCurrentActiveZooKeeperServer()

    cluster2.setDefaultClientPort(defaultClientPort);
    try {
      assertEquals(4, cluster2.getBackupZooKeeperServerNum());

      // killing the current active zk server
      int currentActivePort = cluster2.killCurrentActiveZooKeeperServer();
      assertTrue(currentActivePort >= defaultClientPort);
      // Check if the client port is returning a proper value
      assertTrue(cluster2.getClientPort() == currentActivePort);

      // kill another active zk server
View Full Code Here

Examples of org.apache.hadoop.hbase.zookeeper.MiniZooKeeperCluster.killCurrentActiveZooKeeperServer()

      assertTrue(currentActivePort >= defaultClientPort);
      // Check if the client port is returning a proper value
      assertTrue(cluster2.getClientPort() == currentActivePort);

      // kill another active zk server
      currentActivePort = cluster2.killCurrentActiveZooKeeperServer();
      assertTrue(currentActivePort >= defaultClientPort);
      assertTrue(cluster2.getClientPort() == currentActivePort);     
      assertEquals(2, cluster2.getBackupZooKeeperServerNum());
      assertEquals(3, cluster2.getZooKeeperServerNum());
View Full Code Here

Examples of org.apache.hadoop.hbase.zookeeper.MiniZooKeeperCluster.killCurrentActiveZooKeeperServer()

      cluster2.killOneBackupZooKeeperServer();
      assertEquals(0, cluster2.getBackupZooKeeperServerNum());
      assertEquals(1, cluster2.getZooKeeperServerNum());

      // killing the last zk server
      currentActivePort = cluster2.killCurrentActiveZooKeeperServer();
      assertTrue(currentActivePort == -1);
      assertTrue(cluster2.getClientPort() == currentActivePort);
      // this should do nothing.
      cluster2.killOneBackupZooKeeperServer();
      assertEquals(-1, cluster2.getBackupZooKeeperServerNum());
View Full Code Here

Examples of org.apache.hadoop.hbase.zookeeper.MiniZooKeeperCluster.killCurrentActiveZooKeeperServer()

      cluster2.killOneBackupZooKeeperServer();
      assertEquals(0, cluster2.getBackupZooKeeperServerNum());
      assertEquals(1, cluster2.getZooKeeperServerNum());

      // killing the last zk server
      currentActivePort = cluster2.killCurrentActiveZooKeeperServer();
      assertTrue(currentActivePort == -1);
      assertTrue(cluster2.getClientPort() == currentActivePort);
      // this should do nothing.
      cluster2.killOneBackupZooKeeperServer();
      assertEquals(-1, cluster2.getBackupZooKeeperServerNum());
View Full Code Here

Examples of org.apache.hadoop.hbase.zookeeper.MiniZooKeeperCluster.killCurrentActiveZooKeeperServer()

  @Test public void testMiniZooKeeper() throws Exception {
    HBaseTestingUtility hbt = new HBaseTestingUtility();
    MiniZooKeeperCluster cluster1 = hbt.startMiniZKCluster();
    try {
      assertEquals(0, cluster1.getBackupZooKeeperServerNum());
      assertTrue((cluster1.killCurrentActiveZooKeeperServer() == -1));
    } finally {
      hbt.shutdownMiniZKCluster();
    }

    // set up zookeeper cluster with 5 zk servers
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.