MCPcopy
hub / github.com/OpenTSDB/opentsdb / loadConfigSource

Method loadConfigSource

src/tools/OpenTSDBMain.java:207–218  ·  view source on GitHub ↗

Applies the properties from the named source to the main configuration @param config the main configuration to apply to @param source the name of the source to apply properties from

(ConfigArgP config, String source)

Source from the content-addressed store, hash-verified

205 * @param source the name of the source to apply properties from
206 */
207 protected static void loadConfigSource(ConfigArgP config, String source) {
208 Properties p = loadConfig(source);
209 Config c = config.getConfig();
210 for(String key: p.stringPropertyNames()) {
211 String value = p.getProperty(key);
212 ConfigurationItem ci = config.getConfigurationItem(key);
213 if(ci!=null) { // if we recognize the key, validate it
214 ci.setValue(value);
215 }
216 c.overrideConfig(key, value);
217 }
218 }
219
220 /**
221 * Loads properties from a file or url with the passed name

Callers 1

applyCommandLineMethod · 0.95

Calls 5

loadConfigMethod · 0.95
setValueMethod · 0.95
overrideConfigMethod · 0.95
getConfigurationItemMethod · 0.80
getConfigMethod · 0.45

Tested by

no test coverage detected