Package org.apache.helix.participant

Examples of org.apache.helix.participant.StateMachineEngine


        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 {
        logger.error("cluster controller mode:" + controllerMode + " NOT supported");
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

        Field sessionTimeout = ZKHelixManager.class.getDeclaredField("_sessionTimeout");
        sessionTimeout.setAccessible(true);
        sessionTimeout.setInt(helixManager, 1000);
      }

      StateMachineEngine stateMach = helixManager.getStateMachineEngine();
      stateMach.registerStateModelFactory("MasterSlave", new MyStateModelFactory(helixManager));
      helixManager.connect();

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

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

      participants[i] = new MockParticipantManager(ZK_ADDR, clusterName, instanceName);

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

      participants[i].syncStart();
    }

    boolean result =
View Full Code Here

    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 = 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);

      connect();
      _startCountDown.countDown();

      _stopCountDown.await();
View Full Code Here

  }

  @Override
  public void run() {
    try {
      StateMachineEngine stateMach = getStateMachineEngine();
      DistClusterControllerStateModelFactory lsModelFactory =
          new DistClusterControllerStateModelFactory(_zkAddress);
      stateMach.registerStateModelFactory("LeaderStandby", lsModelFactory);

      connect();
      _startCountDown.countDown();
      _stopCountDown.await();
    } catch (Exception e) {
View Full Code Here

            registerNotifier();
        }

        void registerNotifier()
        {
            StateMachineEngine stateMach = _manager.getStateMachineEngine();
            DatabusClusterNotifierFactory modelFactory = new DatabusClusterNotifierFactory(
                    _notifier);
            stateMach.registerStateModelFactory(DEFAULT_STATE_MODEL,
                    modelFactory);
        }
View Full Code Here

    for (int i = 0; i < n; i++) {
      String instanceName = "localhost_" + (START_PORT + i);
      _participants[i] = new MockParticipant(_zkaddr, CLUSTER_NAME, instanceName);

      // Register a Task state model factory.
      StateMachineEngine stateMachine = _participants[i].getStateMachineEngine();
      stateMachine.registerStateModelFactory(StateModelDefId.from("Task"),
          new TaskStateModelFactory(_participants[i], taskFactoryReg));

      _participants[i].syncStart();
    }
View Full Code Here

    for (int i = 0; i < n; i++) {
      String instanceName = "localhost_" + (START_PORT + i);
      _participants[i] = new MockParticipant(_zkaddr, CLUSTER_NAME, instanceName);

      // Register a Task state model factory.
      StateMachineEngine stateMachine = _participants[i].getStateMachineEngine();
      stateMachine.registerStateModelFactory(StateModelDefId.from("Task"),
          new TaskStateModelFactory(_participants[i], taskFactoryReg));
      _participants[i].syncStart();
    }

    // start controller
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.