Package org.apache.helix.participant

Examples of org.apache.helix.participant.StateMachineEngine


    try
    {
      manager = HelixManagerFactory.getZKHelixManager(clusterName, instanceName,
          InstanceType.PARTICIPANT, zkAddr);

      StateMachineEngine stateMach = manager.getStateMachineEngine();
      DummyMSModelFactory msModelFactory = new DummyMSModelFactory();
      stateMach.registerStateModelFactory("MasterSlave", msModelFactory);

      manager.connect();

      Thread.currentThread().join();
    } catch (Exception e)
View Full Code Here


          instanceName, InstanceType.PARTICIPANT, ZK_ADDRESS);

      MasterSlaveStateModelFactory stateModelFactory = new MasterSlaveStateModelFactory(
          instanceName);

      StateMachineEngine stateMach = manager.getStateMachineEngine();
      stateMach.registerStateModelFactory(STATE_MODEL_NAME, stateModelFactory);
      manager.connect();
    }
View Full Code Here

    try
    {
      DummyStateModelFactory stateModelFactory = new DummyStateModelFactory(0);
//      StateMachineEngine genericStateMachineHandler =
//          new StateMachineEngine();
      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.getMessagingService()
//              .registerMessageHandlerFactory(MessageType.STATE_TRANSITION.toString(),
//                                             genericStateMachineHandler);

      _manager.connect();
View Full Code Here

        DistClusterControllerStateModelFactory stateModelFactory = new DistClusterControllerStateModelFactory(
            zkConnectString);

        // StateMachineEngine genericStateMachineHandler = new
        // StateMachineEngine();
        StateMachineEngine stateMach = manager.getStateMachineEngine();
        stateMach.registerStateModelFactory("LeaderStandby", stateModelFactory);
        // manager.getMessagingService().registerMessageHandlerFactory(MessageType.STATE_TRANSITION.toString(),
        // genericStateMachineHandler);
        manager.connect();
      } else
      {
View Full Code Here

    }
    // genericStateMachineHandler = new StateMachineEngine();
    // genericStateMachineHandler.registerStateModelFactory(stateModelType,
    // stateModelFactory);

    StateMachineEngine stateMach = manager.getStateMachineEngine();
    stateMach.registerStateModelFactory(stateModelType, stateModelFactory);
    manager.connect();
    manager.getMessagingService().registerMessageHandlerFactory(
        MessageType.STATE_TRANSITION.toString(), stateMach);
  }
View Full Code Here

          HelixManagerFactory.getZKHelixManager(_clusterName,
                                                _serverId,
                                                InstanceType.PARTICIPANT,
                                                _zkAddr);

      StateMachineEngine stateMach = _manager.getStateMachineEngine();
      FileStoreStateModelFactory modelFactory =
          new FileStoreStateModelFactory(_manager);
      stateMach.registerStateModelFactory(SetupCluster.DEFAULT_STATE_MODEL, modelFactory);
      _manager.connect();
//      _manager.addExternalViewChangeListener(replicator);
      Thread.currentThread().join();
    }
    catch (InterruptedException e)
View Full Code Here

   
    stateModelFactory = new BootstrapHandler();
//    genericStateMachineHandler = new StateMachineEngine();
//    genericStateMachineHandler.registerStateModelFactory("MasterSlave", stateModelFactory);
   
    StateMachineEngine stateMach = manager.getStateMachineEngine();
    stateMach.registerStateModelFactory("MasterSlave", stateModelFactory);
   
    manager.getMessagingService().registerMessageHandlerFactory(
        MessageType.STATE_TRANSITION.toString(), stateMach);
    manager.getMessagingService().registerMessageHandlerFactory(
        MessageType.USER_DEFINE_MSG.toString(),
View Full Code Here

    stateModelFactory = new DummyStateModelFactory(_transDelayInMs);
    DummyLeaderStandbyStateModelFactory stateModelFactory1 = new DummyLeaderStandbyStateModelFactory(_transDelayInMs);
    DummyOnlineOfflineStateModelFactory stateModelFactory2 = new DummyOnlineOfflineStateModelFactory(_transDelayInMs);
//    genericStateMachineHandler = new StateMachineEngine();
    StateMachineEngine stateMach = manager.getStateMachineEngine();
    stateMach.registerStateModelFactory("MasterSlave", stateModelFactory);
    stateMach.registerStateModelFactory("LeaderStandby", stateModelFactory1);
    stateMach.registerStateModelFactory("OnlineOffline", stateModelFactory2);

    manager.connect();
//    manager.getMessagingService().registerMessageHandlerFactory(MessageType.STATE_TRANSITION.toString(), genericStateMachineHandler);
    return manager;
  }
View Full Code Here

  @Override
  public void run()
  {
    try
    {
      StateMachineEngine stateMach = _manager.getStateMachineEngine();
      stateMach.registerStateModelFactory("MasterSlave", _msModelFactory);

      DummyLeaderStandbyStateModelFactory lsModelFactory =
          new DummyLeaderStandbyStateModelFactory(10);
      DummyOnlineOfflineStateModelFactory ofModelFactory =
          new DummyOnlineOfflineStateModelFactory(10);
      stateMach.registerStateModelFactory("LeaderStandby", lsModelFactory);
      stateMach.registerStateModelFactory("OnlineOffline", ofModelFactory);

      MockSchemataModelFactory schemataFactory = new MockSchemataModelFactory();
      stateMach.registerStateModelFactory("STORAGE_DEFAULT_SM_SCHEMATA", schemataFactory);
      // MockBootstrapModelFactory bootstrapFactory = new MockBootstrapModelFactory();
      // stateMach.registerStateModelFactory("Bootstrap", bootstrapFactory);

      if (_job != null)
      {
View Full Code Here

        else if (_controllerMode.equals(HelixControllerMain.DISTRIBUTED.toString()))
        {
          DistClusterControllerStateModelFactory stateModelFactory =
              new DistClusterControllerStateModelFactory(_zkAddr);

          StateMachineEngine stateMach = _manager.getStateMachineEngine();
          stateMach.registerStateModelFactory("LeaderStandby", stateModelFactory);
          _manager.connect();
        }
      }
      catch (Exception e)
      {
View Full Code Here

TOP

Related Classes of org.apache.helix.participant.StateMachineEngine

Copyright © 2018 www.massapicom. 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.