Github user HeartSaVioR commented on a diff in the pull request:
https://github.com/apache/storm/pull/464#discussion_r27486303
--- Diff: storm-core/src/clj/backtype/storm/ui/core.clj ---
@@ -503,6 +505,41 @@
(hashmap-to-persistent bolts))
spout-comp-summs bolt-comp-summs window id))))
+(defn validate-tplg-submit-params [params]
+ (let [tplg-jar-file (params :topologyJar)
+ tplg-config (if (not-nil? (params :topologyConfig)) (from-json
(params :topologyConfig)))]
+ (cond
+ (nil? tplg-jar-file) {:valid false :error "missing topology jar file"}
+ (nil? tplg-config) {:valid false :error "missing topology config"}
+ (nil? (tplg-config "topologyMainClass")) {:valid false :error
"topologyMainClass missing in topologyConfig"}
+ :else {:valid true})))
+
+(defn run-tplg-submit-cmd [tplg-jar-file tplg-config]
+ (let [tplg-main-class (if (not-nil? tplg-config) (trim (tplg-config
"topologyMainClass")))
+ tplg-main-class-args (if (not-nil? tplg-config)
(clojure.string/join " " (tplg-config "topologyMainClassArgs")))
+ tplg-jvm-opts (if (not-nil? tplg-config) (clojure.string/join " "
(tplg-config "topologyJvmOpts")))
+ storm-home (System/getProperty "storm.home")
+ storm-log-dir (if (not-nil? (*STORM-CONF* "storm.log.dir"))
(*STORM-CONF* "storm.log.dir")
+ (str storm-home file-path-separator "logs"))
+ storm-libs (str storm-home file-path-separator "lib"
file-path-separator "*")
--- End diff --
@harshach
Replacing this line with ```storm-libs (clojure.string/join ":" [(str
storm-home file-path-separator "lib" file-path-separator "*") (str storm-home
file-path-separator "conf")])``` make it works.
But it's just a workaround cause users may set STORM_CONF_DIR.
```
if STORM_CONF_DIR == None:
CLUSTER_CONF_DIR = os.path.join(STORM_DIR, "conf")
else:
CLUSTER_CONF_DIR = STORM_CONF_DIR
if (not os.path.isfile(os.path.join(USER_CONF_DIR, "storm.yaml"))):
USER_CONF_DIR = CLUSTER_CONF_DIR
```
USER_CONF_DIR will become one of classpath. storm-libs should follow this
rule, except applying ~/.storm directory cause this is cluster-side operation.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---