Search in sources :

Example 1 with MockSchemataModelFactory

use of org.apache.helix.mock.participant.MockSchemataModelFactory in project helix by apache.

the class MockParticipantManager method run.

@Override
public void run() {
    try {
        StateMachineEngine stateMach = getStateMachineEngine();
        stateMach.registerStateModelFactory(BuiltInStateModelDefinitions.MasterSlave.name(), _msModelFactory);
        stateMach.registerStateModelFactory(BuiltInStateModelDefinitions.LeaderStandby.name(), _lsModelFactory);
        stateMach.registerStateModelFactory(BuiltInStateModelDefinitions.OnlineOffline.name(), _ofModelFactory);
        MockSchemataModelFactory schemataFactory = new MockSchemataModelFactory();
        stateMach.registerStateModelFactory("STORAGE_DEFAULT_SM_SCHEMATA", schemataFactory);
        connect();
        _startCountDown.countDown();
        _stopCountDown.await();
    } catch (InterruptedException e) {
        String msg = "participant: " + getInstanceName() + ", " + Thread.currentThread().getName() + " is interrupted";
        LOG.info(msg);
    } catch (Exception e) {
        LOG.error("exception running participant-manager", e);
    } finally {
        _startCountDown.countDown();
        disconnect();
        _waitStopCompleteCountDown.countDown();
    }
}
Also used : StateMachineEngine(org.apache.helix.participant.StateMachineEngine) MockSchemataModelFactory(org.apache.helix.mock.participant.MockSchemataModelFactory)

Aggregations

MockSchemataModelFactory (org.apache.helix.mock.participant.MockSchemataModelFactory)1 StateMachineEngine (org.apache.helix.participant.StateMachineEngine)1