Package org.apache.helix.participant

Examples of org.apache.helix.participant.HelixStateMachineEngine


    _messagingService = new DefaultMessagingService(this);

    _version =
        new PropertiesReader("cluster-manager-version.properties").getProperty("clustermanager.version");

    _stateMachEngine = new HelixStateMachineEngine(this);

    // add all timer tasks
    _controllerTimerTasks = new ArrayList<HelixTimerTask>();
    if (_instanceType == InstanceType.CONTROLLER)
    {
View Full Code Here


    /**
     * instance type specific init
     */
    switch (instanceType) {
    case PARTICIPANT:
      _stateMachineEngine = new HelixStateMachineEngine(this);
      _participantHealthInfoCollector =
          new ParticipantHealthReportCollectorImpl(this, _instanceName);

      _timerTasks.add(new ParticipantHealthReportTask(_participantHealthInfoCollector));

      break;
    case CONTROLLER:
      _stateMachineEngine = null;
      _participantHealthInfoCollector = null;
      _controllerTimerTasks.add(new HealthStatsAggregationTask(new HealthStatsAggregator(this)));
      _controllerTimerTasks.add(new StatusDumpTask(_zkclient, this));

      break;
    case CONTROLLER_PARTICIPANT:
      _stateMachineEngine = new HelixStateMachineEngine(this);
      _participantHealthInfoCollector =
          new ParticipantHealthReportCollectorImpl(this, _instanceName);

      _timerTasks.add(new ParticipantHealthReportTask(_participantHealthInfoCollector));

View Full Code Here

    /**
     * instance type specific init
     */
    switch (instanceType) {
    case PARTICIPANT:
      _stateMachineEngine = new HelixStateMachineEngine(this);
      _participantHealthInfoCollector =
          new ParticipantHealthReportCollectorImpl(this, _instanceName);

      _timerTasks.add(new ParticipantHealthReportTask(_participantHealthInfoCollector));

      break;
    case CONTROLLER:
      _stateMachineEngine = null;
      _participantHealthInfoCollector = null;
      _controllerTimerTasks.add(new HealthStatsAggregationTask(new HealthStatsAggregator(this)));
      _controllerTimerTasks.add(new StatusDumpTask(_zkclient, this));

      break;
    case CONTROLLER_PARTICIPANT:
      _stateMachineEngine = new HelixStateMachineEngine(this);
      _participantHealthInfoCollector =
          new ParticipantHealthReportCollectorImpl(this, _instanceName);

      _timerTasks.add(new ParticipantHealthReportTask(_participantHealthInfoCollector));

View Full Code Here

        ClusterStateVerifier.verifyByZkCallback(new BestPossAndExtViewZkVerifier(ZK_ADDR,
            clusterName));
    Assert.assertTrue(result);

    // check state-models in state-machine
    HelixStateMachineEngine stateMachine =
        (HelixStateMachineEngine) participants[0].getStateMachineEngine();
    StateModelFactory<? extends StateModel> fty = stateMachine.getStateModelFactory("MasterSlave");
    Map<String, String> expectStateModelMap = new TreeMap<String, String>();
    expectStateModelMap.put("TestDB0_0", "SLAVE");
    expectStateModelMap.put("TestDB0_1", "MASTER");
    expectStateModelMap.put("TestDB0_2", "SLAVE");
    expectStateModelMap.put("TestDB0_3", "MASTER");
View Full Code Here

        ClusterStateVerifier.verifyByZkCallback(new BestPossAndExtViewZkVerifier(ZK_ADDR,
            clusterName, errStates));
    Assert.assertTrue(result);

    // check state-models in state-machine
    HelixStateMachineEngine stateMachine =
        (HelixStateMachineEngine) participants[0].getStateMachineEngine();
    StateModelFactory<? extends StateModel> fty = stateMachine.getStateModelFactory("MasterSlave");
    Map<String, String> expectStateModelMap = new TreeMap<String, String>();
    expectStateModelMap.put("TestDB0_0", "ERROR");
    expectStateModelMap.put("TestDB0_1", "MASTER");
    expectStateModelMap.put("TestDB0_2", "SLAVE");
    expectStateModelMap.put("TestDB0_3", "MASTER");
View Full Code Here

    _clusterId = clusterId;
    _participantId = participantId;

    _messagingService = (DefaultMessagingService) connection.createMessagingService(this);
    HelixManager manager = new ZKHelixManager(this);
    _stateMachineEngine = new HelixStateMachineEngine(manager);
    _preConnectCallbacks = new ArrayList<PreConnectCallback>();
    _timerTasks = new ArrayList<HelixTimerTask>();

  }
View Full Code Here

        ClusterStateVerifier.verifyByZkCallback(new BestPossAndExtViewZkVerifier(_zkaddr,
            clusterName));
    Assert.assertTrue(result);

    // check state-models in state-machine
    HelixStateMachineEngine stateMachine =
        (HelixStateMachineEngine) participants[0].getStateMachineEngine();
    StateTransitionHandlerFactory<? extends TransitionHandler> fty =
        stateMachine.getStateModelFactory(StateModelDefId.from("MasterSlave"));
    Map<PartitionId, String> expectStateModelMap = new TreeMap<PartitionId, String>();
    expectStateModelMap.put(PartitionId.from("TestDB0_0"), "SLAVE");
    expectStateModelMap.put(PartitionId.from("TestDB0_1"), "MASTER");
    expectStateModelMap.put(PartitionId.from("TestDB0_2"), "SLAVE");
    expectStateModelMap.put(PartitionId.from("TestDB0_3"), "MASTER");
View Full Code Here

        ClusterStateVerifier.verifyByZkCallback(new BestPossAndExtViewZkVerifier(_zkaddr,
            clusterName, errStates));
    Assert.assertTrue(result);

    // check state-models in state-machine
    HelixStateMachineEngine stateMachine =
        (HelixStateMachineEngine) participants[0].getStateMachineEngine();
    StateTransitionHandlerFactory<? extends TransitionHandler> fty =
        stateMachine.getStateModelFactory(StateModelDefId.from("MasterSlave"));
    Map<PartitionId, String> expectStateModelMap = new TreeMap<PartitionId, String>();
    expectStateModelMap.put(PartitionId.from("TestDB0_0"), "ERROR");
    expectStateModelMap.put(PartitionId.from("TestDB0_1"), "MASTER");
    expectStateModelMap.put(PartitionId.from("TestDB0_2"), "SLAVE");
    expectStateModelMap.put(PartitionId.from("TestDB0_3"), "MASTER");
View Full Code Here

    _clusterId = clusterId;
    _participantId = participantId;

    _messagingService = (DefaultMessagingService) connection.createMessagingService(this);
    HelixManager manager = new HelixConnectionAdaptor(this);
    _stateMachineEngine = new HelixStateMachineEngine(manager);
    _preConnectCallbacks = new ArrayList<PreConnectCallback>();
    _timerTasks = new ArrayList<HelixTimerTask>();
    _participantHealthInfoCollector =
        new ParticipantHealthReportCollectorImpl(manager, participantId.stringify());
View Full Code Here

    /**
     * instance type specific init
     */
    switch (instanceType) {
    case PARTICIPANT:
      _stateMachineEngine = new HelixStateMachineEngine(this);
      _participantHealthInfoCollector =
          new ParticipantHealthReportCollectorImpl(this, _instanceName);

      _timerTasks.add(new ParticipantHealthReportTask(_participantHealthInfoCollector));

      break;
    case CONTROLLER:
      _stateMachineEngine = null;
      _participantHealthInfoCollector = null;
      _controllerTimerTasks.add(new HealthStatsAggregationTask(new HealthStatsAggregator(this)));
      _controllerTimerTasks.add(new StatusDumpTask(_zkclient, this));

      break;
    case CONTROLLER_PARTICIPANT:
      _stateMachineEngine = new HelixStateMachineEngine(this);
      _participantHealthInfoCollector =
          new ParticipantHealthReportCollectorImpl(this, _instanceName);

      _timerTasks.add(new ParticipantHealthReportTask(_participantHealthInfoCollector));

View Full Code Here

TOP

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

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.