Examples of StateMachineEngine


Examples of org.apache.helix.participant.StateMachineEngine

        HelixManagerFactory.getZKHelixManager(clusterName, instanceName, InstanceType.PARTICIPANT,
            zkConnectString);

    stateModelFactory = new BootstrapHandler();

    StateMachineEngine stateMach = manager.getStateMachineEngine();
    stateMach.registerStateModelFactory(StateModelDefId.MasterSlave, stateModelFactory);

    manager.getMessagingService().registerMessageHandlerFactory(
        MessageType.STATE_TRANSITION.toString(), stateMach);
    manager.getMessagingService().registerMessageHandlerFactory(
        MessageType.USER_DEFINE_MSG.toString(), new CustomMessageHandlerFactory());
View Full Code Here

Examples of org.apache.helix.participant.StateMachineEngine

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

    manager.connect();
    return manager;
  }
View Full Code Here

Examples of org.apache.helix.participant.StateMachineEngine

        Field sessionTimeout = ZkHelixConnection.class.getDeclaredField("_sessionTimeout");
        sessionTimeout.setAccessible(true);
        sessionTimeout.setInt(participant.getConn(), 1000);
      }

      StateMachineEngine stateMach = participant.getStateMachineEngine();
      stateMach.registerStateModelFactory(StateModelDefId.MasterSlave, new MyStateModelFactory(participant));
      participant.connect();

      StatusPrinter statusPrinter = new StatusPrinter();
      statusPrinter.registerWith(participant);
    }
View Full Code Here

Examples of org.apache.helix.participant.StateMachineEngine

    return _role.getConnection().getHelixProperties();
  }

  @Override
  public StateMachineEngine getStateMachineEngine() {
    StateMachineEngine engine = null;
    switch (_role.getType()) {
    case PARTICIPANT: {
      HelixParticipant participant = (HelixParticipant) _role;
      engine = participant.getStateMachineEngine();
      break;
View Full Code Here

Examples of org.apache.helix.participant.StateMachineEngine

      String instanceName = "localhost_" + (12918 + i);

      participants[i] = new MockParticipant(_zkaddr, clusterName, instanceName);

      // add a state model with non-OFFLINE initial state
      StateMachineEngine stateMach = participants[i].getStateMachineEngine();
      MockBootstrapModelFactory bootstrapFactory = new MockBootstrapModelFactory();
      stateMach.registerStateModelFactory(StateModelDefId.from("Bootstrap"), bootstrapFactory);

      participants[i].syncStart();
    }

    boolean result =
View Full Code Here

Examples of org.apache.helix.participant.StateMachineEngine

              InstanceType.PARTICIPANT, ZK_ADDRESS);

      MasterSlaveStateModelFactory stateModelFactory =
          new MasterSlaveStateModelFactory(instanceName);

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

Examples of org.apache.helix.participant.StateMachineEngine

    try {
      _manager =
          HelixManagerFactory.getZKHelixManager(_clusterName, _instanceName,
              InstanceType.PARTICIPANT, _zkAddr);

      StateMachineEngine stateMach = _manager.getStateMachineEngine();
      TaskStateModelFactory modelFactory =
          new TaskStateModelFactory(_instanceName, _taskFactory, _taskResultStore);
      stateMach.registerStateModelFactory(StateModelDefId.from(TaskCluster.DEFAULT_STATE_MODEL),
          modelFactory);

      _manager.connect();

      Thread.currentThread().join();
View Full Code Here

Examples of org.apache.helix.participant.StateMachineEngine

    String stateModelName = cmd.getOptionValue(stateModel);

    HelixManager manager =
        new ZKHelixManager(clusterName, instance, InstanceType.PARTICIPANT, zkAddress);

    StateMachineEngine stateMach = manager.getStateMachineEngine();
    stateMach.registerStateModelFactory(StateModelDefId.from(stateModelName),
        new AgentStateModelFactory());

    Runtime.getRuntime().addShutdownHook(new HelixAgentShutdownHook(manager));

    try {
View Full Code Here

Examples of org.apache.helix.participant.StateMachineEngine

    }
    // 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

Examples of org.apache.helix.participant.StateMachineEngine

    try {
      _manager =
          HelixManagerFactory.getZKHelixManager(_clusterName, _consumerId,
              InstanceType.PARTICIPANT, _zkAddr);

      StateMachineEngine stateMach = _manager.getStateMachineEngine();
      ConsumerStateModelFactory modelFactory =
          new ConsumerStateModelFactory(_consumerId, _mqServer);
      stateMach.registerStateModelFactory(
          StateModelDefId.from(SetupConsumerCluster.DEFAULT_STATE_MODEL), modelFactory);

      _manager.connect();

      Thread.currentThread().join();
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.