storm-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [storm] efgpinto commented on a change in pull request #3155: STORM-3066: Implement support for using list elements in properties in FluxParser
Date Sat, 02 Nov 2019 02:45:49 GMT
efgpinto commented on a change in pull request #3155: STORM-3066: Implement support for using
list elements in properties in FluxParser
URL: https://github.com/apache/storm/pull/3155#discussion_r341796345
 
 

 ##########
 File path: flux/flux-core/src/main/java/org/apache/storm/flux/parser/FluxParser.java
 ##########
 @@ -139,37 +149,49 @@ public static Properties parseProperties(String propertiesFile, boolean
resource
         return properties;
     }
 
-    private static TopologyDef loadYaml(Yaml yaml, InputStream in, Properties properties,
boolean envSubstitution) throws IOException {
-        ByteArrayOutputStream bos = new ByteArrayOutputStream();
+    private static TopologyDef loadYaml(Yaml yaml, InputStream in, Properties properties,
boolean envSubstitution) {
         LOG.info("loading YAML from input stream...");
-        int b = -1;
-        while ((b = in.read()) != -1) {
-            bos.write(b);
-        }
+        StringBuilder bos = new StringBuilder();
+        BufferedReader reader = new BufferedReader(new InputStreamReader(in));
 
 Review comment:
   Thanks, updated using try-with-resources

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message