Search in sources :

Example 1 with MasterSlaveStateModelFactory

use of org.apache.helix.examples.MasterSlaveStateModelFactory in project helix by apache.

the class TestZkHelixAdmin method initializeHelixManager.

private HelixManager initializeHelixManager(String clusterName, String instanceName, String zkAddress, String stateModelName) {
    HelixManager manager = HelixManagerFactory.getZKHelixManager(clusterName, instanceName, InstanceType.PARTICIPANT, zkAddress);
    MasterSlaveStateModelFactory stateModelFactory = new MasterSlaveStateModelFactory(instanceName);
    StateMachineEngine stateMach = manager.getStateMachineEngine();
    stateMach.registerStateModelFactory(stateModelName, stateModelFactory);
    return manager;
}
Also used : HelixManager(org.apache.helix.HelixManager) StateMachineEngine(org.apache.helix.participant.StateMachineEngine) MasterSlaveStateModelFactory(org.apache.helix.examples.MasterSlaveStateModelFactory)

Aggregations

HelixManager (org.apache.helix.HelixManager)1 MasterSlaveStateModelFactory (org.apache.helix.examples.MasterSlaveStateModelFactory)1 StateMachineEngine (org.apache.helix.participant.StateMachineEngine)1