Examples of onControllerChange()


Examples of org.apache.helix.manager.zk.DistributedLeaderElection.onControllerChange()

    List<HelixTimerTask> timerTasks = Collections.emptyList();
    DistributedLeaderElection election =
        new DistributedLeaderElection(manager, controller0, timerTasks);
    NotificationContext context = new NotificationContext(manager);
    context.setType(NotificationContext.Type.INIT);
    election.onControllerChange(context);

    // path = PropertyPathConfig.getPath(PropertyType.LEADER, clusterName);
    // ZNRecord leaderRecord = _gZkClient.<ZNRecord> readData(path);
    LiveInstance liveInstance = accessor.getProperty(keyBuilder.controllerLeader());
    AssertJUnit.assertEquals(controllerName, liveInstance.getInstanceName());
View Full Code Here

Examples of org.apache.helix.manager.zk.DistributedLeaderElection.onControllerChange()

        new MockZKHelixManager(clusterName, "controller_1", InstanceType.CONTROLLER, _gZkClient);
    GenericHelixController controller1 = new GenericHelixController();
    election = new DistributedLeaderElection(manager, controller1, timerTasks);
    context = new NotificationContext(manager);
    context.setType(NotificationContext.Type.INIT);
    election.onControllerChange(context);
    // leaderRecord = _gZkClient.<ZNRecord> readData(path);
    liveInstance = accessor.getProperty(keyBuilder.controllerLeader());
    AssertJUnit.assertEquals(controllerName, liveInstance.getInstanceName());
    // AssertJUnit.assertNull(election.getController());
    // AssertJUnit.assertNull(election.getLeader());
View Full Code Here

Examples of org.apache.helix.manager.zk.DistributedLeaderElection.onControllerChange()

    DistributedLeaderElection election =
        new DistributedLeaderElection(manager, controller0, timerTasks);
    NotificationContext context = new NotificationContext(manager);
    context.setType(NotificationContext.Type.CALLBACK);
    election.onControllerChange(context);

    LiveInstance liveInstance = accessor.getProperty(keyBuilder.controllerLeader());
    AssertJUnit.assertEquals(controllerName, liveInstance.getInstanceName());

    // path = PropertyPathConfig.getPath(PropertyType.LEADER, clusterName);
View Full Code Here

Examples of org.apache.helix.manager.zk.DistributedLeaderElection.onControllerChange()

            _gZkClient);
    GenericHelixController controller1 = new GenericHelixController();
    election = new DistributedLeaderElection(manager, controller1, timerTasks);
    context = new NotificationContext(manager);
    context.setType(NotificationContext.Type.CALLBACK);
    election.onControllerChange(context);

    liveInstance = accessor.getProperty(keyBuilder.controllerLeader());
    AssertJUnit.assertEquals(controllerName, liveInstance.getInstanceName());

    // leaderRecord = _gZkClient.<ZNRecord> readData(path);
View Full Code Here

Examples of org.apache.helix.manager.zk.DistributedLeaderElection.onControllerChange()

    DistributedLeaderElection election =
        new DistributedLeaderElection(manager, participant0, timerTasks);
    NotificationContext context = new NotificationContext(manager);
    context.setType(NotificationContext.Type.INIT);
    election.onControllerChange(context);

    path = PropertyPathConfig.getPath(PropertyType.LEADER, clusterName);
    ZNRecord leaderRecord = _gZkClient.<ZNRecord> readData(path, true);
    AssertJUnit.assertNull(leaderRecord);
    // AssertJUnit.assertNull(election.getController());
View Full Code Here

Examples of org.apache.helix.manager.zk.ZkHelixLeaderElection.onControllerChange()

    GenericHelixController pipeline = new GenericHelixController();

    ZkHelixLeaderElection leader = new ZkHelixLeaderElection(controller.getController(), pipeline);
    NotificationContext context = new NotificationContext(controller);
    context.setType(NotificationContext.Type.INIT);
    leader.onControllerChange(context);

    LiveInstance liveInstance = accessor.getProperty(keyBuilder.controllerLeader());
    AssertJUnit.assertEquals(controllerName, liveInstance.getInstanceName());

    // Start another controller, leader should remain unchanged
View Full Code Here

Examples of org.apache.helix.manager.zk.ZkHelixLeaderElection.onControllerChange()

    MockController controller1 = new MockController(_zkaddr, clusterName, controllerName1);
    GenericHelixController pipeline1 = new GenericHelixController();
    ZkHelixLeaderElection leader1 = new ZkHelixLeaderElection(controller1.getController(), pipeline1);
    NotificationContext context1 = new NotificationContext(controller1);
    context1.setType(NotificationContext.Type.INIT);
    leader1.onControllerChange(context1);
    liveInstance = accessor.getProperty(keyBuilder.controllerLeader());
    AssertJUnit.assertEquals(controllerName, liveInstance.getInstanceName());

    // clean up
    controller1.getConn().disconnect();
View Full Code Here

Examples of org.apache.helix.manager.zk.ZkHelixLeaderElection.onControllerChange()

    GenericHelixController pipeline = new GenericHelixController();

    ZkHelixLeaderElection leader = new ZkHelixLeaderElection(controller.getController(), pipeline);
    NotificationContext context = new NotificationContext(controller);
    context.setType(NotificationContext.Type.CALLBACK);
    leader.onControllerChange(context);

    LiveInstance liveInstance = accessor.getProperty(keyBuilder.controllerLeader());
    AssertJUnit.assertEquals(controllerName, liveInstance.getInstanceName());

    // Start another controller, leader should remain unchanged
View Full Code Here

Examples of org.apache.helix.manager.zk.ZkHelixLeaderElection.onControllerChange()

    GenericHelixController pipeline1 = new GenericHelixController();
    ZkHelixLeaderElection leader1 = new ZkHelixLeaderElection(controller.getController(), pipeline1);
    context = new NotificationContext(controller);
    context.setType(NotificationContext.Type.CALLBACK);
    leader1.onControllerChange(context);
    liveInstance = accessor.getProperty(keyBuilder.controllerLeader());
    AssertJUnit.assertEquals(controllerName, liveInstance.getInstanceName());

    // clean up
    controller1.getConn().disconnect();
View Full Code Here

Examples of org.apache.helix.participant.DistClusterControllerElection.onControllerChange()

                               _gZkClient);

    DistClusterControllerElection election = new DistClusterControllerElection(ZK_ADDR);
    NotificationContext context = new NotificationContext(manager);
    context.setType(NotificationContext.Type.INIT);
    election.onControllerChange(context);

//    path = PropertyPathConfig.getPath(PropertyType.LEADER, clusterName);
//    ZNRecord leaderRecord = _gZkClient.<ZNRecord> readData(path);
    LiveInstance liveInstance = accessor.getProperty(keyBuilder.controllerLeader());
    AssertJUnit.assertEquals(controllerName, liveInstance.getInstanceName());
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.