Package org.apache.helix.api.config

Examples of org.apache.helix.api.config.UserConfig


    Map<String, String> results = new HashMap<String, String>();
    switch (scopeType) {
    case CLUSTER: {
      ClusterAccessor accessor = clusterAccessor(clusterName);
      Scope<ClusterId> scope = Scope.cluster(ClusterId.from(clusterName));
      UserConfig userConfig = userConfig(scope, null, keyValues);
      accessor.setUserConfig(userConfig);
      break;
    }
    case PARTICIPANT: {
      ParticipantId participantId = ParticipantId.from(scopeArgs[1]);
      ParticipantAccessor accessor = participantAccessor(clusterName);
      Scope<ParticipantId> scope = Scope.participant(participantId);
      UserConfig userConfig = userConfig(scope, null, keyValues);
      accessor.setUserConfig(participantId, userConfig);
      break;
    }
    case RESOURCE: {
      ResourceId resourceId = ResourceId.from(scopeArgs[1]);
      ResourceAccessor accessor = resourceAccessor(clusterName);
      Scope<ResourceId> scope = Scope.resource(resourceId);
      UserConfig userConfig = userConfig(scope, null, keyValues);
      accessor.setUserConfig(resourceId, userConfig);
      break;
    }
    case PARTITION: {
      ResourceId resourceId = ResourceId.from(scopeArgs[1]);
      String partitionId = scopeArgs[2];
      ResourceAccessor accessor = resourceAccessor(clusterName);
      Scope<ResourceId> scope = Scope.resource(resourceId);
      UserConfig userConfig = userConfig(scope, partitionId, keyValues);
      accessor.setUserConfig(resourceId, userConfig);
      break;
    }
    default:
      System.err.println("Non-recognized scopeType: " + scopeType);
View Full Code Here


  void removeConfig(String[] optValues) {
    ScopeType type = ScopeType.valueOf(optValues[0].toUpperCase());
    String[] scopeArgs = optValues[1].split("[\\s,]");
    String[] keys = optValues[2].split("[\\s,]");
    String clusterName = scopeArgs[0];
    UserConfig userConfig;
    switch (type) {
    case CLUSTER:
      ClusterAccessor clusterAccessor = clusterAccessor(clusterName);
      userConfig = clusterAccessor.readUserConfig();
      removeKeysFromUserConfig(userConfig, keys);
View Full Code Here

TOP

Related Classes of org.apache.helix.api.config.UserConfig

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.