Package org.apache.helix.manager.zk

Examples of org.apache.helix.manager.zk.MockMultiClusterController


    }

    // start controller nodes
    for (int i = 0; i < 2; i++) {
      String controllerName = "controller_900" + i;
      MockMultiClusterController multiClusterController =
          new MockMultiClusterController(_zkaddr, controllerClusterName, controllerName);
      multiClusterController.syncStart();
      multiClusterControllers.put(controllerName, multiClusterController);
    }
    Thread.sleep(100);

    // activate clusters
View Full Code Here


    // start multi-cluster controllers
    MockMultiClusterController[] controllers = new MockMultiClusterController[n];
    for (int i = 0; i < n; i++) {
      controllers[i] =
          new MockMultiClusterController(_zkaddr, controllerClusterName, "controller_" + i);
      controllers[i].syncStart();
    }

    boolean result =
        ClusterStateVerifier.verifyByZkCallback(
View Full Code Here

    // start multi-cluster cluster controllers
    MockMultiClusterController[] controllers = new MockMultiClusterController[n + n];
    for (int i = 0; i < n; i++) {
      controllers[i] =
          new MockMultiClusterController(_zkaddr, controllerClusterName, "controller_" + i);
      controllers[i].syncStart();
    }

    boolean result =
        ClusterStateVerifier.verifyByZkCallback(
            new ClusterStateVerifier.BestPossAndExtViewZkVerifier(_zkaddr, controllerClusterName),
            30000);
    Assert.assertTrue(result, "Controller cluster NOT in ideal state");

    // start first cluster
    MockParticipant[] participants = new MockParticipant[n];
    final String firstClusterName = clusterNamePrefix + "0_0";
    for (int i = 0; i < n; i++) {
      String instanceName = "localhost0_" + (12918 + i);
      participants[i] = new MockParticipant(_zkaddr, firstClusterName, instanceName);
      participants[i].syncStart();
    }

    result =
        ClusterStateVerifier.verifyByZkCallback(new BestPossAndExtViewZkVerifier(_zkaddr,
            firstClusterName));
    Assert.assertTrue(result, "first cluster NOT in ideal state");

    // add more controllers to controller cluster
    for (int i = 0; i < n; i++) {
      String controller = "controller_" + (n + i);
      _setupTool.addInstanceToCluster(controllerClusterName, controller);
    }
    _setupTool.rebalanceStorageCluster(controllerClusterName, clusterNamePrefix + "0", 6);
    for (int i = n; i < 2 * n; i++) {
      controllers[i] =
          new MockMultiClusterController(_zkaddr, controllerClusterName, "controller_" + i);
      controllers[i].syncStart();
    }

    // verify controller cluster
    result =
View Full Code Here

TOP

Related Classes of org.apache.helix.manager.zk.MockMultiClusterController

Copyright © 2018 www.massapicom. 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.