diff --git a/jstorm-core/src/main/java/backtype/storm/StormSubmitter.java b/jstorm-core/src/main/java/backtype/storm/StormSubmitter.java index b50997f9e..f6ba8d9f1 100644 --- a/jstorm-core/src/main/java/backtype/storm/StormSubmitter.java +++ b/jstorm-core/src/main/java/backtype/storm/StormSubmitter.java @@ -200,45 +200,46 @@ public static boolean topologyNameExists(NimbusClient client, Map conf, String n } } - private static String submittedJar = null; + //private static String submittedJar = null; private static String path = null; private static void submitJar(NimbusClient client, Map conf) { - if (submittedJar == null) { - try { - LOG.info("Jar not uploaded to master yet. Submitting jar..."); - String localJar = System.getProperty("storm.jar"); - path = client.getClient().beginFileUpload(); - String[] pathCache = path.split("/"); - String uploadLocation = path + "/stormjar-" + pathCache[pathCache.length - 1] + ".jar"; - List lib = (List) conf.get(GenericOptionsParser.TOPOLOGY_LIB_NAME); - Map libPath = (Map) conf.get(GenericOptionsParser.TOPOLOGY_LIB_PATH); - if (lib != null && lib.size() != 0) { - for (String libName : lib) { - String jarPath = path + "/lib/" + libName; - client.getClient().beginLibUpload(jarPath); - submitJar(conf, libPath.get(libName), jarPath, client); - } - - } else { - if (localJar == null) { - // no lib, no client jar - throw new RuntimeException("No client app jar, please upload it"); - } + String submittedJar = null; +// if (submittedJar == null) { + try { + LOG.info("Jar not uploaded to master yet. Submitting jar..."); + String localJar = System.getProperty("storm.jar"); + path = client.getClient().beginFileUpload(); + String[] pathCache = path.split("/"); + String uploadLocation = path + "/stormjar-" + pathCache[pathCache.length - 1] + ".jar"; + List lib = (List) conf.get(GenericOptionsParser.TOPOLOGY_LIB_NAME); + Map libPath = (Map) conf.get(GenericOptionsParser.TOPOLOGY_LIB_PATH); + if (lib != null && lib.size() != 0) { + for (String libName : lib) { + String jarPath = path + "/lib/" + libName; + client.getClient().beginLibUpload(jarPath); + submitJar(conf, libPath.get(libName), jarPath, client); } - if (localJar != null) { - submittedJar = submitJar(conf, localJar, uploadLocation, client); - } else { - // no client jar, but with lib jar - client.getClient().finishFileUpload(uploadLocation); + } else { + if (localJar == null) { + // no lib, no client jar + throw new RuntimeException("No client app jar, please upload it"); } - } catch (Exception e) { - throw new RuntimeException(e); } - } else { - LOG.info("Jar already uploaded to master. Not submitting jar."); + + if (localJar != null) { + submittedJar = submitJar(conf, localJar, uploadLocation, client); + } else { + // no client jar, but with lib jar + client.getClient().finishFileUpload(uploadLocation); + } + } catch (Exception e) { + throw new RuntimeException(e); } +// } else { +// LOG.info("Jar already uploaded to master. Not submitting jar."); +// } } public static String submitJar(Map conf, String localJar, String uploadLocation, NimbusClient client) {