Package org.apache.helix.api.config

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


    PauseSignal pauseSignal = _accessor.getProperty(_keyBuilder.pause());
    boolean isPaused = pauseSignal != null;

    ClusterConfiguration clusterConfig = _accessor.getProperty(_keyBuilder.clusterConfig());
    boolean autoJoinAllowed = false;
    UserConfig userConfig;
    if (clusterConfig != null) {
      userConfig = clusterConfig.getUserConfig();
      autoJoinAllowed = clusterConfig.autoJoinAllowed();
    } else {
      userConfig = new UserConfig(Scope.cluster(_clusterId));
    }

    // read the state model definitions
    Map<StateModelDefId, StateModelDefinition> stateModelMap = readStateModelDefinitions();
View Full Code Here


    // read all the participants
    Map<ParticipantId, Participant> participantMap = Maps.newHashMap();
    for (String participantName : instanceConfigMap.keySet()) {
      InstanceConfig instanceConfig = instanceConfigMap.get(participantName);
      UserConfig userConfig = instanceConfig.getUserConfig();
      LiveInstance liveInstance = liveInstanceMap.get(participantName);
      Map<String, Message> instanceMsgMap = messageMap.get(participantName);

      ParticipantId participantId = ParticipantId.from(participantName);
View Full Code Here

  /**
   * Clear any user-specified configuration from the cluster
   * @return true if the config was cleared, false otherwise
   */
  public boolean dropUserConfig() {
    return setUserConfig(new UserConfig(Scope.cluster(_clusterId)));
  }
View Full Code Here

    // add the config
    InstanceConfig instanceConfig = new InstanceConfig(participant.getId());
    instanceConfig.setHostName(participant.getHostName());
    instanceConfig.setPort(Integer.toString(participant.getPort()));
    instanceConfig.setInstanceEnabled(participant.isEnabled());
    UserConfig userConfig = participant.getUserConfig();
    instanceConfig.addNamespacedConfig(userConfig);
    Set<String> tags = participant.getTags();
    for (String tag : tags) {
      instanceConfig.addTag(tag);
    }
View Full Code Here

   * Clear any user-specified configuration from the participant
   * @param participantId the participant to update
   * @return true if the config was cleared, false otherwise
   */
  public boolean dropUserConfig(ParticipantId participantId) {
    return setUserConfig(participantId, new UserConfig(Scope.participant(participantId)));
  }
View Full Code Here

    if (instanceConfig == null) {
      LOG.error("Participant " + participantId + " is not present on the cluster");
      return null;
    }

    UserConfig userConfig = instanceConfig.getUserConfig();
    LiveInstance liveInstance = _accessor.getProperty(_keyBuilder.liveInstance(participantName));

    Map<String, Message> instanceMsgMap = Collections.emptyMap();
    Map<String, CurrentState> instanceCurStateMap = Collections.emptyMap();
    if (liveInstance != null) {
View Full Code Here

   * Clear any user-specified configuration from the resource
   * @param resourceId the resource to update
   * @return true if the config was cleared, false otherwise
   */
  public boolean dropUserConfig(ResourceId resourceId) {
    return setUserConfig(resourceId, new UserConfig(Scope.resource(resourceId)));
  }
View Full Code Here

   * @return Resource
   */
  static Resource createResource(ResourceId resourceId,
      ResourceConfiguration resourceConfiguration, IdealState idealState,
      ExternalView externalView, ResourceAssignment resourceAssignment) {
    UserConfig userConfig;
    RebalancerContext rebalancerContext = null;
    ResourceType type = ResourceType.DATA;
    if (resourceConfiguration != null) {
      userConfig = resourceConfiguration.getUserConfig();
      type = resourceConfiguration.getType();
    } else {
      userConfig = new UserConfig(Scope.resource(resourceId));
    }
    int bucketSize = 0;
    boolean batchMessageMode = false;
    if (idealState != null) {
      if (resourceConfiguration != null
View Full Code Here

        // set up some participants
        for (String nodeName : _liveNodes) {
          ParticipantId participantId = ParticipantId.from(nodeName);
          Participant participant =
              new Participant(participantId, "hostname", 0, true, disabledPartitionIdSet, tags,
                  null, currentStateMap, messageMap, new UserConfig(
                      Scope.participant(participantId)));
          liveParticipantMap.put(participantId, participant);
        }
        List<ParticipantId> participantPreferenceList =
            Lists.transform(listResult.get(partition), new Function<String, ParticipantId>() {
View Full Code Here

   * @param mapKey
   * @param keyValues
   * @return
   */
  private UserConfig userConfig(Scope<?> scope, String mapKey, String[] keyValues) {
    UserConfig userConfig = new UserConfig(scope);

    for (String keyValue : keyValues) {
      String[] splits = keyValue.split("=");
      String key = splits[0];
      String value = splits[1];
      if (mapKey == null) {
        userConfig.setSimpleField(key, value);
      } else {
        if (userConfig.getMapField(mapKey) == null) {
          userConfig.setMapField(mapKey, new TreeMap<String, String>());
        }
        userConfig.getMapField(mapKey).put(key, value);
      }
    }
    return userConfig;
  }
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.