public static Config loadConfig(String heronHome, String configPath,
                                  String releaseFile, String overrideConfigFile) {
    Config defaultConfig = loadDefaults(heronHome, configPath);
    Config localConfig = Config.toLocalMode(defaultConfig); //to token-substitute the conf paths

    Config.Builder cb = Config.newBuilder()
        .putAll(defaultConfig)
        .putAll(loadConfig(Context.clusterFile(localConfig)))
        .putAll(loadConfig(Context.clientFile(localConfig)))
        .putAll(loadConfig(Context.healthmgrFile(localConfig)))
        .putAll(loadConfig(Context.packingFile(localConfig)))
        .putAll(loadConfig(Context.schedulerFile(localConfig)))
        .putAll(loadConfig(Context.stateManagerFile(localConfig)))
        .putAll(loadConfig(Context.uploaderFile(localConfig)))
        .putAll(loadConfig(Context.downloaderFile(localConfig)))
        .putAll(loadConfig(Context.statefulConfigFile(localConfig)))
        .putAll(loadConfig(releaseFile))
        .putAll(loadConfig(overrideConfigFile));
    return cb.build();
  }
public static Config loadConfig ( String heronHome , String configPath , String releaseFile , String overrideConfigFile ) { Config defaultConfig = loadDefaults ( heronHome , configPath ) ; Config localConfig = Config . toLocalMode ( defaultConfig ) ; Config . Builder cb = Config . newBuilder ( ) . putAll ( defaultConfig ) . putAll ( loadConfig ( Context . clusterFile ( localConfig ) ) ) . putAll ( loadConfig ( Context . clientFile ( localConfig ) ) ) . putAll ( loadConfig ( Context . healthmgrFile ( localConfig ) ) ) . putAll ( loadConfig ( Context . packingFile ( localConfig ) ) ) . putAll ( loadConfig ( Context . schedulerFile ( localConfig ) ) ) . putAll ( loadConfig ( Context . stateManagerFile ( localConfig ) ) ) . putAll ( loadConfig ( Context . uploaderFile ( localConfig ) ) ) . putAll ( loadConfig ( Context . downloaderFile ( localConfig ) ) ) . putAll ( loadConfig ( Context . statefulConfigFile ( localConfig ) ) ) . putAll ( loadConfig ( releaseFile ) ) . putAll ( loadConfig ( overrideConfigFile ) ) ; return cb . build ( ) ; }
Loads raw configurations from files under the heronHome and configPath. The returned config
must be converted to either local or cluster mode to trigger pattern substitution of wildcards
tokens.