Github user mmiklavc commented on a diff in the pull request:
https://github.com/apache/metron/pull/851#discussion_r154508609
--- Diff:
metron-platform/metron-common/src/main/java/org/apache/metron/common/configuration/ConfigurationsUtils.java
---
@@ -343,25 +343,57 @@ public static void uploadConfigsToZookeeper(String
rootFilePath, CuratorFramewor
* @param type config type to upload configs for
* @param configName specific config under the specified config type
*/
- public static void uploadConfigsToZookeeper(String rootFilePath,
CuratorFramework client,
- ConfigurationType type, Optional<String> configName) throws
Exception {
+ 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(globalConfig, client);
}
break;
- case PARSER: // intentional pass-through
- case ENRICHMENT: // intentional pass-through
- case INDEXING:
- Map<String, byte[]> sensorIndexingConfigs =
readSensorConfigsFromFile(rootFilePath, type,
- configName);
- for (String sensorType : sensorIndexingConfigs.keySet()) {
- writeConfigToZookeeper(type, configName,
sensorIndexingConfigs.get(sensorType), client);
+
+ case PARSER: {
+ Map<String, byte[]> configs =
readSensorConfigsFromFile(rootFilePath, PARSER, configName);
--- End diff --
Haha, I know. I couldn't resist seeing if GitHub actually allowed this sort
of thing, and well, it was actually pretty straightforward. I don't care if we
pull it all together or submit them separately. It sounds like we're all in
agreement that the refactoring is a good idea, so if it was split them Casey's
interface refactoring would go in immediately following with the necessary
votes. I'll leave it to you both to decide.
---