Github user justinleet commented on a diff in the pull request:
https://github.com/apache/metron/pull/760#discussion_r139171388
--- Diff:
metron-platform/metron-common/src/main/java/org/apache/metron/common/configuration/ConfigurationsUtils.java
---
@@ -226,6 +276,44 @@ public static void uploadConfigsToZookeeper(String
rootFilePath, CuratorFramewor
uploadConfigsToZookeeper(rootFilePath, rootFilePath, rootFilePath,
rootFilePath, rootFilePath, client);
}
+ public static void uploadConfigsToZookeeper(String rootFilePath,
CuratorFramework client,
+ ConfigurationType type) throws Exception {
+ uploadConfigsToZookeeper(rootFilePath, client, type, Optional.empty());
+ }
+
+ public static void uploadConfigsToZookeeper(String rootFilePath,
CuratorFramework client,
+ ConfigurationType type, Optional<String> configName) throws
Exception {
+ switch (type) {
+ case GLOBAL:
+ final byte[] globalConfig = readGlobalConfigFromFile(rootFilePath);
+ if (globalConfig.length > 0) {
+ setupStellarStatically(client, Optional.of(new
String(globalConfig)));
+
writeGlobalConfigToZookeeper(readGlobalConfigFromFile(rootFilePath), client);
+ }
+ break;
+ case PARSER:
+ Map<String, byte[]> sensorParserConfigs =
readSensorConfigsFromFile(rootFilePath, PARSER, configName);
+ for (String sensorType : sensorParserConfigs.keySet()) {
+ writeConfigToZookeeper(type, configName,
sensorParserConfigs.get(sensorType), client);
+ }
+ break;
+ case ENRICHMENT:
+ Map<String, byte[]> sensorEnrichmentConfigs =
readSensorConfigsFromFile(rootFilePath, ENRICHMENT, configName);
--- End diff --
Incredibly nitpicky, but the `readSensorConfigsFromFile` are over the line
limit.
---