Package org.apache.helix

Examples of org.apache.helix.HelixConnection.connect()


    opts.addOption("participantClass", true, "Participant service class");
    try {
      CommandLine cliParser = new GnuParser().parse(opts, args);
      String zkAddress = cliParser.getOptionValue("zkAddress");
      final HelixConnection connection = new ZkHelixConnection(zkAddress);
      connection.connect();
      ClusterId clusterId = ClusterId.from(cliParser.getOptionValue("cluster"));
      ParticipantId participantId = ParticipantId.from(cliParser.getOptionValue("participantId"));
      String participantClass = cliParser.getOptionValue("participantClass");
      @SuppressWarnings("unchecked")
      Class<? extends AbstractParticipantService> clazz =
View Full Code Here


        NUM_REPLICAS, // replicas
        "OnlineOffline", RebalanceMode.CUSTOMIZED, true); // do rebalance

    // Connect
    HelixConnection connection = new ZkHelixConnection(_zkaddr);
    connection.connect();

    // Start some participants
    HelixParticipant[] participants = new HelixParticipant[NUM_PARTICIPANTS];
    for (int i = 0; i < NUM_PARTICIPANTS; i++) {
      participants[i] =
View Full Code Here

        NUM_REPLICAS, // replicas
        "OnlineOffline", RebalanceMode.CUSTOMIZED, true); // do rebalance

    // Connect
    HelixConnection connection = new ZkHelixConnection(_zkaddr);
    connection.connect();

    // Create a couple controllers
    HelixController[] controllers = new HelixController[NUM_CONTROLLERS];
    for (int i = 0; i < NUM_CONTROLLERS; i++) {
      controllers[i] =
View Full Code Here

    ClusterConfig cluster = clusterBuilder.build();

    // set up a connection to work with ZooKeeper-persisted data
    HelixConnection connection = new ZkHelixConnection(args[0]);
    connection.connect();

    // create the cluster
    createCluster(cluster, connection);

    // update the resource
View Full Code Here

        2, // replicas
        "MasterSlave", true); // do rebalance

    // create connection
    HelixConnection connection = new ZkHelixConnection(_zkaddr);
    connection.connect();

    // start controller
    ClusterId clusterId = ClusterId.from(clusterName);
    ControllerId controllerId = ControllerId.from("controller");
    HelixController controller = connection.createController(clusterId, controllerId);
View Full Code Here

        2, // replicas
        "MasterSlave", true); // do rebalance

    // create connection
    HelixConnection connection = new ZkHelixConnection(_zkaddr);
    connection.connect();

    // start controller
    ClusterId clusterId = ClusterId.from(clusterName);
    final ControllerId controllerId = ControllerId.from("controller");
View Full Code Here

        2, // replicas
        "MasterSlave", true); // do rebalance

    // create connection
    HelixConnection connection = new ZkHelixConnection(_zkaddr);
    connection.connect();

    // start participant
    ClusterId clusterId = ClusterId.from(clusterName);
    HelixParticipant[] participants = new HelixParticipant[n];
    for (int i = 0; i < n; i++) {
View Full Code Here

        2, // replicas
        "MasterSlave", true); // do rebalance

    // create connection
    HelixConnection connection = new ZkHelixConnection(_zkaddr);
    connection.connect();

    // start multi-cluster-controller
    ClusterId clusterId = ClusterId.from(clusterName);
    final HelixMultiClusterController[] controllers = new HelixMultiClusterController[n];
    for (int i = 0; i < n; i++) {
View Full Code Here

    State dropped = State.from("DROPPED");
    StateModelDefId stateModelDefId = StateModelDefId.from("MasterSlave");

    // create connection
    HelixConnection connection = new ZkHelixConnection(_zkaddr);
    connection.connect();

    // setup cluster
    ClusterAccessor clusterAccessor = connection.createClusterAccessor(clusterId);
    clusterAccessor.dropCluster();
View Full Code Here

              hostName = report.getHost();
            }
            connection = new ZkHelixConnection(hostName + ":2181");

            try {
              connection.connect();
            } catch (Exception e) {
              LOG.warn("AppMaster started but not yet initialized");
              connection = null;
            }
          }
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.