Github user mmiklavc commented on a diff in the pull request:

    https://github.com/apache/metron/pull/760#discussion_r139194807
  
    --- 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:
    --- End diff --
    
    Ha, yes. Good catch, I missed refactoring that piece. Red, green, refactor 
Mike! Red, green, refactor!


---

Reply via email to