You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@storm.apache.org by ka...@apache.org on 2015/07/17 00:04:06 UTC
[3/3] storm git commit: Update FluxParser.java
Update FluxParser.java
Project: http://git-wip-us.apache.org/repos/asf/storm/repo
Commit: http://git-wip-us.apache.org/repos/asf/storm/commit/9c3dfc98
Tree: http://git-wip-us.apache.org/repos/asf/storm/tree/9c3dfc98
Diff: http://git-wip-us.apache.org/repos/asf/storm/diff/9c3dfc98
Branch: refs/heads/STORM-942-cherrypick
Commit: 9c3dfc9863475841f918ddb93cc1db8535cb8aff
Parents: 8ec4c5b
Author: Brendan W. Lyon <bl...@datainterfuse.com>
Authored: Thu Jul 16 17:13:30 2015 -0400
Committer: Jungtaek Lim <ka...@gmail.com>
Committed: Fri Jul 17 06:57:36 2015 +0900
----------------------------------------------------------------------
.../apache/storm/flux/parser/FluxParser.java | 36 ++++++++++----------
1 file changed, 18 insertions(+), 18 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/storm/blob/9c3dfc98/external/flux/flux-core/src/main/java/org/apache/storm/flux/parser/FluxParser.java
----------------------------------------------------------------------
diff --git a/external/flux/flux-core/src/main/java/org/apache/storm/flux/parser/FluxParser.java b/external/flux/flux-core/src/main/java/org/apache/storm/flux/parser/FluxParser.java
index a15abaa..2a18474 100644
--- a/external/flux/flux-core/src/main/java/org/apache/storm/flux/parser/FluxParser.java
+++ b/external/flux/flux-core/src/main/java/org/apache/storm/flux/parser/FluxParser.java
@@ -43,7 +43,7 @@ public class 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 {
+ String propertiesFile, boolean envSub) throws IOException {
FileInputStream in = new FileInputStream(inputFile);
TopologyDef topology = parseInputStream(in, dumpYaml, processIncludes, propertiesFile, envSub);
@@ -53,7 +53,7 @@ public class FluxParser {
}
public static TopologyDef parseResource(String resource, boolean dumpYaml, boolean processIncludes,
- String propertiesFile, boolean envSub) throws IOException {
+ String propertiesFile, boolean envSub) throws IOException {
InputStream in = FluxParser.class.getResourceAsStream(resource);
TopologyDef topology = parseInputStream(in, dumpYaml, processIncludes, propertiesFile, envSub);
@@ -63,27 +63,27 @@ public class FluxParser {
}
public static TopologyDef parseInputStream(InputStream inputStream, boolean dumpYaml, boolean processIncludes,
- String propertiesFile, boolean envSub) throws IOException {
+ String propertiesFile, boolean envSub) throws IOException {
- Yaml yaml = yaml();
+ Yaml yaml = yaml();
- if (inputStream == null) {
- LOG.error("Unable to load input stream");
- System.exit(1);
- }
-
- TopologyDef topology = loadYaml(yaml, inputStream, propertiesFile, envSub);
+ if (inputStream == null) {
+ LOG.error("Unable to load input stream");
+ System.exit(1);
+ }
- if (dumpYaml) {
- dumpYaml(topology, yaml);
- }
+ TopologyDef topology = loadYaml(yaml, inputStream, propertiesFile, envSub);
- if (processIncludes) {
- return processIncludes(yaml, topology, propertiesFile, envSub);
- } else {
- return topology;
- }
+ if (dumpYaml) {
+ dumpYaml(topology, yaml);
}
+
+ if (processIncludes) {
+ return processIncludes(yaml, topology, propertiesFile, envSub);
+ } else {
+ return topology;
+ }
+ }
private static TopologyDef loadYaml(Yaml yaml, InputStream in, String propsFile, boolean envSubstitution) throws IOException {
ByteArrayOutputStream bos = new ByteArrayOutputStream();