Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -143,9 +143,11 @@ public JSONObject filter(String serviceName) {

/**
* Emulate the way CLARA parses the full YAML and presents it in EngineData.
* The "global" and "service" subsections in the "configuration" section get
* squashed into one namespace, and service-specific keys override any
* globals of the same name.
*
* The YAML's "global" and "services" configuration sections get squashed
* into one namespace, with service-specific parameters overriding globals
* of the same name. Also, for the special services named "reader" and
* "writer", the "io-services" section is searched instead of "services".
*
* @param claraJson the full CLARA YAML contents
* @param serviceName the name of the service in CLARA YAML (not class name)
Expand All @@ -161,9 +163,10 @@ public static JSONObject filter(JSONObject claraJson, String serviceName) {
ret.accumulate(key, globals.getString(key));
}
}
if (config.has("services")) {
if (config.getJSONObject("services").has(serviceName)) {
JSONObject service = config.getJSONObject("services").getJSONObject(serviceName);
String section = serviceName.equals("reader") || serviceName.equals("writer") ? "io-services" : "services";
if (config.has(section)) {
if (config.getJSONObject(section).has(serviceName)) {
JSONObject service = config.getJSONObject(section).getJSONObject(serviceName);
for (String key : service.keySet()) {
ret.put(key, service.getString(key));
}
Expand Down
Loading