Package com.linkedin.helix.tools

Examples of com.linkedin.helix.tools.StateModelConfigGenerator


    // setup test cluster
    _mgmtTool = new FileHelixAdmin(_fileStore);
    _mgmtTool.addCluster(CLUSTER_NAME, true);
   
    StateModelConfigGenerator generator = new StateModelConfigGenerator();
    _mgmtTool.addStateModelDef(CLUSTER_NAME, "LeaderStandby",
                     new StateModelDefinition(generator.generateConfigForLeaderStandby()));

    _mgmtTool.addStateModelDef(CLUSTER_NAME,
                               "OnlineOffline",
                               new StateModelDefinition(generator.generateConfigForOnlineOffline()));
    _mgmtTool.addResource(CLUSTER_NAME, TEST_DB, 10, STATE_MODEL);
    for (int i = 0; i < NODE_NR; i++)
    {
      addNodeToCluster(CLUSTER_NAME, "localhost", START_PORT + i);
    }
View Full Code Here


      _store.createPropertyNamespace(HelixUtil.getLiveInstancesPath(clusterName));
      _store.createPropertyNamespace(HelixUtil.getMemberInstancesPath(clusterName));
      _store.createPropertyNamespace(HelixUtil.getExternalViewPath(clusterName));
      _store.createPropertyNamespace(HelixUtil.getStateModelDefinitionPath(clusterName));

      StateModelConfigGenerator generator = new StateModelConfigGenerator();
      addStateModelDef(clusterName,
                       "MasterSlave",
                       new StateModelDefinition(generator.generateConfigForMasterSlave()));

      // controller
      _store.createPropertyNamespace(HelixUtil.getControllerPath(clusterName));
      path = PropertyPathConfig.getPath(PropertyType.HISTORY, clusterName);
      final ZNRecord emptyHistory = new ZNRecord(PropertyType.HISTORY.toString());
View Full Code Here

  {
    ZKHelixDataAccessor accessor =
        new ZKHelixDataAccessor(clusterName, new ZkBaseDataAccessor(_gZkClient));
    Builder keyBuilder = accessor.keyBuilder();

    StateModelConfigGenerator generator = new StateModelConfigGenerator();
    StateModelDefinition masterSlave =
        new StateModelDefinition(generator.generateConfigForMasterSlave());
    accessor.setProperty(keyBuilder.stateModelDef(masterSlave.getId()), masterSlave);

    StateModelDefinition leaderStandby =
        new StateModelDefinition(generator.generateConfigForLeaderStandby());
    accessor.setProperty(keyBuilder.stateModelDef(leaderStandby.getId()), leaderStandby);

    StateModelDefinition onlineOffline =
        new StateModelDefinition(generator.generateConfigForOnlineOffline());
    accessor.setProperty(keyBuilder.stateModelDef(onlineOffline.getId()), onlineOffline);

  }
View Full Code Here

    stage.postProcess();
  }

  protected void setupStateModel()
  {
    ZNRecord masterSlave = new StateModelConfigGenerator()
        .generateConfigForMasterSlave();
   
    Builder keyBuilder = accessor.keyBuilder();
    accessor.setProperty(keyBuilder.stateModelDef(masterSlave.getId()), new StateModelDefinition(masterSlave));
   
    ZNRecord leaderStandby = new StateModelConfigGenerator()
        .generateConfigForLeaderStandby();
    accessor.setProperty(keyBuilder.stateModelDef(leaderStandby.getId()), new StateModelDefinition(leaderStandby));

    ZNRecord onlineOffline = new StateModelConfigGenerator()
        .generateConfigForOnlineOffline();
    accessor.setProperty(keyBuilder.stateModelDef(onlineOffline.getId()), new StateModelDefinition(onlineOffline));
  }
View Full Code Here

                     new ZNRecordSerializer());
    ZKHelixAdmin admin = new ZKHelixAdmin(zkclient);
    admin.addCluster(clusterName, true);

    // add MasterSlave state mode definition
    StateModelConfigGenerator generator = new StateModelConfigGenerator();
    admin.addStateModelDef(clusterName,
                           "MasterSlave",
                           new StateModelDefinition(generator.generateConfigForMasterSlave()));

    // add 3 participants: "localhost:{12918, 12919, 12920}"
    for (int i = 0; i < 3; i++)
    {
      int port = 12918 + i;
View Full Code Here

                     new ZNRecordSerializer());
    ZKHelixAdmin admin = new ZKHelixAdmin(zkclient);
    admin.addCluster(clusterName, true);

    // add MasterSlave state mode definition
    StateModelConfigGenerator generator = new StateModelConfigGenerator();
    admin.addStateModelDef(clusterName,
                           "MasterSlave",
                           new StateModelDefinition(generator.generateConfigForMasterSlave()));

    // add 3 participants: "localhost:{12918, 12919, 12920}"
    for (int i = 0; i < 3; i++)
    {
      int port = 12918 + i;
View Full Code Here

    MockStateModel stateModel = new MockStateModel();
    NotificationContext context;
    MockManager manager = new MockManager("clusterName");
//    DataAccessor accessor = manager.getDataAccessor();
    HelixDataAccessor accessor = manager.getHelixDataAccessor();
    StateModelConfigGenerator generator = new StateModelConfigGenerator();
    StateModelDefinition stateModelDef = new StateModelDefinition(
        generator.generateConfigForMasterSlave());
    Builder keyBuilder = accessor.keyBuilder();
    accessor.setProperty(keyBuilder.stateModelDef("MasterSlave"), stateModelDef);

    context = new NotificationContext(manager);
    CurrentState currentStateDelta = new CurrentState("TestDB");
View Full Code Here

    MockManager manager = new MockManager("clusterName");
//    DataAccessor accessor = manager.getDataAccessor();
    HelixDataAccessor accessor = manager.getHelixDataAccessor();

    StateModelConfigGenerator generator = new StateModelConfigGenerator();
    StateModelDefinition stateModelDef = new StateModelDefinition(
        generator.generateConfigForMasterSlave());
//    accessor.setProperty(PropertyType.STATEMODELDEFS, stateModelDef, "MasterSlave");
    Builder keyBuilder = accessor.keyBuilder();
    accessor.setProperty(keyBuilder.stateModelDef("MasterSlave"), stateModelDef);

View Full Code Here

    message.setStateModelDef("MasterSlave");

    MockManager manager = new MockManager("clusterName");
    // DataAccessor accessor = manager.getDataAccessor();
    HelixDataAccessor accessor = manager.getHelixDataAccessor();
    StateModelConfigGenerator generator = new StateModelConfigGenerator();
    StateModelDefinition stateModelDef =
        new StateModelDefinition(generator.generateConfigForMasterSlave());
    Builder keyBuilder = accessor.keyBuilder();
    accessor.setProperty(keyBuilder.stateModelDef("MasterSlave"), stateModelDef);

    MockHelixTaskExecutor executor = new MockHelixTaskExecutor();
    MockStateModel stateModel = new MockStateModel();
View Full Code Here

      // add cluster
      admin.addCluster(clusterName, true);

      // add state model definition
      StateModelConfigGenerator generator = new StateModelConfigGenerator();
      admin.addStateModelDef(clusterName, DEFAULT_STATE_MODEL,
          new StateModelDefinition(generator.generateConfigForOnlineOffline()));

      // add resource "topic" which has 6 partitions
      String resourceName = DEFAULT_RESOURCE_NAME;
      admin.addResource(clusterName, resourceName, DEFAULT_PARTITION_NUMBER, DEFAULT_STATE_MODEL,
          IdealStateModeProperty.AUTO_REBALANCE.toString());
View Full Code Here

TOP

Related Classes of com.linkedin.helix.tools.StateModelConfigGenerator

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.