Package org.apache.helix.api.config

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


   * @param config rebalancer config
   * @param rebalancerRef reference to the rebalancer class that will be used
   */
  public RebalancerConfigHolder(RebalancerConfig config) {
    _backingConfig =
        new NamespacedConfig(Scope.resource(config.getResourceId()),
            RebalancerConfigHolder.class.getSimpleName());
    _backingConfig.setSimpleField(Fields.SERIALIZER_CLASS.toString(), config.getSerializerClass()
        .getName());
    _backingConfig.setSimpleField(Fields.REBALANCER_CONFIG_CLASS.toString(), config.getClass()
        .getName());
View Full Code Here


   * Instantiate from a physical ResourceConfiguration
   * @param resourceConfiguration populated ResourceConfiguration
   */
  public RebalancerConfigHolder(ResourceConfiguration resourceConfiguration) {
    _backingConfig =
        new NamespacedConfig(resourceConfiguration, RebalancerConfigHolder.class.getSimpleName());
    _serializer = getSerializer();
    _config = getConfig();
  }
View Full Code Here

  /**
   * Get the rules, if any, that all ideal states in this cluster must follow
   * @return map of rule name to key-value requirements in the ideal state
   */
  public Map<String, Map<String, String>> getIdealStateRules() {
    NamespacedConfig rules = new NamespacedConfig(this, IDEAL_STATE_RULE_PREFIX);
    Map<String, Map<String, String>> idealStateRuleMap = Maps.newHashMap();
    for (String simpleKey : rules.getSimpleFields().keySet()) {
      String simpleValue = rules.getSimpleField(simpleKey);
      String[] splitRules = simpleValue.split("(?<!\\\\),");
      Map<String, String> singleRule = Maps.newHashMap();
      for (String rule : splitRules) {
        String[] keyValue = rule.split("(?<!\\\\)=");
        if (keyValue.length >= 2) {
View Full Code Here

   * Instantiate a ProvisionerConfigHolder
   * @param config provisioner config
   */
  public ProvisionerConfigHolder(ProvisionerConfig config) {
    _backingConfig =
        new NamespacedConfig(Scope.resource(config.getResourceId()),
            ProvisionerConfigHolder.class.getSimpleName());
    _backingConfig.setSimpleField(Fields.SERIALIZER_CLASS.toString(), config.getSerializerClass()
        .getName());
    _backingConfig.setSimpleField(Fields.PROVISIONER_CONFIG_CLASS.toString(), config.getClass()
        .getName());
View Full Code Here

   * Instantiate from a physical ResourceConfiguration
   * @param resourceConfiguration populated ResourceConfiguration
   */
  public ProvisionerConfigHolder(ResourceConfiguration resourceConfiguration) {
    _backingConfig =
        new NamespacedConfig(resourceConfiguration, ProvisionerConfigHolder.class.getSimpleName());
    _serializer = getSerializer();
    _config = getConfig();
  }
View Full Code Here

   * @param context rebalancer context
   * @param rebalancerRef reference to the rebalancer class that will be used
   */
  public RebalancerConfig(RebalancerContext context) {
    _config =
        new NamespacedConfig(Scope.resource(context.getResourceId()),
            RebalancerConfig.class.getSimpleName());
    _config.setSimpleField(Fields.SERIALIZER_CLASS.toString(), context.getSerializerClass()
        .getName());
    _config
        .setSimpleField(Fields.REBALANCER_CONTEXT_CLASS.toString(), context.getClass().getName());
View Full Code Here

  /**
   * Instantiate from a physical ResourceConfiguration
   * @param resourceConfiguration populated ResourceConfiguration
   */
  public RebalancerConfig(ResourceConfiguration resourceConfiguration) {
    _config = new NamespacedConfig(resourceConfiguration, RebalancerConfig.class.getSimpleName());
    _serializer = getSerializer();
    _context = getContext();
  }
View Full Code Here

TOP

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

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.