You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@storm.apache.org by zh...@apache.org on 2016/01/28 18:49:47 UTC
[11/23] storm git commit: Updated to supervisor-storm-resources-path
Updated to supervisor-storm-resources-path
Project: http://git-wip-us.apache.org/repos/asf/storm/repo
Commit: http://git-wip-us.apache.org/repos/asf/storm/commit/99189a60
Tree: http://git-wip-us.apache.org/repos/asf/storm/tree/99189a60
Diff: http://git-wip-us.apache.org/repos/asf/storm/diff/99189a60
Branch: refs/heads/master
Commit: 99189a6016d24aff485b9206323ad68988d32be1
Parents: 635488d
Author: zhuol <zh...@yahoo-inc.com>
Authored: Fri Jan 15 13:10:20 2016 -0600
Committer: zhuol <zh...@yahoo-inc.com>
Committed: Wed Jan 20 09:55:24 2016 -0600
----------------------------------------------------------------------
.../src/clj/org/apache/storm/daemon/common.clj | 2 +-
.../clj/org/apache/storm/daemon/supervisor.clj | 22 ++++++++++----------
.../src/clj/org/apache/storm/daemon/task.clj | 2 +-
.../jvm/org/apache/storm/utils/ConfigUtils.java | 4 +---
4 files changed, 14 insertions(+), 16 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/storm/blob/99189a60/storm-core/src/clj/org/apache/storm/daemon/common.clj
----------------------------------------------------------------------
diff --git a/storm-core/src/clj/org/apache/storm/daemon/common.clj b/storm-core/src/clj/org/apache/storm/daemon/common.clj
index a951a75..d1cb2d9 100644
--- a/storm-core/src/clj/org/apache/storm/daemon/common.clj
+++ b/storm-core/src/clj/org/apache/storm/daemon/common.clj
@@ -375,7 +375,7 @@
(:component->sorted-tasks worker)
(:component->stream->fields worker)
(:storm-id worker)
- (supervisor-storm-resources-path
+ (ConfigUtils/supervisorStormResourcesPath
(ConfigUtils/supervisorStormDistRoot (:conf worker) (:storm-id worker)))
(worker-pids-root (:conf worker) (:worker-id worker))
(:port worker)
http://git-wip-us.apache.org/repos/asf/storm/blob/99189a60/storm-core/src/clj/org/apache/storm/daemon/supervisor.clj
----------------------------------------------------------------------
diff --git a/storm-core/src/clj/org/apache/storm/daemon/supervisor.clj b/storm-core/src/clj/org/apache/storm/daemon/supervisor.clj
index 58d046a..5f3abf2 100644
--- a/storm-core/src/clj/org/apache/storm/daemon/supervisor.clj
+++ b/storm-core/src/clj/org/apache/storm/daemon/supervisor.clj
@@ -353,8 +353,8 @@
[conf storm-id]
(let [stormroot (ConfigUtils/supervisorStormDistRoot conf storm-id)
stormjarpath (ConfigUtils/supervisorStormJarPath stormroot)
- stormcodepath (supervisor-stormcode-path stormroot)
- stormconfpath (supervisor-stormconf-path stormroot)]
+ stormcodepath (ConfigUtils/supervisorStormCodePath stormroot)
+ stormconfpath (ConfigUtils/supervisorStormConfPath stormroot)]
(and (every? exists-file? [stormroot stormconfpath stormcodepath])
(or (ConfigUtils/isLocalMode conf)
(exists-file? stormjarpath)))))
@@ -768,7 +768,7 @@
(defserverfn mk-supervisor [conf shared-context ^ISupervisor isupervisor]
(log-message "Starting Supervisor with conf " conf)
(.prepare isupervisor conf (ConfigUtils/supervisorIsupervisorDir conf))
- (FileUtils/cleanDirectory (File. (supervisor-tmp-dir conf)))
+ (FileUtils/cleanDirectory (File. (ConfigUtils/supervisorTmpDir conf)))
(let [supervisor (supervisor-data conf shared-context isupervisor)
[event-manager processes-event-manager :as managers] [(event/event-manager false) (event/event-manager false)]
sync-processes (partial sync-processes supervisor)
@@ -926,7 +926,7 @@
(defmethod download-storm-code
:distributed [conf storm-id master-code-dir localizer]
;; Downloading to permanent location is atomic
- (let [tmproot (str (supervisor-tmp-dir conf) file-path-separator (uuid))
+ (let [tmproot (str (ConfigUtils/supervisorTmpDir conf) file-path-separator (uuid))
stormroot (ConfigUtils/supervisorStormDistRoot conf storm-id)
blobstore (Utils/getClientBlobStoreForSupervisor conf)]
(FileUtils/forceMkdir (File. tmproot))
@@ -937,14 +937,14 @@
(Utils/downloadResourcesAsSupervisor (ConfigUtils/masterStormJarKey storm-id)
(ConfigUtils/supervisorStormJarPath tmproot) blobstore)
(Utils/downloadResourcesAsSupervisor (ConfigUtils/masterStormCodeKey storm-id)
- (supervisor-stormcode-path tmproot) blobstore)
+ (ConfigUtils/supervisorStormCodePath tmproot) blobstore)
(Utils/downloadResourcesAsSupervisor (ConfigUtils/masterStormConfKey storm-id)
- (supervisor-stormconf-path tmproot) blobstore)
+ (ConfigUtils/supervisorStormConfPath tmproot) blobstore)
(.shutdown blobstore)
(extract-dir-from-jar (ConfigUtils/supervisorStormJarPath tmproot) RESOURCES-SUBDIR tmproot)
- (download-blobs-for-topology! conf (supervisor-stormconf-path tmproot) localizer
+ (download-blobs-for-topology! conf (ConfigUtils/supervisorStormConfPath tmproot) localizer
tmproot)
- (if (download-blobs-for-topology-succeed? (supervisor-stormconf-path tmproot) tmproot)
+ (if (download-blobs-for-topology-succeed? (ConfigUtils/supervisorStormConfPath tmproot) tmproot)
(do
(log-message "Successfully downloaded blob resources for storm-id " storm-id)
(FileUtils/forceMkdir (File. stormroot))
@@ -1148,13 +1148,13 @@
(defmethod download-storm-code
:local [conf storm-id master-code-dir localizer]
- (let [tmproot (str (supervisor-tmp-dir conf) file-path-separator (uuid))
+ (let [tmproot (str (ConfigUtils/supervisorTmpDir conf) file-path-separator (uuid))
stormroot (ConfigUtils/supervisorStormDistRoot conf storm-id)
blob-store (Utils/getNimbusBlobStore conf master-code-dir nil)]
(try
(FileUtils/forceMkdir (File. tmproot))
- (.readBlobTo blob-store (ConfigUtils/masterStormCodeKey storm-id) (FileOutputStream. (supervisor-stormcode-path tmproot)) nil)
- (.readBlobTo blob-store (ConfigUtils/masterStormConfKey storm-id) (FileOutputStream. (supervisor-stormconf-path tmproot)) nil)
+ (.readBlobTo blob-store (ConfigUtils/masterStormCodeKey storm-id) (FileOutputStream. (ConfigUtils/supervisorStormCodePath tmproot)) nil)
+ (.readBlobTo blob-store (ConfigUtils/masterStormConfKey storm-id) (FileOutputStream. (ConfigUtils/supervisorStormConfPath tmproot)) nil)
(finally
(.shutdown blob-store)))
(FileUtils/moveDirectory (File. tmproot) (File. stormroot))
http://git-wip-us.apache.org/repos/asf/storm/blob/99189a60/storm-core/src/clj/org/apache/storm/daemon/task.clj
----------------------------------------------------------------------
diff --git a/storm-core/src/clj/org/apache/storm/daemon/task.clj b/storm-core/src/clj/org/apache/storm/daemon/task.clj
index a8114be..33b8af9 100644
--- a/storm-core/src/clj/org/apache/storm/daemon/task.clj
+++ b/storm-core/src/clj/org/apache/storm/daemon/task.clj
@@ -41,7 +41,7 @@
(:component->sorted-tasks worker)
(:component->stream->fields worker)
(:storm-id worker)
- (supervisor-storm-resources-path
+ (ConfigUtils/supervisorStormResourcesPath
(ConfigUtils/supervisorStormDistRoot conf (:storm-id worker)))
(worker-pids-root conf (:worker-id worker))
(int %)
http://git-wip-us.apache.org/repos/asf/storm/blob/99189a60/storm-core/src/jvm/org/apache/storm/utils/ConfigUtils.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/org/apache/storm/utils/ConfigUtils.java b/storm-core/src/jvm/org/apache/storm/utils/ConfigUtils.java
index 5ada400..35f2249 100644
--- a/storm-core/src/jvm/org/apache/storm/utils/ConfigUtils.java
+++ b/storm-core/src/jvm/org/apache/storm/utils/ConfigUtils.java
@@ -338,9 +338,9 @@ public class ConfigUtils {
return (ret + FILE_SEPARATOR + "stormjar.jar");
}
+ /* Never get used TODO : may delete it*/
public static String supervisorStormMetaFilePath(String stormRoot) {
String ret = "";
- // we do this since to concat a null String will actually concat a "null", which is not the expected: ""
if (stormRoot != null) {
ret = stormRoot;
}
@@ -349,7 +349,6 @@ public class ConfigUtils {
public static String supervisorStormCodePath(String stormRoot) {
String ret = "";
- // we do this since to concat a null String will actually concat a "null", which is not the expected: ""
if (stormRoot != null) {
ret = stormRoot;
}
@@ -358,7 +357,6 @@ public class ConfigUtils {
public static String supervisorStormConfPath(String stormRoot) {
String ret = "";
- // we do this since to concat a null String will actually concat a "null", which is not the expected: ""
if (stormRoot != null) {
ret = stormRoot;
}