/** * This makes a copy without the nested content -so is suitable * for returning as part of the list of a parent's values * @return the copy */ public PublishedConfiguration shallowCopy() { PublishedConfiguration that = new PublishedConfiguration(); that.description = this.description; that.updated = this.updated; that.updatedTime = this.updatedTime; return that; }
public XmlOutputter(PublishedConfiguration owner) { super(owner); configuration = owner.asConfiguration(); }
@Override public String asString() throws IOException { return owner.asJson(); } }
/** * Publish a named property bag that may contain name-value pairs for app configurations such as hbase-site * * @param name * @param description * @param entries */ protected void publishApplicationInstanceData(String name, String description, Iterable<Map.Entry<String, String>> entries) { PublishedConfiguration pubconf = new PublishedConfiguration(); pubconf.description = description; pubconf.putValues(entries); log.info("publishing {}", pubconf); getAmState().getPublishedSliderConfigurations().put(name, pubconf); }
/** * Build a configuration from the entries * @param description configuration description * @param entries entries to put */ public PublishedConfiguration(String description, Iterable<Map.Entry<String, String>> entries) { this.description = description; putValues(entries); }
public PublishedConfigSet shallowCopy() { PublishedConfigSet that = new PublishedConfigSet(); for (Map.Entry<String, PublishedConfiguration> entry : configurations.entrySet()) { that.put(entry.getKey(), entry.getValue().shallowCopy()); } return that; } }
public String getStringRepresentation(String setname, String config, UriInfo uriInfo, HttpServletResponse res, ConfigFormat format) throws IOException { // delegate (including init) PublishedConfiguration publishedConfig = getConfigurationInstance(setname, config, uriInfo, res); PublishedConfigurationOutputter outputter = publishedConfig.createOutputter(format); return outputter.asString(); }
public PropertiesOutputter(PublishedConfiguration owner) { super(owner); properties = owner.asProperties(); }
/** * Publish a named property bag that may contain name-value pairs for app configurations such as hbase-site * * @param name * @param description * @param entries */ protected void publishApplicationInstanceData(String name, String description, Iterable<Map.Entry<String, String>> entries) { PublishedConfiguration pubconf = new PublishedConfiguration(); pubconf.description = description; pubconf.putValues(entries); log.info("publishing {}", pubconf); getAmState().getPublishedSliderConfigurations().put(name, pubconf); }
/** * Build a configuration from the entries * @param description configuration description * @param entries entries to put */ public PublishedConfiguration(String description, Iterable<Map.Entry<String, String>> entries) { this.description = description; putValues(entries); }
public PublishedConfigSet shallowCopy() { PublishedConfigSet that = new PublishedConfigSet(); for (Map.Entry<String, PublishedConfiguration> entry : configurations.entrySet()) { that.put(entry.getKey(), entry.getValue().shallowCopy()); } return that; } }
public String getStringRepresentation(String setname, String config, UriInfo uriInfo, HttpServletResponse res, ConfigFormat format) throws IOException { // delegate (including init) PublishedConfiguration publishedConfig = getConfigurationInstance(setname, config, uriInfo, res); PublishedConfigurationOutputter outputter = publishedConfig.createOutputter(format); return outputter.asString(); }
public PropertiesOutputter(PublishedConfiguration owner) { super(owner); properties = owner.asProperties(); }
/** * This makes a copy without the nested content -so is suitable * for returning as part of the list of a parent's values * @return the copy */ public PublishedConfiguration shallowCopy() { PublishedConfiguration that = new PublishedConfiguration(); that.description = this.description; that.updated = this.updated; that.updatedTime = this.updatedTime; return that; }
/** * Build a published configuration, using the keys from keysource, * but resolving the values from the value source, via Configuration.get() * @param description configuration description * @param keysource source of keys * @param valuesource source of values */ public PublishedConfiguration(String description, Iterable<Map.Entry<String, String>> keysource, Configuration valuesource) { this.description = description; putValues(ConfigHelper.resolveConfiguration(keysource, valuesource)); }
public XmlOutputter(PublishedConfiguration owner) { super(owner); configuration = owner.asConfiguration(); }
@Override public String asString() throws IOException { return owner.asJson(); } }
private synchronized void createConfigFile(SliderFileSystem fileSystem, File file, ConfigFile configFile, Map<String, String> config) throws IOException { ConfigFormat configFormat = ConfigFormat.resolve(configFile.getType()); if (file.exists()) { log.info("Skipping writing {} file {} because it already exists", configFormat, file); return; } log.info("Writing {} file {}", configFormat, file); ConfigUtils.prepConfigForTemplateOutputter(configFormat, config, fileSystem, getClusterName(), file.getName()); PublishedConfiguration publishedConfiguration = new PublishedConfiguration(configFile.getDictionaryName(), config.entrySet()); PublishedConfigurationOutputter configurationOutputter = PublishedConfigurationOutputter.createOutputter(configFormat, publishedConfiguration); configurationOutputter.save(file); }
/** * Build a published configuration, using the keys from keysource, * but resolving the values from the value source, via Configuration.get() * @param description configuration description * @param keysource source of keys * @param valuesource source of values */ public PublishedConfiguration(String description, Iterable<Map.Entry<String, String>> keysource, Configuration valuesource) { this.description = description; putValues(ConfigHelper.resolveConfiguration(keysource, valuesource)); }
public String asConfigurationXML() throws IOException { return ConfigHelper.toXml(asConfiguration()); }