Examples of HelixConfigScope


Examples of org.apache.helix.model.HelixConfigScope

    System.out.println("START " + clusterName + " at " + new Date(System.currentTimeMillis()));

    ZKHelixAdmin admin = new ZKHelixAdmin(_gZkClient);
    admin.addCluster(clusterName, true);
    ConfigAccessor configAccessor = new ConfigAccessor(_gZkClient);
    HelixConfigScope participantScope =
        new HelixConfigScopeBuilder(ConfigScopeProperty.PARTICIPANT).forCluster(clusterName)
            .forParticipant("localhost_12918").build();

    try {
      configAccessor.set(participantScope, "participantConfigKey", "participantConfigValue");
View Full Code Here

Examples of org.apache.helix.model.HelixConfigScope

  public void joinCluster() {
    // Read cluster config and see if instance can auto join the cluster
    boolean autoJoin = false;
    try {
      HelixConfigScope scope =
          new HelixConfigScopeBuilder(ConfigScopeProperty.CLUSTER).forCluster(
              _manager.getClusterName()).build();
      autoJoin =
          Boolean.parseBoolean(_configAccessor.get(scope,
              ZKHelixManager.ALLOW_PARTICIPANT_AUTO_JOIN));
View Full Code Here

Examples of org.apache.helix.model.HelixConfigScope

    manager.startTimerTasks();

    _setupTool.getClusterManagementTool().addAlert(CLUSTER_NAME, _alertStr1);
    _setupTool.getClusterManagementTool().addAlert(CLUSTER_NAME, _alertStr2);

    HelixConfigScope scope =
        new HelixConfigScopeBuilder(ConfigScopeProperty.CLUSTER).forCluster(CLUSTER_NAME).build();
    Map<String, String> properties = new HashMap<String, String>();
    properties.put("healthChange.enabled", "false");
    _setupTool.getClusterManagementTool().setConfig(scope, properties);
View Full Code Here

Examples of org.apache.helix.model.HelixConfigScope

    _partitionName = partitionName;
    return this;
  }

  public HelixConfigScope build() {
    HelixConfigScope scope = null;
    switch (_type) {
    case CLUSTER:
      scope = new HelixConfigScope(_type, Arrays.asList(_clusterName, _clusterName), null);
      break;
    case PARTICIPANT:
      if (_participantName == null) {
        scope = new HelixConfigScope(_type, Arrays.asList(_clusterName), null);
      } else {
        scope = new HelixConfigScope(_type, Arrays.asList(_clusterName, _participantName), null);
      }
      break;
    case RESOURCE:
      if (_resourceName == null) {
        scope = new HelixConfigScope(_type, Arrays.asList(_clusterName), null);
      } else {
        scope = new HelixConfigScope(_type, Arrays.asList(_clusterName, _resourceName), null);
      }
      break;
    case PARTITION:
      if (_partitionName == null) {
        scope = new HelixConfigScope(_type, Arrays.asList(_clusterName, _resourceName), null);
      } else {
        scope =
            new HelixConfigScope(_type, Arrays.asList(_clusterName, _resourceName), _partitionName);
      }
      break;
    default:
      break;
    }
View Full Code Here

Examples of org.apache.helix.model.HelixConfigScope

      }
    }

    // enable auto join if this option is set
    if (cfg.autoJoinAllowed != null && cfg.autoJoinAllowed) {
      HelixConfigScope scope =
          new HelixConfigScopeBuilder(ConfigScopeProperty.CLUSTER).forCluster(cfg.clusterName)
              .build();
      Map<String, String> properties = new HashMap<String, String>();
      properties.put(ZKHelixManager.ALLOW_PARTICIPANT_AUTO_JOIN, cfg.autoJoinAllowed.toString());
      helixAdmin.setConfig(scope, properties);
View Full Code Here

Examples of org.apache.helix.model.HelixConfigScope

  }

  @Test
  public void testAlertActionDisableNode() throws InterruptedException {
    // ConfigScope scope = new ConfigScopeBuilder().forCluster(CLUSTER_NAME).build();
    HelixConfigScope scope =
        new HelixConfigScopeBuilder(ConfigScopeProperty.CLUSTER).forCluster(CLUSTER_NAME).build();
    Map<String, String> properties = new HashMap<String, String>();
    properties.put("healthChange.enabled", "true");
    _setupTool.getClusterManagementTool().setConfig(scope, properties);
View Full Code Here

Examples of org.apache.helix.model.HelixConfigScope

   * @param keyValuePairs csv-formatted key-value pairs. e.g. k1=v1,k2=v2
   */
  public void setConfig(ConfigScopeProperty type, String scopeArgsCsv, String keyValuePairs) {
    // ConfigScope scope = new ConfigScopeBuilder().build(scopesKeyValuePairs);
    String[] scopeArgs = scopeArgsCsv.split("[\\s,]");
    HelixConfigScope scope = new HelixConfigScopeBuilder(type, scopeArgs).build();

    Map<String, String> keyValueMap = HelixUtil.parseCsvFormatedKeyValuePairs(keyValuePairs);
    _admin.setConfig(scope, keyValueMap);
  }
View Full Code Here

Examples of org.apache.helix.model.HelixConfigScope

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

    String[] scopeArgs = scopeArgsCsv.split("[\\s,]");
    HelixConfigScope scope = new HelixConfigScopeBuilder(type, scopeArgs).build();

    String[] keys = keysCsv.split("[\\s,]");

    _admin.removeConfig(scope, Arrays.asList(keys));
  }
View Full Code Here

Examples of org.apache.helix.model.HelixConfigScope

   */
  public String getConfig(ConfigScopeProperty type, String scopeArgsCsv, String keysCsv) {
    // ConfigScope scope = new ConfigScopeBuilder().build(scopesStr);

    String[] scopeArgs = scopeArgsCsv.split("[\\s,]");
    HelixConfigScope scope = new HelixConfigScopeBuilder(type, scopeArgs).build();

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

Examples of org.apache.helix.model.HelixConfigScope

   * Read cluster config and see if instance can auto join the cluster
   */
  private void joinCluster() {
    boolean autoJoin = false;
    try {
      HelixConfigScope scope =
          new HelixConfigScopeBuilder(ConfigScopeProperty.CLUSTER).forCluster(
              _clusterId.stringify()).build();
      autoJoin =
          Boolean
              .parseBoolean(_configAccessor.get(scope, HelixManager.ALLOW_PARTICIPANT_AUTO_JOIN));
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.