eagle-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From h..@apache.org
Subject [5/5] incubator-eagle git commit: add exception processing
Date Mon, 30 Nov 2015 02:49:02 GMT
add exception processing


Project: http://git-wip-us.apache.org/repos/asf/incubator-eagle/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-eagle/commit/dfcf1409
Tree: http://git-wip-us.apache.org/repos/asf/incubator-eagle/tree/dfcf1409
Diff: http://git-wip-us.apache.org/repos/asf/incubator-eagle/diff/dfcf1409

Branch: refs/heads/master
Commit: dfcf1409856521925fdb326c086da58f318fd334
Parents: 4046666
Author: Zhao, Qingwen <qingwzhao@ebay.com>
Authored: Fri Nov 27 21:37:12 2015 +0800
Committer: Zhao, Qingwen <qingwzhao@ebay.com>
Committed: Fri Nov 27 21:37:12 2015 +0800

----------------------------------------------------------------------
 .../eagle/datastream/StormTopologyExecutorImpl.scala     | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/dfcf1409/eagle-core/eagle-data-process/eagle-stream-process-api/src/main/scala/org/apache/eagle/datastream/StormTopologyExecutorImpl.scala
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-data-process/eagle-stream-process-api/src/main/scala/org/apache/eagle/datastream/StormTopologyExecutorImpl.scala
b/eagle-core/eagle-data-process/eagle-stream-process-api/src/main/scala/org/apache/eagle/datastream/StormTopologyExecutorImpl.scala
index 48ee9c4..df763b9 100644
--- a/eagle-core/eagle-data-process/eagle-stream-process-api/src/main/scala/org/apache/eagle/datastream/StormTopologyExecutorImpl.scala
+++ b/eagle-core/eagle-data-process/eagle-stream-process-api/src/main/scala/org/apache/eagle/datastream/StormTopologyExecutorImpl.scala
@@ -43,9 +43,14 @@ case class StormTopologyExecutorImpl(topology: StormTopology, config: com.typesa
       if(file.exists()) {
         val inputFileStream = new FileInputStream(file)
         val yaml = new Yaml()
-        val stormConf = yaml.load(inputFileStream).asInstanceOf[java.util.LinkedHashMap[String,
Object]]
-        conf.putAll(stormConf)
-        inputFileStream.close()
+        try {
+          val stormConf = yaml.load(inputFileStream).asInstanceOf[java.util.LinkedHashMap[String,
Object]]
+          if(stormConf != null) conf.putAll(stormConf)
+        } catch {
+          case _ => ()
+        } finally {
+          if(inputFileStream != null) inputFileStream.close()
+        }
       }
     }
 


Mime
View raw message