You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@storm.apache.org by bo...@apache.org on 2014/05/12 17:35:46 UTC

[4/8] git commit: rewrote submitJar methods to be similar to what we had before

rewrote submitJar methods to be similar to what we had before


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

Branch: refs/heads/master
Commit: 1bc4d41e8cf348e9cc1121c145d015f3f7351885
Parents: 4e03132
Author: darthbear <fr...@gmail.com>
Authored: Thu May 8 11:11:53 2014 -0400
Committer: darthbear <fr...@gmail.com>
Committed: Thu May 8 11:11:53 2014 -0400

----------------------------------------------------------------------
 .../src/jvm/backtype/storm/StormSubmitter.java  | 28 ++++++++++----------
 1 file changed, 14 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-storm/blob/1bc4d41e/storm-core/src/jvm/backtype/storm/StormSubmitter.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/backtype/storm/StormSubmitter.java b/storm-core/src/jvm/backtype/storm/StormSubmitter.java
index 5c644fa..d292944 100644
--- a/storm-core/src/jvm/backtype/storm/StormSubmitter.java
+++ b/storm-core/src/jvm/backtype/storm/StormSubmitter.java
@@ -101,7 +101,7 @@ public class StormSubmitter {
                 if(topologyNameExists(conf, name)) {
                     throw new RuntimeException("Topology with name `" + name + "` already exists on cluster");
                 }
-                submitJar(conf, null, progressListener);
+                submitJar(conf, progressListener);
                 try {
                     LOG.info("Submitting topology " +  name + " in distributed mode with conf " + serConf);
                     if(opts!=null) {
@@ -199,23 +199,24 @@ public class StormSubmitter {
     }
 
     private static String submittedJar = null;
-    
+
+    private static void submitJar(Map conf, ProgressListener listener) {
+        if(submittedJar==null) {
+            LOG.info("Jar not uploaded to master yet. Submitting jar...");
+            String localJar = System.getProperty("storm.jar");
+            submittedJar = submitJar(conf, localJar, listener);
+        } else {
+            LOG.info("Jar already uploaded to master. Not submitting jar.");
+        }
+    }
+
     public static String submitJar(Map conf, String localJar) {
         return submitJar(conf, localJar, null);
     }
 
     public static String submitJar(Map conf, String localJar, ProgressListener listener) {
-
-        if (submittedJar==null && localJar==null) {
-                LOG.info("Jar not uploaded to master yet. Submitting jar...");
-                localJar = System.getProperty("storm.jar");
-
-                if (localJar==null) {
-                    throw new RuntimeException("Must submit topologies using the 'storm' client script so that StormSubmitter knows which jar to upload.");
-                }
-        } else if (localJar!=null) {
-            LOG.info("Jar already uploaded to master. Not submitting jar.");
-            return submittedJar;
+        if (localJar == null) {
+            throw new RuntimeException("Must submit topologies using the 'storm' client script so that StormSubmitter knows which jar to upload.");
         }
 
         NimbusClient client = NimbusClient.getConfiguredClient(conf);
@@ -247,7 +248,6 @@ public class StormSubmitter {
             }
 
             LOG.info("Successfully uploaded topology jar to assigned location: " + uploadLocation);
-            submittedJar = uploadLocation;
             return uploadLocation;
         } catch(Exception e) {
             throw new RuntimeException(e);