Package org.apache.helix

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


    HelixManager participant =
        HelixManagerFactory.getZKHelixManager(_clusterName, "localhost_12918",
            InstanceType.PARTICIPANT, ZK_ADDR);
    participant.getStateMachineEngine().registerStateModelFactory("OnlineOffline",
        new MyStateModelFactory(stateReachedCounts));
    participant.connect();

    Thread.sleep(1000);

    // Ensure that the external view coalesces
    boolean result =
View Full Code Here


    HelixManager participant =
        HelixManagerFactory.getZKHelixManager(_clusterName, "localhost_12918",
            InstanceType.PARTICIPANT, ZK_ADDR);
    participant.getStateMachineEngine().registerStateModelFactory("OnlineOffline",
        new MyStateModelFactory(stateReachedCounts));
    participant.connect();

    RoutingTableProvider routingTableProvider = new RoutingTableProvider();
    HelixManager spectator =
        HelixManagerFactory.getZKHelixManager(_clusterName, "spectator", InstanceType.SPECTATOR,
            ZK_ADDR);
View Full Code Here

    RoutingTableProvider routingTableProvider = new RoutingTableProvider();
    HelixManager spectator =
        HelixManagerFactory.getZKHelixManager(_clusterName, "spectator", InstanceType.SPECTATOR,
            ZK_ADDR);
    spectator.connect();
    spectator.addConfigChangeListener(routingTableProvider);
    spectator.addExternalViewChangeListener(routingTableProvider);
    Thread.sleep(1000);

    // Now let's stop the ZK server; this should do nothing
View Full Code Here

    HelixManager participant =
        new ZKHelixManager(clusterName, "localhost_12918", InstanceType.PARTICIPANT, ZK_ADDR);
    participant.getStateMachineEngine().registerStateModelFactory("MasterSlave",
        new MockMSModelFactory());
    participant.connect();

    HelixManager controller =
        new ZKHelixManager(clusterName, "controller_0", InstanceType.CONTROLLER, ZK_ADDR);
    controller.connect();
View Full Code Here

        new MockMSModelFactory());
    participant.connect();

    HelixManager controller =
        new ZKHelixManager(clusterName, "controller_0", InstanceType.CONTROLLER, ZK_ADDR);
    controller.connect();

    boolean result =
        ClusterStateVerifier.verifyByZkCallback(new BestPossAndExtViewZkVerifier(ZK_ADDR,
            clusterName));
    Assert.assertTrue(result);
View Full Code Here

                m = HelixManagerFactory.getZKHelixManager(clusterName, id,
                        InstanceType.SPECTATOR, zkAddr);
                _managers.put(clusterName, m);
                if (!m.isConnected())
                {
                    m.connect();
                }
            }
            return m;
        }
View Full Code Here

    HelixManager participant =
        new ZKHelixManager(clusterName, "localhost_12918", InstanceType.PARTICIPANT, _zkaddr);
    participant.getStateMachineEngine().registerStateModelFactory(StateModelDefId.MasterSlave,
        new MockMSModelFactory());
    participant.connect();

    HelixManager controller =
        new ZKHelixManager(clusterName, "controller_0", InstanceType.CONTROLLER, _zkaddr);
    controller.connect();
View Full Code Here

        new MockMSModelFactory());
    participant.connect();

    HelixManager controller =
        new ZKHelixManager(clusterName, "controller_0", InstanceType.CONTROLLER, _zkaddr);
    controller.connect();

    boolean result =
        ClusterStateVerifier.verifyByZkCallback(new BestPossAndExtViewZkVerifier(_zkaddr,
            clusterName));
    Assert.assertTrue(result);
View Full Code Here

    // Registers and starts controller
    LOG.info("Starts controller");
    HelixManager controller =
        HelixManagerFactory.getZKHelixManager(clusterName, null, InstanceType.CONTROLLER, zkAddr);
    controller.connect();

    // Registers and starts participant
    LOG.info("Starts participant");
    String hostname = "localhost";
    String instanceId = String.format("%s_%d", hostname, 1);
View Full Code Here

    String instanceId = String.format("%s_%d", hostname, 1);
    clusterSetup.addInstanceToCluster(clusterName, instanceId);
    HelixManager participant =
        HelixManagerFactory.getZKHelixManager(clusterName, instanceId, InstanceType.PARTICIPANT,
            zkAddr);
    participant.connect();

    LOG.info("Register state machine");
    final CountDownLatch latch = new CountDownLatch(1);
    participant.getStateMachineEngine().registerStateModelFactory(
        StateModelDefId.OnlineOffline, "test", new StateTransitionHandlerFactory<TransitionHandler>() {
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.