[ 
https://issues.apache.org/jira/browse/STORM-615?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14388648#comment-14388648
 ] 

ASF GitHub Bot commented on STORM-615:
--------------------------------------

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.


> Add REST API to upload topology
> -------------------------------
>
>                 Key: STORM-615
>                 URL: https://issues.apache.org/jira/browse/STORM-615
>             Project: Apache Storm
>          Issue Type: Bug
>            Reporter: Sriharsha Chintalapani
>            Assignee: Sriharsha Chintalapani
>
> Add REST api /api/v1/submitTopology to upload topology jars and config using 
> REST api.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to