Examples of InstanceConfig


Examples of org.apache.helix.model.InstanceConfig

    Map<String, List<String>> tagInstanceLists = new TreeMap<String, List<String>>();

    for (String instanceName : instanceConfigsMap.keySet()) {
      boolean isAlive = liveInstancesMap.containsKey(instanceName);
      instanceConfigsMap.get(instanceName).getRecord().setSimpleField("Alive", isAlive + "");
      InstanceConfig config = instanceConfigsMap.get(instanceName);
      for (String tag : config.getTags()) {
        if (!tagInstanceLists.containsKey(tag)) {
          tagInstanceLists.put(tag, new LinkedList<String>());
        }
        if (!tagInstanceLists.get(tag).contains(instanceName)) {
          tagInstanceLists.get(tag).add(instanceName);
View Full Code Here

Examples of org.apache.helix.model.InstanceConfig

    // add 2 participants: "localhost:{12918, 12919}"
    int n = 2;
    for (int i = 0; i < n; i++) {
      int port = 12918 + i;
      InstanceConfig config = new InstanceConfig("localhost_" + port);
      config.setHostName("localhost");
      config.setPort(Integer.toString(port));
      config.setInstanceEnabled(true);
      admin.addInstance(clusterName, config);
    }

    // add ideal-state according to ideal-state-mode
    String resourceName = "TestDB";
View Full Code Here

Examples of org.apache.helix.model.InstanceConfig

   * @return
   */
  public Set<String> getDisabledInstancesForPartition(String partition) {
    Set<String> disabledInstancesSet = new HashSet<String>();
    for (String instance : _instanceConfigMap.keySet()) {
      InstanceConfig config = _instanceConfigMap.get(instance);
      if (config.getInstanceEnabled() == false
          || config.getInstanceEnabledForPartition(partition) == false) {
        disabledInstancesSet.add(instance);
      }
    }
    return disabledInstancesSet;
  }
View Full Code Here

Examples of org.apache.helix.model.InstanceConfig

    _gSetupTool.addCluster(clusterName, true);
    HelixAdmin admin = _gSetupTool.getClusterManagementTool();

    // Add 4 participants, each with differint tag characteristics
    InstanceConfig instance1 = new InstanceConfig("localhost_1");
    instance1.addTag(TAGS[0]);
    admin.addInstance(clusterName, instance1);
    InstanceConfig instance2 = new InstanceConfig("localhost_2");
    instance2.addTag(TAGS[1]);
    admin.addInstance(clusterName, instance2);
    InstanceConfig instance3 = new InstanceConfig("localhost_3");
    instance3.addTag(TAGS[0]);
    instance3.addTag(TAGS[1]);
    admin.addInstance(clusterName, instance3);
    InstanceConfig instance4 = new InstanceConfig("localhost_4");
    admin.addInstance(clusterName, instance4);

    // Now make a REST call for all resources
    Reference resourceRef = new Reference(URL_BASE);
    Request request = new Request(Method.GET, resourceRef);
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.