Examples of ConfigScopeBuilder


Examples of com.linkedin.helix.ConfigScopeBuilder

    String instanceName = PARTICIPANT_PREFIX + "_" + (START_PORT + 0);
    HelixManager manager = _startCMResultMap.get(instanceName)._manager;
   
    ConfigAccessor accessor = manager.getConfigAccessor();
    ConfigScope scope =
        new ConfigScopeBuilder().forCluster(manager.getClusterName()).forParticipant(instanceName).build();
    accessor.set(scope, "TestMsg."+ HelixTaskExecutor.MAX_THREADS, ""+12);
   
    scope =
        new ConfigScopeBuilder().forCluster(manager.getClusterName()).build();
    accessor.set(scope, "TestMsg."+ HelixTaskExecutor.MAX_THREADS, ""+8);
   
    for (int i = 0; i < NODE_NR; i++)
    {
      instanceName = PARTICIPANT_PREFIX + "_" + (START_PORT + i);
View Full Code Here

Examples of com.linkedin.helix.ConfigScopeBuilder

   * @param properitesStr
   *          : key=value, ... which represents a Map<String, String>
   */
  public void setConfig(String scopesStr, String propertiesStr)
  {
    ConfigScope scope = new ConfigScopeBuilder().build(scopesStr);

    // parse properties
    String[] properties = propertiesStr.split("[\\s,]");
    Map<String, String> propertiesMap = new TreeMap<String, String>();
    for (String property : properties)
View Full Code Here

Examples of com.linkedin.helix.ConfigScopeBuilder

    _admin.setConfig(scope, propertiesMap);
  }

  public void removeConfig(String scopesStr, String keysStr)
  {
    ConfigScope scope = new ConfigScopeBuilder().build(scopesStr);

    // parse keys
    String[] keys = keysStr.split("[\\s,]");
    Set<String> keysSet = new HashSet<String>(Arrays.asList(keys));
View Full Code Here

Examples of com.linkedin.helix.ConfigScopeBuilder

    _admin.removeConfig(scope, keysSet);
  }

  public String getConfig(String scopesStr, String keysStr)
  {
    ConfigScope scope = new ConfigScopeBuilder().build(scopesStr);

    // parse keys
    String[] keys = keysStr.split("[\\s,]");
    Set<String> keysSet = new HashSet<String>(Arrays.asList(keys));
View Full Code Here

Examples of com.linkedin.helix.ConfigScopeBuilder

  {
    String instanceName = PARTICIPANT_PREFIX + "_" + (START_PORT + 0);
    HelixManager manager = _startCMResultMap.get(instanceName)._manager;
    ConfigAccessor accessor = manager.getConfigAccessor();
    ConfigScope scope =
        new ConfigScopeBuilder().forCluster(manager.getClusterName()).forResource("NextDB").build();
    accessor.set(scope, HelixTaskExecutor.MAX_THREADS, ""+12);
   
    _setupTool.addResourceToCluster(CLUSTER_NAME, "NextDB", 64, STATE_MODEL);
    _setupTool.rebalanceStorageCluster(CLUSTER_NAME, "NextDB", 3);
   
View Full Code Here

Examples of com.linkedin.helix.ConfigScopeBuilder

    manager.startTimerTasks();
   
    _setupTool.getClusterManagementTool().addAlert(CLUSTER_NAME, _alertStr1);
    _setupTool.getClusterManagementTool().addAlert(CLUSTER_NAME, _alertStr2);
   
    ConfigScope scope = new ConfigScopeBuilder().forCluster(CLUSTER_NAME).build();
    Map<String, String> properties = new HashMap<String, String>();
    properties.put("healthChange.enabled", "false");
    _setupTool.getClusterManagementTool().setConfig(scope, properties);
   
    HealthStatsAggregationTask task = new HealthStatsAggregationTask(_startCMResultMap.get(controllerName)._manager);
View Full Code Here

Examples of com.linkedin.helix.ConfigScopeBuilder

      int threadpoolSize = -1;
      ConfigAccessor configAccessor = manager.getConfigAccessor();
      if (configAccessor != null)
      {
        ConfigScope scope =
            new ConfigScopeBuilder().forCluster(manager.getClusterName())
                                    .forResource(resourceName)
                                    .build();

        String threadpoolSizeStr = configAccessor.get(scope, MAX_THREADS);
        try
View Full Code Here

Examples of com.linkedin.helix.ConfigScopeBuilder

    return newLeader;
  }

  protected void enableHealthCheck(String clusterName)
  {
    ConfigScope scope = new ConfigScopeBuilder().forCluster(clusterName).build();
    new ConfigAccessor(_gZkClient).set(scope, "healthChange" + ".enabled", "" + true);
  }
View Full Code Here

Examples of org.apache.helix.ConfigScopeBuilder

    boolean enabled = true;
    if (configAccessor != null)
    {
      // zk-based cluster manager
      ConfigScope scope =
          new ConfigScopeBuilder().forCluster(_manager.getClusterName()).build();
      String isEnabled = configAccessor.get(scope, "healthChange.enabled");
      if (isEnabled != null)
      {
        enabled = new Boolean(isEnabled);
      }
View Full Code Here

Examples of org.apache.helix.ConfigScopeBuilder

          // path is "/clusters/{clusterName}/configs/cluster|particicpant|resource/
          // {clusterName}|{participantName}|{resourceName}"
          ConfigScope scope;
          if (scopeProperty == ConfigScopeProperty.CLUSTER)
          {
            scope = new ConfigScopeBuilder().build(scopeProperty, clusterName);
          }
          else
          {
            scope = new ConfigScopeBuilder().build(scopeProperty, clusterName, scopeKey1);
          }
          representation = getConfigs(scope, scopeProperty, scopeKey1);
        }
        break;
      case PARTITION:
        scopeKey1 = getValue("scopeKey1");
        String scopeKey2 = getValue("scopeKey2");
        if (scopeKey1 == null)
        {
          // path is "/clusters/{clusterName}/configs/partition"
          throw new HelixException("Missing resourceName");
        }
        else if (scopeKey2 == null)
        {
          // path is "/clusters/{clusterName}/configs/partition/resourceName"
          representation = getConfigKeys(scopeProperty, scopeKey1);
        }
        else
        {
          // path is
          // "/clusters/{clusterName}/configs/partition/resourceName/partitionName"
          ConfigScope scope =
              new ConfigScopeBuilder().build(scopeProperty,
                                             clusterName,
                                             scopeKey1,
                                             scopeKey2);
          representation = getConfigs(scope, scopeProperty, scopeKey1, scopeKey2);
        }
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.