Search in sources :

Example 1 with DummyLeaderStandbyStateModelFactory

use of org.apache.helix.mock.participant.DummyProcess.DummyLeaderStandbyStateModelFactory in project helix by apache.

the class DummyProcessThread method run.

@Override
public void run() {
    try {
        DummyStateModelFactory stateModelFactory = new DummyStateModelFactory(0);
        StateMachineEngine stateMach = _manager.getStateMachineEngine();
        stateMach.registerStateModelFactory("MasterSlave", stateModelFactory);
        DummyLeaderStandbyStateModelFactory stateModelFactory1 = new DummyLeaderStandbyStateModelFactory(10);
        DummyOnlineOfflineStateModelFactory stateModelFactory2 = new DummyOnlineOfflineStateModelFactory(10);
        stateMach.registerStateModelFactory("LeaderStandby", stateModelFactory1);
        stateMach.registerStateModelFactory("OnlineOffline", stateModelFactory2);
        _manager.connect();
        Thread.currentThread().join();
    } catch (InterruptedException e) {
        String msg = "participant:" + _instanceName + ", " + Thread.currentThread().getName() + " interrupted";
        LOG.info(msg);
    } catch (Exception e) {
        e.printStackTrace();
    }
}
Also used : StateMachineEngine(org.apache.helix.participant.StateMachineEngine) DummyOnlineOfflineStateModelFactory(org.apache.helix.mock.participant.DummyProcess.DummyOnlineOfflineStateModelFactory) DummyStateModelFactory(org.apache.helix.mock.participant.DummyProcess.DummyStateModelFactory) DummyLeaderStandbyStateModelFactory(org.apache.helix.mock.participant.DummyProcess.DummyLeaderStandbyStateModelFactory)

Aggregations

DummyLeaderStandbyStateModelFactory (org.apache.helix.mock.participant.DummyProcess.DummyLeaderStandbyStateModelFactory)1 DummyOnlineOfflineStateModelFactory (org.apache.helix.mock.participant.DummyProcess.DummyOnlineOfflineStateModelFactory)1 DummyStateModelFactory (org.apache.helix.mock.participant.DummyProcess.DummyStateModelFactory)1 StateMachineEngine (org.apache.helix.participant.StateMachineEngine)1