Github user knusbaum commented on a diff in the pull request:

    https://github.com/apache/storm/pull/845#discussion_r44997943
  
    --- Diff: storm-core/src/clj/backtype/storm/daemon/supervisor.clj ---
    @@ -927,31 +1133,32 @@
            first ))
     
     (defmethod download-storm-code
    -    :local [conf storm-id master-code-dir supervisor download-lock]
    -    (let [stormroot (supervisor-stormdist-root conf storm-id)]
    -      (locking download-lock
    -            (FileUtils/copyDirectory (File. master-code-dir) (File. 
stormroot))
    -            (let [classloader (.getContextClassLoader 
(Thread/currentThread))
    -                  resources-jar (resources-jar)
    -                  url (.getResource classloader RESOURCES-SUBDIR)
    -                  target-dir (str stormroot file-path-separator 
RESOURCES-SUBDIR)]
    -              (cond
    -               resources-jar
    -               (do
    -                 (log-message "Extracting resources from jar at " 
resources-jar " to " target-dir)
    -                 (extract-dir-from-jar resources-jar RESOURCES-SUBDIR 
stormroot))
    -               url
    -               (do
    -                 (log-message "Copying resources at " (URI. (str url)) " 
to " target-dir)
    -                 (if (= (.getProtocol url) "jar" )
    -                   (extract-dir-from-jar (.getFile (.getJarFileURL 
(.openConnection url))) RESOURCES-SUBDIR stormroot)
    -                   (FileUtils/copyDirectory (File. (.getPath (URI. (str 
url)))) (File. target-dir)))
    -                 )
    -               )
    -              )
    -            )))
    -
    -(defmethod mk-code-distributor :local [conf] nil)
    +  :local [conf storm-id master-code-dir localizer]
    +  (let [tmproot (str (supervisor-tmp-dir conf) file-path-separator (uuid))
    +        stormroot (supervisor-stormdist-root conf storm-id)
    +        blob-store (Utils/getNimbusBlobStore conf master-code-dir nil)]
    +    (try
    +      (FileUtils/forceMkdir (File. tmproot))
    +      (.readBlobTo blob-store (master-stormcode-key storm-id) 
(FileOutputStream. (supervisor-stormcode-path tmproot)) nil)
    +      (.readBlobTo blob-store (master-stormconf-key storm-id) 
(FileOutputStream. (supervisor-stormconf-path tmproot)) nil)
    +      (finally
    +        (.shutdown blob-store)))
    +    (FileUtils/moveDirectory (File. tmproot) (File. stormroot))
    +    (setup-storm-code-dir conf (read-supervisor-storm-conf conf storm-id) 
stormroot)
    +    (let [classloader (.getContextClassLoader (Thread/currentThread))
    +          resources-jar (resources-jar)
    +          url (.getResource classloader RESOURCES-SUBDIR)
    +          target-dir (str stormroot file-path-separator RESOURCES-SUBDIR)]
    +      (cond
    +        resources-jar
    --- End diff --
    
    Lots of blank space at the end of this line?


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to