Package org.apache.ambari.server.state

Examples of org.apache.ambari.server.state.HostConfig


          Map<String, String> values = new HashMap<String, String>(entry.getValue());

          String tag = values.get(ConfigHelper.CLUSTER_DEFAULT_TAG);
          values.remove(ConfigHelper.CLUSTER_DEFAULT_TAG);

          HostConfig hc = new HostConfig();
          hc.setDefaultVersionTag(tag);
          actualConfigs.put(type, hc);

          if (!values.isEmpty()) {
            for (Entry<String, String> overrideEntry : values.entrySet()) {
              Long groupId = Long.parseLong(overrideEntry.getKey());
              hc.getConfigGroupOverrides().put(groupId, overrideEntry.getValue());
              if (!configGroupMap.containsKey(groupId)) {
                LOG.debug("Config group does not exist, id = " + groupId);
              }
            }
          }
View Full Code Here


  @Override
  public Map<String, HostConfig> getDesiredHostConfigs(Cluster cluster) throws AmbariException {
    Map<String, HostConfig> hostConfigMap = new HashMap<String, HostConfig>();
    for (Map.Entry<String, DesiredConfig> desiredConfigEntry :
        cluster.getDesiredConfigs().entrySet()) {
      HostConfig hostConfig = new HostConfig();
      hostConfig.setDefaultVersionTag(desiredConfigEntry.getValue().getVersion());
      hostConfigMap.put(desiredConfigEntry.getKey(), hostConfig);
    }

    Map<Long, ConfigGroup> configGroups = cluster.getConfigGroupsByHostname(this.getHostName());

    if (configGroups != null && !configGroups.isEmpty()) {
      for (ConfigGroup configGroup : configGroups.values()) {
        for (Map.Entry<String, Config> configEntry : configGroup
            .getConfigurations().entrySet()) {

          String configType = configEntry.getKey();
          // HostConfig config holds configType -> versionTag, per config group
          HostConfig hostConfig = hostConfigMap.get(configType);
          if (hostConfig == null) {
            hostConfig = new HostConfig();
            hostConfigMap.put(configType, hostConfig);
            hostConfig.setDefaultVersionTag(cluster.getDesiredConfigByType
              (configType).getVersionTag());
          }
          Config config = configEntry.getValue();
          hostConfig.getConfigGroupOverrides().put(configGroup.getId(),
            config.getVersionTag());
        }
      }
    }
    return hostConfigMap;
View Full Code Here

        for (Map.Entry<String, Config> configEntry : configGroup
            .getConfigurations().entrySet()) {

          String configType = configEntry.getKey();
          // HostConfig config holds configType -> versionTag, per config group
          HostConfig hostConfig = hostConfigMap.get(configType);
          if (hostConfig == null) {
            hostConfig = new HostConfig();
            hostConfigMap.put(configType, hostConfig);
            hostConfig.setDefaultVersionTag(cluster.getDesiredConfigByType
              (configType).getVersionTag());
          }
          Config config = configEntry.getValue();
          hostConfig.getConfigGroupOverrides().put(configGroup.getId(),
            config.getVersionTag());
        }
      }
    }
    return hostConfigMap;
View Full Code Here

  @Override
  public Map<String, HostConfig> getDesiredHostConfigs(Cluster cluster) throws AmbariException {
    Map<String, HostConfig> hostConfigMap = new HashMap<String, HostConfig>();
    for (Map.Entry<String, DesiredConfig> desiredConfigEntry :
        cluster.getDesiredConfigs().entrySet()) {
      HostConfig hostConfig = new HostConfig();
      hostConfig.setDefaultVersionTag(desiredConfigEntry.getValue().getVersion());
      hostConfigMap.put(desiredConfigEntry.getKey(), hostConfig);
    }

    Map<Long, ConfigGroup> configGroups = cluster.getConfigGroupsByHostname(this.getHostName());

    if (configGroups != null && !configGroups.isEmpty()) {
      for (ConfigGroup configGroup : configGroups.values()) {
        for (Map.Entry<String, Config> configEntry : configGroup
            .getConfigurations().entrySet()) {

          String configType = configEntry.getKey();
          // HostConfig config holds configType -> versionTag, per config group
          HostConfig hostConfig = hostConfigMap.get(configType);
          if (hostConfig == null) {
            hostConfig = new HostConfig();
            hostConfigMap.put(configType, hostConfig);
            hostConfig.setDefaultVersionTag(cluster.getDesiredConfigByType
              (configType).getVersionTag());
          }
          Config config = configEntry.getValue();
          hostConfig.getConfigGroupOverrides().put(configGroup.getId(),
            config.getVersionTag());
        }
      }
    }
    return hostConfigMap;
View Full Code Here

          Map<String, String> values = new HashMap<String, String>(entry.getValue());

          String tag = values.get(ConfigHelper.CLUSTER_DEFAULT_TAG);
          values.remove(ConfigHelper.CLUSTER_DEFAULT_TAG);

          HostConfig hc = new HostConfig();
          hc.setDefaultVersionTag(tag);
          actualConfigs.put(type, hc);

          if (!values.isEmpty()) {
            for (Entry<String, String> overrideEntry : values.entrySet()) {
              Long groupId = Long.parseLong(overrideEntry.getKey());
              hc.getConfigGroupOverrides().put(groupId, overrideEntry.getValue());
              if (!configGroupMap.containsKey(groupId)) {
                LOG.debug("Config group does not exist, id = " + groupId);
              }
            }
          }
View Full Code Here

          Map<String, String> values = new HashMap<String, String>(entry.getValue());

          String tag = values.get(ConfigHelper.CLUSTER_DEFAULT_TAG);
          values.remove(ConfigHelper.CLUSTER_DEFAULT_TAG);

          HostConfig hc = new HostConfig();
          hc.setDefaultVersionTag(tag);
          actualConfigs.put(type, hc);

          if (!values.isEmpty()) {
            for (Entry<String, String> overrideEntry : values.entrySet()) {
              Long groupId = Long.parseLong(overrideEntry.getKey());
              hc.getConfigGroupOverrides().put(groupId, overrideEntry.getValue());
              if (!configGroupMap.containsKey(groupId)) {
                LOG.debug("Config group does not exist, id = " + groupId);
              }
            }
          }
View Full Code Here

  @Override
  public Map<String, HostConfig> getDesiredHostConfigs(Cluster cluster) throws AmbariException {
    Map<String, HostConfig> hostConfigMap = new HashMap<String, HostConfig>();
    for (Map.Entry<String, DesiredConfig> desiredConfigEntry :
        cluster.getDesiredConfigs().entrySet()) {
      HostConfig hostConfig = new HostConfig();
      hostConfig.setDefaultVersionTag(desiredConfigEntry.getValue().getVersion());
      hostConfigMap.put(desiredConfigEntry.getKey(), hostConfig);
    }

    Map<Long, ConfigGroup> configGroups = cluster.getConfigGroupsByHostname
      (this.getHostName());

    if (configGroups != null && !configGroups.isEmpty()) {
      for (ConfigGroup configGroup : configGroups.values()) {
        for (Map.Entry<String, Config> configEntry : configGroup
            .getConfigurations().entrySet()) {

          String configType = configEntry.getKey();
          // HostConfig config holds configType -> versionTag, per config group
          HostConfig hostConfig = hostConfigMap.get(configType);
          if (hostConfig == null) {
            hostConfig = new HostConfig();
            hostConfigMap.put(configType, hostConfig);
            hostConfig.setDefaultVersionTag(cluster.getDesiredConfigByType
              (configType).getVersionTag());
          }
          Config config = configEntry.getValue();
          hostConfig.getConfigGroupOverrides().put(configGroup.getId(),
            config.getVersionTag());
        }
      }
    }
    return hostConfigMap;
View Full Code Here

          Map<String, String> values = new HashMap<String, String>(entry.getValue());

          String tag = values.get(ConfigHelper.CLUSTER_DEFAULT_TAG);
          values.remove(ConfigHelper.CLUSTER_DEFAULT_TAG);

          HostConfig hc = new HostConfig();
          hc.setDefaultVersionTag(tag);
          actualConfigs.put(type, hc);

          if (!values.isEmpty()) {
            for (Entry<String, String> overrideEntry : values.entrySet()) {
              try {
                Long groupId = Long.parseLong(overrideEntry.getKey());
                ConfigGroup configGroup = configGroupMap.get(groupId);
                if (configGroup != null) {
                  hc.getConfigGroupOverrides().put(groupId,
                    overrideEntry.getValue());
                } else {
                  LOG.info("Cannot find config group with id = " + groupId);
                }
              } catch (Exception e) {
View Full Code Here

          Map<String, String> values = new HashMap<String, String>(entry.getValue());

          String tag = values.get(ConfigHelper.CLUSTER_DEFAULT_TAG);
          values.remove(ConfigHelper.CLUSTER_DEFAULT_TAG);

          HostConfig hc = new HostConfig();
          hc.setDefaultVersionTag(tag);
          actualConfigs.put(type, hc);

          if (!values.isEmpty()) {
            for (Entry<String, String> overrideEntry : values.entrySet()) {
              Long groupId = Long.parseLong(overrideEntry.getKey());
              hc.getConfigGroupOverrides().put(groupId, overrideEntry.getValue());
              if (!configGroupMap.containsKey(groupId)) {
                LOG.debug("Config group does not exist, id = " + groupId);
              }
            }
          }
View Full Code Here

TOP

Related Classes of org.apache.ambari.server.state.HostConfig

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.