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

    https://github.com/apache/storm/pull/2445#discussion_r157729717
  
    --- Diff: 
flux/flux-core/src/main/java/org/apache/storm/flux/parser/FluxParser.java ---
    @@ -39,51 +39,57 @@
     
         private FluxParser(){}
     
    -    // TODO refactor input stream processing (see parseResource() method).
         public static TopologyDef parseFile(String inputFile, boolean 
dumpYaml, boolean processIncludes,
                String propertiesFile, boolean envSub) throws IOException {
    -   
    +
             FileInputStream in = new FileInputStream(inputFile);
    -        TopologyDef topology = parseInputStream(in, dumpYaml, 
processIncludes, propertiesFile, envSub);
    +        InputStream propertiesIn = null;
    +        if (propertiesFile != null) {
    +            propertiesIn = new FileInputStream(propertiesFile);
    +        }
    +        TopologyDef topology = parseInputStream(in, dumpYaml, 
processIncludes, propertiesIn, propertiesFile, envSub);
             in.close();
    -        
    +
             return topology;
         }
     
         public static TopologyDef parseResource(String resource, boolean 
dumpYaml, boolean processIncludes,
                String propertiesFile, boolean envSub) throws IOException {
             
             InputStream in = FluxParser.class.getResourceAsStream(resource);
    -        TopologyDef topology = parseInputStream(in, dumpYaml, 
processIncludes, propertiesFile, envSub);
    +        InputStream propertiesIn = null;
    +        if (propertiesFile != null) {
    +            propertiesIn = 
FluxParser.class.getResourceAsStream(propertiesFile);
    +        }
    +        TopologyDef topology = parseInputStream(in, dumpYaml, 
processIncludes, propertiesIn, propertiesFile, envSub);
    --- End diff --
    
    Make sense. Yaml file and included yaml file should share the same 
properties instance. PR for master and 1.x are updated. Please take a look 
again.


---

Reply via email to