|
69 | 69 | (clojurify-structure (Utils/findAndReadConfigFile name true)))
|
70 | 70 |
|
71 | 71 | (defn master-local-dir [conf]
|
72 |
| - (let [ret (str (conf STORM-LOCAL-DIR) "/nimbus")] |
| 72 | + (let [ret (str (conf STORM-LOCAL-DIR) file-path-separator "nimbus")] |
73 | 73 | (FileUtils/forceMkdir (File. ret))
|
74 | 74 | ret
|
75 | 75 | ))
|
76 | 76 |
|
77 | 77 | (defn master-stormdist-root
|
78 | 78 | ([conf]
|
79 |
| - (str (master-local-dir conf) "/stormdist")) |
| 79 | + (str (master-local-dir conf) file-path-separator "stormdist")) |
80 | 80 | ([conf storm-id]
|
81 |
| - (str (master-stormdist-root conf) "/" storm-id))) |
| 81 | + (str (master-stormdist-root conf) file-path-separator storm-id))) |
82 | 82 |
|
83 | 83 | (defn master-stormjar-path [stormroot]
|
84 |
| - (str stormroot "/stormjar.jar")) |
| 84 | + (str stormroot file-path-separator "stormjar.jar")) |
85 | 85 |
|
86 | 86 | (defn master-stormcode-path [stormroot]
|
87 |
| - (str stormroot "/stormcode.ser")) |
| 87 | + (str stormroot file-path-separator "stormcode.ser")) |
88 | 88 |
|
89 | 89 | (defn master-stormconf-path [stormroot]
|
90 |
| - (str stormroot "/stormconf.ser")) |
| 90 | + (str stormroot file-path-separator "stormconf.ser")) |
91 | 91 |
|
92 | 92 | (defn master-inbox [conf]
|
93 |
| - (let [ret (str (master-local-dir conf) "/inbox")] |
| 93 | + (let [ret (str (master-local-dir conf) file-path-separator "inbox")] |
94 | 94 | (FileUtils/forceMkdir (File. ret))
|
95 | 95 | ret ))
|
96 | 96 |
|
97 | 97 | (defn master-inimbus-dir [conf]
|
98 |
| - (str (master-local-dir conf) "/inimbus")) |
| 98 | + (str (master-local-dir conf) file-path-separator "inimbus")) |
99 | 99 |
|
100 | 100 | (defn supervisor-local-dir [conf]
|
101 |
| - (let [ret (str (conf STORM-LOCAL-DIR) "/supervisor")] |
| 101 | + (let [ret (str (conf STORM-LOCAL-DIR) file-path-separator "supervisor")] |
102 | 102 | (FileUtils/forceMkdir (File. ret))
|
103 | 103 | ret
|
104 | 104 | ))
|
105 | 105 |
|
106 | 106 | (defn supervisor-isupervisor-dir [conf]
|
107 |
| - (str (supervisor-local-dir conf) "/isupervisor")) |
| 107 | + (str (supervisor-local-dir conf) file-path-separator "isupervisor")) |
108 | 108 |
|
109 | 109 | (defn supervisor-stormdist-root
|
110 |
| - ([conf] (str (supervisor-local-dir conf) "/stormdist")) |
| 110 | + ([conf] (str (supervisor-local-dir conf) file-path-separator "stormdist")) |
111 | 111 | ([conf storm-id]
|
112 |
| - (str (supervisor-stormdist-root conf) "/" (java.net.URLEncoder/encode storm-id)))) |
| 112 | + (str (supervisor-stormdist-root conf) file-path-separator (java.net.URLEncoder/encode storm-id)))) |
113 | 113 |
|
114 | 114 | (defn supervisor-stormjar-path [stormroot]
|
115 |
| - (str stormroot "/stormjar.jar")) |
| 115 | + (str stormroot file-path-separator "stormjar.jar")) |
116 | 116 |
|
117 | 117 | (defn supervisor-stormcode-path [stormroot]
|
118 |
| - (str stormroot "/stormcode.ser")) |
| 118 | + (str stormroot file-path-separator "stormcode.ser")) |
119 | 119 |
|
120 | 120 | (defn supervisor-stormconf-path [stormroot]
|
121 |
| - (str stormroot "/stormconf.ser")) |
| 121 | + (str stormroot file-path-separator "stormconf.ser")) |
122 | 122 |
|
123 | 123 | (defn supervisor-tmp-dir [conf]
|
124 |
| - (let [ret (str (supervisor-local-dir conf) "/tmp")] |
| 124 | + (let [ret (str (supervisor-local-dir conf) file-path-separator "tmp")] |
125 | 125 | (FileUtils/forceMkdir (File. ret))
|
126 | 126 | ret ))
|
127 | 127 |
|
128 | 128 | (defn supervisor-storm-resources-path [stormroot]
|
129 |
| - (str stormroot "/" RESOURCES-SUBDIR)) |
| 129 | + (str stormroot file-path-separator RESOURCES-SUBDIR)) |
130 | 130 |
|
131 | 131 | (defn ^LocalState supervisor-state [conf]
|
132 |
| - (LocalState. (str (supervisor-local-dir conf) "/localstate"))) |
| 132 | + (LocalState. (str (supervisor-local-dir conf) file-path-separator "localstate"))) |
133 | 133 |
|
134 | 134 | (defn read-supervisor-storm-conf [conf storm-id]
|
135 | 135 | (let [stormroot (supervisor-stormdist-root conf storm-id)
|
|
146 | 146 |
|
147 | 147 | (defn worker-root
|
148 | 148 | ([conf]
|
149 |
| - (str (conf STORM-LOCAL-DIR) "/workers")) |
| 149 | + (str (conf STORM-LOCAL-DIR) file-path-separator "workers")) |
150 | 150 | ([conf id]
|
151 |
| - (str (worker-root conf) "/" id))) |
| 151 | + (str (worker-root conf) file-path-separator id))) |
152 | 152 |
|
153 | 153 | (defn worker-pids-root
|
154 | 154 | [conf id]
|
155 |
| - (str (worker-root conf id) "/pids")) |
| 155 | + (str (worker-root conf id) file-path-separator "pids")) |
156 | 156 |
|
157 | 157 | (defn worker-pid-path [conf id pid]
|
158 |
| - (str (worker-pids-root conf id) "/" pid)) |
| 158 | + (str (worker-pids-root conf id) file-path-separator pid)) |
159 | 159 |
|
160 | 160 | (defn worker-heartbeats-root
|
161 | 161 | [conf id]
|
162 |
| - (str (worker-root conf id) "/heartbeats")) |
| 162 | + (str (worker-root conf id) file-path-separator "heartbeats")) |
163 | 163 |
|
164 | 164 | ;; workers heartbeat here with pid and timestamp
|
165 | 165 | ;; if supervisor stops receiving heartbeat, it kills and restarts the process
|
|
0 commit comments