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:43 UTC
[07/23] storm git commit: Update all the callings to
read-storm-config and add the import for ConfigUtils
Update all the callings to read-storm-config and add the import for ConfigUtils
Project: http://git-wip-us.apache.org/repos/asf/storm/repo
Commit: http://git-wip-us.apache.org/repos/asf/storm/commit/f350f1ae
Tree: http://git-wip-us.apache.org/repos/asf/storm/tree/f350f1ae
Diff: http://git-wip-us.apache.org/repos/asf/storm/diff/f350f1ae
Branch: refs/heads/master
Commit: f350f1ae9aaa44ea8f931c5e48eef5051d79770d
Parents: cb4cdf6
Author: zhuol <zh...@yahoo-inc.com>
Authored: Thu Jan 14 14:34:43 2016 -0600
Committer: zhuol <zh...@yahoo-inc.com>
Committed: Wed Jan 20 09:55:24 2016 -0600
----------------------------------------------------------------------
.../src/clj/org/apache/storm/LocalDRPC.clj | 4 +-
.../src/clj/org/apache/storm/blobstore.clj | 6 +--
.../org/apache/storm/command/config_value.clj | 5 ++-
.../org/apache/storm/command/dev_zookeeper.clj | 3 +-
.../org/apache/storm/command/healthcheck.clj | 8 ++--
.../clj/org/apache/storm/command/heartbeats.clj | 9 +++--
.../org/apache/storm/command/kill_workers.clj | 3 +-
.../apache/storm/command/shell_submission.clj | 3 +-
.../clj/org/apache/storm/daemon/logviewer.clj | 6 +--
.../src/clj/org/apache/storm/daemon/nimbus.clj | 2 +-
.../clj/org/apache/storm/daemon/supervisor.clj | 2 +-
.../src/clj/org/apache/storm/daemon/worker.clj | 2 +-
.../org/apache/storm/pacemaker/pacemaker.clj | 4 +-
storm-core/src/clj/org/apache/storm/testing.clj | 6 +--
storm-core/src/clj/org/apache/storm/thrift.clj | 6 +--
storm-core/src/clj/org/apache/storm/ui/core.clj | 4 +-
.../test/clj/org/apache/storm/nimbus_test.clj | 12 +++---
.../apache/storm/security/auth/auth_test.clj | 42 ++++++++++----------
.../storm/security/auth/drpc_auth_test.clj | 8 ++--
.../storm/security/auth/nimbus_auth_test.clj | 12 +++---
.../test/clj/org/apache/storm/utils_test.clj | 3 +-
21 files changed, 79 insertions(+), 71 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/storm/blob/f350f1ae/storm-core/src/clj/org/apache/storm/LocalDRPC.clj
----------------------------------------------------------------------
diff --git a/storm-core/src/clj/org/apache/storm/LocalDRPC.clj b/storm-core/src/clj/org/apache/storm/LocalDRPC.clj
index 21b2bd3..5f2c22f 100644
--- a/storm-core/src/clj/org/apache/storm/LocalDRPC.clj
+++ b/storm-core/src/clj/org/apache/storm/LocalDRPC.clj
@@ -17,7 +17,7 @@
(ns org.apache.storm.LocalDRPC
(:require [org.apache.storm.daemon [drpc :as drpc]])
(:use [org.apache.storm config util])
- (:import [org.apache.storm.utils InprocMessaging ServiceRegistry])
+ (:import [org.apache.storm.utils InprocMessaging ServiceRegistry ConfigUtils])
(:gen-class
:init init
:implements [org.apache.storm.ILocalDRPC]
@@ -25,7 +25,7 @@
:state state ))
(defn -init []
- (let [handler (drpc/service-handler (read-storm-config))
+ (let [handler (drpc/service-handler (clojurify-structure (ConfigUtils/readStormConfig)))
id (ServiceRegistry/registerService handler)
]
[[] {:service-id id :handler handler}]
http://git-wip-us.apache.org/repos/asf/storm/blob/f350f1ae/storm-core/src/clj/org/apache/storm/blobstore.clj
----------------------------------------------------------------------
diff --git a/storm-core/src/clj/org/apache/storm/blobstore.clj b/storm-core/src/clj/org/apache/storm/blobstore.clj
index 0b1c994..92fb44f 100644
--- a/storm-core/src/clj/org/apache/storm/blobstore.clj
+++ b/storm-core/src/clj/org/apache/storm/blobstore.clj
@@ -15,13 +15,13 @@
;; limitations under the License.
(ns org.apache.storm.blobstore
- (:import [org.apache.storm.utils Utils])
+ (:import [org.apache.storm.utils Utils ConfigUtils])
(:import [org.apache.storm.blobstore ClientBlobStore])
- (:use [org.apache.storm config]))
+ (:use [org.apache.storm config util]))
(defmacro with-configured-blob-client
[client-sym & body]
- `(let [conf# (read-storm-config)
+ `(let [conf# (clojurify-structure (ConfigUtils/readStormConfig))
^ClientBlobStore ~client-sym (Utils/getClientBlobStore conf#)]
(try
~@body
http://git-wip-us.apache.org/repos/asf/storm/blob/f350f1ae/storm-core/src/clj/org/apache/storm/command/config_value.clj
----------------------------------------------------------------------
diff --git a/storm-core/src/clj/org/apache/storm/command/config_value.clj b/storm-core/src/clj/org/apache/storm/command/config_value.clj
index 9bc3e92..5ed7309 100644
--- a/storm-core/src/clj/org/apache/storm/command/config_value.clj
+++ b/storm-core/src/clj/org/apache/storm/command/config_value.clj
@@ -14,11 +14,12 @@
;; See the License for the specific language governing permissions and
;; limitations under the License.
(ns org.apache.storm.command.config-value
- (:use [org.apache.storm config log])
+ (:use [org.apache.storm config log util])
+ (:import [org.apache.storm.utils ConfigUtils])
(:gen-class))
(defn -main [^String name]
- (let [conf (read-storm-config)]
+ (let [conf (clojurify-structure (ConfigUtils/readStormConfig))]
(println "VALUE:" (conf name))
))
http://git-wip-us.apache.org/repos/asf/storm/blob/f350f1ae/storm-core/src/clj/org/apache/storm/command/dev_zookeeper.clj
----------------------------------------------------------------------
diff --git a/storm-core/src/clj/org/apache/storm/command/dev_zookeeper.clj b/storm-core/src/clj/org/apache/storm/command/dev_zookeeper.clj
index 96de02d..b781e1c 100644
--- a/storm-core/src/clj/org/apache/storm/command/dev_zookeeper.clj
+++ b/storm-core/src/clj/org/apache/storm/command/dev_zookeeper.clj
@@ -15,10 +15,11 @@
;; limitations under the License.
(ns org.apache.storm.command.dev-zookeeper
(:use [org.apache.storm zookeeper util config])
+ (:import [org.apache.storm.utils ConfigUtils])
(:gen-class))
(defn -main [& args]
- (let [conf (read-storm-config)
+ (let [conf (clojurify-structure (ConfigUtils/readStormConfig))
port (conf STORM-ZOOKEEPER-PORT)
localpath (conf DEV-ZOOKEEPER-PATH)]
(rmr localpath)
http://git-wip-us.apache.org/repos/asf/storm/blob/f350f1ae/storm-core/src/clj/org/apache/storm/command/healthcheck.clj
----------------------------------------------------------------------
diff --git a/storm-core/src/clj/org/apache/storm/command/healthcheck.clj b/storm-core/src/clj/org/apache/storm/command/healthcheck.clj
index d96d7b3..f64be92 100644
--- a/storm-core/src/clj/org/apache/storm/command/healthcheck.clj
+++ b/storm-core/src/clj/org/apache/storm/command/healthcheck.clj
@@ -15,10 +15,12 @@
;; limitations under the License.
(ns org.apache.storm.command.healthcheck
(:require [org.apache.storm
- [config :refer :all]
- [log :refer :all]]
+ [config :refer :all]
+ [util :refer :all]
+ [log :refer :all]]
[clojure.java [io :as io]]
[clojure [string :refer [split]]])
+ (:import [org.apache.storm.utils ConfigUtils])
(:gen-class))
(defn interrupter
@@ -83,6 +85,6 @@
1)))
(defn -main [& args]
- (let [conf (read-storm-config)]
+ (let [conf (clojurify-structure (ConfigUtils/readStormConfig))]
(System/exit
(health-check conf))))
http://git-wip-us.apache.org/repos/asf/storm/blob/f350f1ae/storm-core/src/clj/org/apache/storm/command/heartbeats.clj
----------------------------------------------------------------------
diff --git a/storm-core/src/clj/org/apache/storm/command/heartbeats.clj b/storm-core/src/clj/org/apache/storm/command/heartbeats.clj
index ff28cba..be8d030 100644
--- a/storm-core/src/clj/org/apache/storm/command/heartbeats.clj
+++ b/storm-core/src/clj/org/apache/storm/command/heartbeats.clj
@@ -17,20 +17,21 @@
(:require [org.apache.storm
[config :refer :all]
[log :refer :all]
+ [util :refer :all]
[cluster :refer :all]
[converter :refer :all]]
- [clojure.string :refer :all])
+ [clojure.string :as string])
(:import [org.apache.storm.generated ClusterWorkerHeartbeat]
- [org.apache.storm.utils Utils])
+ [org.apache.storm.utils Utils ConfigUtils])
(:gen-class))
(defn -main [command path & args]
- (let [conf (read-storm-config)
+ (let [conf (clojurify-structure (ConfigUtils/readStormConfig))
cluster (mk-distributed-cluster-state conf :auth-conf conf)]
(println "Command: [" command "]")
(condp = command
"list"
- (let [message (join " \n" (.get_worker_hb_children cluster path false))]
+ (let [message (clojure.string/join " \n" (.get_worker_hb_children cluster path false))]
(log-message "list " path ":\n"
message "\n"))
"get"
http://git-wip-us.apache.org/repos/asf/storm/blob/f350f1ae/storm-core/src/clj/org/apache/storm/command/kill_workers.clj
----------------------------------------------------------------------
diff --git a/storm-core/src/clj/org/apache/storm/command/kill_workers.clj b/storm-core/src/clj/org/apache/storm/command/kill_workers.clj
index 2670735..4e713f9 100644
--- a/storm-core/src/clj/org/apache/storm/command/kill_workers.clj
+++ b/storm-core/src/clj/org/apache/storm/command/kill_workers.clj
@@ -19,12 +19,13 @@
(:use [org.apache.storm util config])
(:require [org.apache.storm.daemon
[supervisor :as supervisor]])
+ (:import [org.apache.storm.utils ConfigUtils])
(:gen-class))
(defn -main
"Construct the supervisor-data from scratch and kill the workers on this supervisor"
[& args]
- (let [conf (read-storm-config)
+ (let [conf (clojurify-structure (ConfigUtils/readStormConfig))
conf (assoc conf STORM-LOCAL-DIR (. (File. (conf STORM-LOCAL-DIR)) getCanonicalPath))
isupervisor (supervisor/standalone-supervisor)
supervisor-data (supervisor/supervisor-data conf nil isupervisor)
http://git-wip-us.apache.org/repos/asf/storm/blob/f350f1ae/storm-core/src/clj/org/apache/storm/command/shell_submission.clj
----------------------------------------------------------------------
diff --git a/storm-core/src/clj/org/apache/storm/command/shell_submission.clj b/storm-core/src/clj/org/apache/storm/command/shell_submission.clj
index b09c4f7..5404849 100644
--- a/storm-core/src/clj/org/apache/storm/command/shell_submission.clj
+++ b/storm-core/src/clj/org/apache/storm/command/shell_submission.clj
@@ -17,11 +17,12 @@
(:import [org.apache.storm StormSubmitter])
(:use [org.apache.storm thrift util config log zookeeper])
(:require [clojure.string :as str])
+ (:import [org.apache.storm.utils ConfigUtils])
(:gen-class))
(defn -main [^String tmpjarpath & args]
- (let [conf (read-storm-config)
+ (let [conf (clojurify-structure (ConfigUtils/readStormConfig))
zk-leader-elector (zk-leader-elector conf)
leader-nimbus (.getLeader zk-leader-elector)
host (.getHost leader-nimbus)
http://git-wip-us.apache.org/repos/asf/storm/blob/f350f1ae/storm-core/src/clj/org/apache/storm/daemon/logviewer.clj
----------------------------------------------------------------------
diff --git a/storm-core/src/clj/org/apache/storm/daemon/logviewer.clj b/storm-core/src/clj/org/apache/storm/daemon/logviewer.clj
index 39a9c12..4f4ff0d 100644
--- a/storm-core/src/clj/org/apache/storm/daemon/logviewer.clj
+++ b/storm-core/src/clj/org/apache/storm/daemon/logviewer.clj
@@ -20,7 +20,7 @@
(:use [hiccup core page-helpers form-helpers])
(:use [org.apache.storm config util log timer])
(:use [org.apache.storm.ui helpers])
- (:import [org.apache.storm.utils Utils VersionInfo])
+ (:import [org.apache.storm.utils Utils VersionInfo ConfigUtils])
(:import [org.slf4j LoggerFactory])
(:import [java.util Arrays ArrayList HashSet])
(:import [java.util.zip GZIPInputStream])
@@ -48,7 +48,7 @@
(:use [org.apache.storm.daemon.common :only [start-metrics-reporters]])
(:gen-class))
-(def ^:dynamic *STORM-CONF* (read-storm-config))
+(def ^:dynamic *STORM-CONF* (clojurify-structure (ConfigUtils/readStormConfig)))
(def STORM-VERSION (VersionInfo/getVersion))
(defmeter logviewer:num-log-page-http-requests)
@@ -1187,7 +1187,7 @@
(log-error ex))))
(defn -main []
- (let [conf (read-storm-config)
+ (let [conf (clojurify-structure (ConfigUtils/readStormConfig))
log-root (worker-artifacts-root conf)
daemonlog-root (log-root-dir (conf LOGVIEWER-APPENDER-NAME))]
(setup-default-uncaught-exception-handler)
http://git-wip-us.apache.org/repos/asf/storm/blob/f350f1ae/storm-core/src/clj/org/apache/storm/daemon/nimbus.clj
----------------------------------------------------------------------
diff --git a/storm-core/src/clj/org/apache/storm/daemon/nimbus.clj b/storm-core/src/clj/org/apache/storm/daemon/nimbus.clj
index 163f301..86e93b4 100644
--- a/storm-core/src/clj/org/apache/storm/daemon/nimbus.clj
+++ b/storm-core/src/clj/org/apache/storm/daemon/nimbus.clj
@@ -2226,7 +2226,7 @@
(defn -launch [nimbus]
(let [conf (merge
- (read-storm-config)
+ (clojurify-structure (ConfigUtils/readStormConfig))
(read-yaml-config "storm-cluster-auth.yaml" false))]
(launch-server! conf nimbus)))
http://git-wip-us.apache.org/repos/asf/storm/blob/f350f1ae/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 c01ea62..2c492e3 100644
--- a/storm-core/src/clj/org/apache/storm/daemon/supervisor.clj
+++ b/storm-core/src/clj/org/apache/storm/daemon/supervisor.clj
@@ -1181,7 +1181,7 @@
(defn -launch
[supervisor]
(log-message "Starting supervisor for storm version '" STORM-VERSION "'")
- (let [conf (read-storm-config)]
+ (let [conf (clojurify-structure (ConfigUtils/readStormConfig))]
(validate-distributed-mode! conf)
(let [supervisor (mk-supervisor conf nil supervisor)]
(add-shutdown-hook-with-force-kill-in-1-sec #(.shutdown supervisor)))
http://git-wip-us.apache.org/repos/asf/storm/blob/f350f1ae/storm-core/src/clj/org/apache/storm/daemon/worker.clj
----------------------------------------------------------------------
diff --git a/storm-core/src/clj/org/apache/storm/daemon/worker.clj b/storm-core/src/clj/org/apache/storm/daemon/worker.clj
index aea4372..d4d66dc 100644
--- a/storm-core/src/clj/org/apache/storm/daemon/worker.clj
+++ b/storm-core/src/clj/org/apache/storm/daemon/worker.clj
@@ -756,7 +756,7 @@
(fn [] (exit-process! 1 "Worker died")))
(defn -main [storm-id assignment-id port-str worker-id]
- (let [conf (read-storm-config)]
+ (let [conf (clojurify-structure (ConfigUtils/readStormConfig))]
(setup-default-uncaught-exception-handler)
(validate-distributed-mode! conf)
(let [worker (mk-worker conf nil storm-id assignment-id (Integer/parseInt port-str) worker-id)]
http://git-wip-us.apache.org/repos/asf/storm/blob/f350f1ae/storm-core/src/clj/org/apache/storm/pacemaker/pacemaker.clj
----------------------------------------------------------------------
diff --git a/storm-core/src/clj/org/apache/storm/pacemaker/pacemaker.clj b/storm-core/src/clj/org/apache/storm/pacemaker/pacemaker.clj
index 70313e4..c38eadf 100644
--- a/storm-core/src/clj/org/apache/storm/pacemaker/pacemaker.clj
+++ b/storm-core/src/clj/org/apache/storm/pacemaker/pacemaker.clj
@@ -20,7 +20,7 @@
[java.util.concurrent.atomic AtomicInteger]
[org.apache.storm.generated HBNodes
HBServerMessageType HBMessage HBMessageData HBPulse]
- [org.apache.storm.utils VersionInfo])
+ [org.apache.storm.utils VersionInfo ConfigUtils])
(:use [clojure.string :only [replace-first split]]
[org.apache.storm log config util])
(:require [clojure.java.jmx :as jmx])
@@ -233,7 +233,7 @@
(log-message "Starting pacemaker server for storm version '"
STORM-VERSION
"'")
- (let [conf (override-login-config-with-system-property (read-storm-config))]
+ (let [conf (override-login-config-with-system-property (clojurify-structure (ConfigUtils/readStormConfig)))]
(PacemakerServer. (mk-handler conf) conf)))
(defn -main []
http://git-wip-us.apache.org/repos/asf/storm/blob/f350f1ae/storm-core/src/clj/org/apache/storm/testing.clj
----------------------------------------------------------------------
diff --git a/storm-core/src/clj/org/apache/storm/testing.clj b/storm-core/src/clj/org/apache/storm/testing.clj
index 87ca2de..48d63aa 100644
--- a/storm-core/src/clj/org/apache/storm/testing.clj
+++ b/storm-core/src/clj/org/apache/storm/testing.clj
@@ -27,7 +27,7 @@
(:import [java.util HashMap ArrayList])
(:import [java.util.concurrent.atomic AtomicInteger])
(:import [java.util.concurrent ConcurrentHashMap])
- (:import [org.apache.storm.utils Time Utils RegisteredGlobalState])
+ (:import [org.apache.storm.utils Time Utils RegisteredGlobalState ConfigUtils])
(:import [org.apache.storm.tuple Fields Tuple TupleImpl])
(:import [org.apache.storm.task TopologyContext])
(:import [org.apache.storm.generated GlobalStreamId Bolt KillOptions])
@@ -135,7 +135,7 @@
(let [zk-tmp (local-temp-path)
[zk-port zk-handle] (if-not (contains? daemon-conf STORM-ZOOKEEPER-SERVERS)
(zk/mk-inprocess-zookeeper zk-tmp))
- daemon-conf (merge (read-storm-config)
+ daemon-conf (merge (clojurify-structure (ConfigUtils/readStormConfig))
{TOPOLOGY-SKIP-MISSING-KRYO-REGISTRATIONS true
ZMQ-LINGER-MILLIS 0
TOPOLOGY-ENABLE-MESSAGE-TIMEOUTS false
@@ -676,7 +676,7 @@
topology (StormTopology. {component spout-spec} {} {})
context (TopologyContext.
topology
- (read-storm-config)
+ (clojurify-structure (ConfigUtils/readStormConfig))
{(int 1) component}
{component [(int 1)]}
{component {stream (Fields. fields)}}
http://git-wip-us.apache.org/repos/asf/storm/blob/f350f1ae/storm-core/src/clj/org/apache/storm/thrift.clj
----------------------------------------------------------------------
diff --git a/storm-core/src/clj/org/apache/storm/thrift.clj b/storm-core/src/clj/org/apache/storm/thrift.clj
index 47e233a..b5af521 100644
--- a/storm-core/src/clj/org/apache/storm/thrift.clj
+++ b/storm-core/src/clj/org/apache/storm/thrift.clj
@@ -23,7 +23,7 @@
ComponentCommon Grouping$_Fields SpoutSpec NullStruct StreamInfo
GlobalStreamId ComponentObject ComponentObject$_Fields
ShellComponent SupervisorInfo])
- (:import [org.apache.storm.utils Utils NimbusClient])
+ (:import [org.apache.storm.utils Utils NimbusClient ConfigUtils])
(:import [org.apache.storm Constants])
(:import [org.apache.storm.security.auth ReqContext])
(:import [org.apache.storm.grouping CustomStreamGrouping])
@@ -73,7 +73,7 @@
(nimbus-client-and-conn host port nil))
([host port as-user]
(log-message "Connecting to Nimbus at " host ":" port " as user: " as-user)
- (let [conf (read-storm-config)
+ (let [conf (clojurify-structure (ConfigUtils/readStormConfig))
nimbusClient (NimbusClient. conf host port nil as-user)
client (.getClient nimbusClient)
transport (.transport nimbusClient)]
@@ -88,7 +88,7 @@
(defmacro with-configured-nimbus-connection
[client-sym & body]
- `(let [conf# (read-storm-config)
+ `(let [conf# (clojurify-structure (ConfigUtils/readStormConfig))
context# (ReqContext/context)
user# (if (.principal context#) (.getName (.principal context#)))
nimbusClient# (NimbusClient/getConfiguredClientAs conf# user#)
http://git-wip-us.apache.org/repos/asf/storm/blob/f350f1ae/storm-core/src/clj/org/apache/storm/ui/core.clj
----------------------------------------------------------------------
diff --git a/storm-core/src/clj/org/apache/storm/ui/core.clj b/storm-core/src/clj/org/apache/storm/ui/core.clj
index b309b2c..6d6fe6b 100644
--- a/storm-core/src/clj/org/apache/storm/ui/core.clj
+++ b/storm-core/src/clj/org/apache/storm/ui/core.clj
@@ -41,7 +41,7 @@
(:import [org.apache.storm.security.auth AuthUtils ReqContext])
(:import [org.apache.storm.generated AuthorizationException ProfileRequest ProfileAction NodeInfo])
(:import [org.apache.storm.security.auth AuthUtils])
- (:import [org.apache.storm.utils VersionInfo])
+ (:import [org.apache.storm.utils VersionInfo ConfigUtils])
(:import [org.apache.storm Config])
(:import [java.io File])
(:require [compojure.route :as route]
@@ -53,7 +53,7 @@
(:import [org.apache.logging.log4j Level])
(:gen-class))
-(def ^:dynamic *STORM-CONF* (read-storm-config))
+(def ^:dynamic *STORM-CONF* (clojurify-structure (ConfigUtils/readStormConfig)))
(def ^:dynamic *UI-ACL-HANDLER* (mk-authorization-handler (*STORM-CONF* NIMBUS-AUTHORIZER) *STORM-CONF*))
(def ^:dynamic *UI-IMPERSONATION-HANDLER* (mk-authorization-handler (*STORM-CONF* NIMBUS-IMPERSONATION-AUTHORIZER) *STORM-CONF*))
(def http-creds-handler (AuthUtils/GetUiHttpCredentialsPlugin *STORM-CONF*))
http://git-wip-us.apache.org/repos/asf/storm/blob/f350f1ae/storm-core/test/clj/org/apache/storm/nimbus_test.clj
----------------------------------------------------------------------
diff --git a/storm-core/test/clj/org/apache/storm/nimbus_test.clj b/storm-core/test/clj/org/apache/storm/nimbus_test.clj
index 6b51d3c..9d68bc8 100644
--- a/storm-core/test/clj/org/apache/storm/nimbus_test.clj
+++ b/storm-core/test/clj/org/apache/storm/nimbus_test.clj
@@ -29,7 +29,7 @@
LogConfig LogLevel LogLevelAction])
(:import [java.util HashMap])
(:import [java.io File])
- (:import [org.apache.storm.utils Time Utils])
+ (:import [org.apache.storm.utils Time Utils ConfigUtils])
(:import [org.apache.commons.io FileUtils])
(:use [org.apache.storm testing MockAutoCred util config log timer zookeeper])
(:use [org.apache.storm.daemon common])
@@ -1020,7 +1020,7 @@
(with-local-tmp [nimbus-dir]
(stubbing [zk-leader-elector (mock-leader-elector)]
(letlocals
- (bind conf (merge (read-storm-config)
+ (bind conf (merge (clojurify-structure (ConfigUtils/readStormConfig))
{STORM-ZOOKEEPER-SERVERS ["localhost"]
STORM-CLUSTER-MODE "local"
STORM-ZOOKEEPER-PORT zk-port
@@ -1091,7 +1091,7 @@
(with-local-tmp [nimbus-dir]
(stubbing [zk-leader-elector (mock-leader-elector)]
(letlocals
- (bind conf (merge (read-storm-config)
+ (bind conf (merge (clojurify-structure (ConfigUtils/readStormConfig))
{STORM-ZOOKEEPER-SERVERS ["localhost"]
STORM-CLUSTER-MODE "local"
STORM-ZOOKEEPER-PORT zk-port
@@ -1334,7 +1334,7 @@
(testing "nimbus-data uses correct ACLs"
(let [scheme "digest"
digest "storm:thisisapoorpassword"
- auth-conf (merge (read-storm-config)
+ auth-conf (merge (clojurify-structure (ConfigUtils/readStormConfig))
{STORM-ZOOKEEPER-AUTH-SCHEME scheme
STORM-ZOOKEEPER-AUTH-PAYLOAD digest
STORM-PRINCIPAL-TO-LOCAL-PLUGIN "org.apache.storm.security.auth.DefaultPrincipalToLocal"
@@ -1381,7 +1381,7 @@
(with-inprocess-zookeeper zk-port
(with-local-tmp [nimbus-dir]
(letlocals
- (bind conf (merge (read-storm-config)
+ (bind conf (merge (clojurify-structure (ConfigUtils/readStormConfig))
{STORM-ZOOKEEPER-SERVERS ["localhost"]
STORM-CLUSTER-MODE "local"
STORM-ZOOKEEPER-PORT zk-port
@@ -1411,7 +1411,7 @@
(with-local-tmp [nimbus-dir]
(stubbing [zk-leader-elector (mock-leader-elector)]
(letlocals
- (bind conf (merge (read-storm-config)
+ (bind conf (merge (clojurify-structure (ConfigUtils/readStormConfig))
{STORM-ZOOKEEPER-SERVERS ["localhost"]
STORM-CLUSTER-MODE "local"
STORM-ZOOKEEPER-PORT zk-port
http://git-wip-us.apache.org/repos/asf/storm/blob/f350f1ae/storm-core/test/clj/org/apache/storm/security/auth/auth_test.clj
----------------------------------------------------------------------
diff --git a/storm-core/test/clj/org/apache/storm/security/auth/auth_test.clj b/storm-core/test/clj/org/apache/storm/security/auth/auth_test.clj
index 5643db1..9108f1a 100644
--- a/storm-core/test/clj/org/apache/storm/security/auth/auth_test.clj
+++ b/storm-core/test/clj/org/apache/storm/security/auth/auth_test.clj
@@ -26,7 +26,7 @@
(:import [java.net InetAddress])
(:import [org.apache.storm Config])
(:import [org.apache.storm.generated AuthorizationException])
- (:import [org.apache.storm.utils NimbusClient])
+ (:import [org.apache.storm.utils NimbusClient ConfigUtils])
(:import [org.apache.storm.security.auth.authorizer SimpleWhitelistAuthorizer SimpleACLAuthorizer])
(:import [org.apache.storm.security.auth AuthUtils ThriftServer ThriftClient ShellBasedGroupsMapping
ReqContext SimpleTransportPlugin KerberosPrincipalToLocal ThriftConnectionType])
@@ -124,7 +124,7 @@
(defn launch-server [server-port login-cfg aznClass transportPluginClass serverConf]
- (let [conf1 (merge (read-storm-config)
+ (let [conf1 (merge (clojurify-structure (ConfigUtils/readStormConfig))
{NIMBUS-AUTHORIZER aznClass
NIMBUS-THRIFT-PORT server-port
STORM-THRIFT-TRANSPORT-PLUGIN transportPluginClass})
@@ -157,14 +157,14 @@
(deftest Simple-authentication-test
(let [a-port (available-port)]
(with-server [a-port nil nil "org.apache.storm.security.auth.SimpleTransportPlugin" nil]
- (let [storm-conf (merge (read-storm-config)
+ (let [storm-conf (merge (clojurify-structure (ConfigUtils/readStormConfig))
{STORM-THRIFT-TRANSPORT-PLUGIN "org.apache.storm.security.auth.SimpleTransportPlugin"})
client (NimbusClient. storm-conf "localhost" a-port nimbus-timeout)
nimbus_client (.getClient client)]
(.activate nimbus_client "security_auth_test_topology")
(.close client))
- (let [storm-conf (merge (read-storm-config)
+ (let [storm-conf (merge (clojurify-structure (ConfigUtils/readStormConfig))
{STORM-THRIFT-TRANSPORT-PLUGIN "org.apache.storm.security.auth.digest.DigestSaslTransportPlugin"
"java.security.auth.login.config" "test/clj/org/apache/storm/security/auth/jaas_digest.conf"
STORM-NIMBUS-RETRY-TIMES 0})]
@@ -177,7 +177,7 @@
(with-server [a-port nil
"org.apache.storm.security.auth.authorizer.SimpleWhitelistAuthorizer"
"org.apache.storm.testing.SingleUserSimpleTransport" nil]
- (let [storm-conf (merge (read-storm-config)
+ (let [storm-conf (merge (clojurify-structure (ConfigUtils/readStormConfig))
{STORM-THRIFT-TRANSPORT-PLUGIN "org.apache.storm.testing.SingleUserSimpleTransport"})
client (NimbusClient. storm-conf "localhost" a-port nimbus-timeout)
nimbus_client (.getClient client)]
@@ -191,7 +191,7 @@
(with-server [a-port nil
"org.apache.storm.security.auth.authorizer.SimpleWhitelistAuthorizer"
"org.apache.storm.testing.SingleUserSimpleTransport" {SimpleWhitelistAuthorizer/WHITELIST_USERS_CONF ["user"]}]
- (let [storm-conf (merge (read-storm-config)
+ (let [storm-conf (merge (clojurify-structure (ConfigUtils/readStormConfig))
{STORM-THRIFT-TRANSPORT-PLUGIN "org.apache.storm.testing.SingleUserSimpleTransport"})
client (NimbusClient. storm-conf "localhost" a-port nimbus-timeout)
nimbus_client (.getClient client)]
@@ -200,7 +200,7 @@
(.close client)))))
(deftest simple-acl-user-auth-test
- (let [cluster-conf (merge (read-storm-config)
+ (let [cluster-conf (merge (clojurify-structure (ConfigUtils/readStormConfig))
{NIMBUS-ADMINS ["admin"]
NIMBUS-SUPERVISOR-USERS ["supervisor"]})
authorizer (SimpleACLAuthorizer. )
@@ -281,7 +281,7 @@
))
(deftest simple-acl-nimbus-users-auth-test
- (let [cluster-conf (merge (read-storm-config)
+ (let [cluster-conf (merge (clojurify-structure (ConfigUtils/readStormConfig))
{NIMBUS-ADMINS ["admin"]
NIMBUS-SUPERVISOR-USERS ["supervisor"]
NIMBUS-USERS ["user-a"]})
@@ -297,7 +297,7 @@
(is (= true (.permit authorizer (ReqContext. supervisor-user) "fileDownload" nil)))))
(deftest shell-based-groups-mapping-test
- (let [cluster-conf (read-storm-config)
+ (let [cluster-conf (clojurify-structure (ConfigUtils/readStormConfig))
groups (ShellBasedGroupsMapping. )
user-name (System/getProperty "user.name")]
(.prepare groups cluster-conf)
@@ -306,7 +306,7 @@
(is (= 0 (.size (.getGroups groups nil))))))
(deftest simple-acl-same-user-auth-test
- (let [cluster-conf (merge (read-storm-config)
+ (let [cluster-conf (merge (clojurify-structure (ConfigUtils/readStormConfig))
{NIMBUS-ADMINS ["admin"]
NIMBUS-SUPERVISOR-USERS ["admin"]})
authorizer (SimpleACLAuthorizer. )
@@ -334,7 +334,7 @@
(with-server [a-port nil
"org.apache.storm.security.auth.authorizer.NoopAuthorizer"
"org.apache.storm.security.auth.SimpleTransportPlugin" nil]
- (let [storm-conf (merge (read-storm-config)
+ (let [storm-conf (merge (clojurify-structure (ConfigUtils/readStormConfig))
{STORM-THRIFT-TRANSPORT-PLUGIN "org.apache.storm.security.auth.SimpleTransportPlugin"})
client (NimbusClient. storm-conf "localhost" a-port nimbus-timeout)
nimbus_client (.getClient client)]
@@ -347,7 +347,7 @@
(with-server [a-port nil
"org.apache.storm.security.auth.authorizer.DenyAuthorizer"
"org.apache.storm.security.auth.SimpleTransportPlugin" nil]
- (let [storm-conf (merge (read-storm-config)
+ (let [storm-conf (merge (clojurify-structure (ConfigUtils/readStormConfig))
{STORM-THRIFT-TRANSPORT-PLUGIN "org.apache.storm.security.auth.SimpleTransportPlugin"
Config/NIMBUS_THRIFT_PORT a-port
Config/NIMBUS_TASK_TIMEOUT_SECS nimbus-timeout})
@@ -364,7 +364,7 @@
"test/clj/org/apache/storm/security/auth/jaas_digest.conf"
nil
"org.apache.storm.security.auth.digest.DigestSaslTransportPlugin" nil]
- (let [storm-conf (merge (read-storm-config)
+ (let [storm-conf (merge (clojurify-structure (ConfigUtils/readStormConfig))
{STORM-THRIFT-TRANSPORT-PLUGIN "org.apache.storm.security.auth.digest.DigestSaslTransportPlugin"
"java.security.auth.login.config" "test/clj/org/apache/storm/security/auth/jaas_digest.conf"
STORM-NIMBUS-RETRY-TIMES 0})
@@ -374,7 +374,7 @@
(.activate nimbus_client "security_auth_test_topology"))
(.close client))
- (let [storm-conf (merge (read-storm-config)
+ (let [storm-conf (merge (clojurify-structure (ConfigUtils/readStormConfig))
{STORM-THRIFT-TRANSPORT-PLUGIN "org.apache.storm.security.auth.SimpleTransportPlugin"
STORM-NIMBUS-RETRY-TIMES 0})
client (NimbusClient. storm-conf "localhost" a-port nimbus-timeout)
@@ -384,7 +384,7 @@
(.activate nimbus_client "security_auth_test_topology"))))
(.close client))
- (let [storm-conf (merge (read-storm-config)
+ (let [storm-conf (merge (clojurify-structure (ConfigUtils/readStormConfig))
{STORM-THRIFT-TRANSPORT-PLUGIN "org.apache.storm.security.auth.digest.DigestSaslTransportPlugin"
"java.security.auth.login.config" "test/clj/org/apache/storm/security/auth/jaas_digest_bad_password.conf"
STORM-NIMBUS-RETRY-TIMES 0})]
@@ -392,7 +392,7 @@
(is (thrown-cause? TTransportException
(NimbusClient. storm-conf "localhost" a-port nimbus-timeout)))))
- (let [storm-conf (merge (read-storm-config)
+ (let [storm-conf (merge (clojurify-structure (ConfigUtils/readStormConfig))
{STORM-THRIFT-TRANSPORT-PLUGIN "org.apache.storm.security.auth.digest.DigestSaslTransportPlugin"
"java.security.auth.login.config" "test/clj/org/apache/storm/security/auth/jaas_digest_unknown_user.conf"
STORM-NIMBUS-RETRY-TIMES 0})]
@@ -400,7 +400,7 @@
(is (thrown-cause? TTransportException
(NimbusClient. storm-conf "localhost" a-port nimbus-timeout)))))
- (let [storm-conf (merge (read-storm-config)
+ (let [storm-conf (merge (clojurify-structure (ConfigUtils/readStormConfig))
{STORM-THRIFT-TRANSPORT-PLUGIN "org.apache.storm.security.auth.digest.DigestSaslTransportPlugin"
"java.security.auth.login.config" "test/clj/org/apache/storm/security/auth/nonexistent.conf"
STORM-NIMBUS-RETRY-TIMES 0})]
@@ -408,7 +408,7 @@
(is (thrown-cause? RuntimeException
(NimbusClient. storm-conf "localhost" a-port nimbus-timeout)))))
- (let [storm-conf (merge (read-storm-config)
+ (let [storm-conf (merge (clojurify-structure (ConfigUtils/readStormConfig))
{STORM-THRIFT-TRANSPORT-PLUGIN "org.apache.storm.security.auth.digest.DigestSaslTransportPlugin"
"java.security.auth.login.config" "test/clj/org/apache/storm/security/auth/jaas_digest_missing_client.conf"
STORM-NIMBUS-RETRY-TIMES 0})]
@@ -417,7 +417,7 @@
(NimbusClient. storm-conf "localhost" a-port nimbus-timeout))))))))
(deftest test-GetTransportPlugin-throws-RuntimeException
- (let [conf (merge (read-storm-config)
+ (let [conf (merge (clojurify-structure (ConfigUtils/readStormConfig))
{Config/STORM_THRIFT_TRANSPORT_PLUGIN "null.invalid"})]
(is (thrown-cause? RuntimeException (AuthUtils/GetTransportPlugin conf nil nil)))))
@@ -434,9 +434,9 @@
(let [impersonating-user "admin"
user-being-impersonated (System/getProperty "user.name")
groups (ShellBasedGroupsMapping.)
- _ (.prepare groups (read-storm-config))
+ _ (.prepare groups (clojurify-structure (ConfigUtils/readStormConfig)))
groups (.getGroups groups user-being-impersonated)
- cluster-conf (merge (read-storm-config)
+ cluster-conf (merge (clojurify-structure (ConfigUtils/readStormConfig))
{Config/NIMBUS_IMPERSONATION_ACL {impersonating-user {"hosts" [ (.getHostName (InetAddress/getLocalHost))]
"groups" groups}}})
authorizer (ImpersonationAuthorizer. )
http://git-wip-us.apache.org/repos/asf/storm/blob/f350f1ae/storm-core/test/clj/org/apache/storm/security/auth/drpc_auth_test.clj
----------------------------------------------------------------------
diff --git a/storm-core/test/clj/org/apache/storm/security/auth/drpc_auth_test.clj b/storm-core/test/clj/org/apache/storm/security/auth/drpc_auth_test.clj
index d6a431f..3250054 100644
--- a/storm-core/test/clj/org/apache/storm/security/auth/drpc_auth_test.clj
+++ b/storm-core/test/clj/org/apache/storm/security/auth/drpc_auth_test.clj
@@ -21,7 +21,7 @@
DistributedRPCInvocations$Processor])
(:import [org.apache.storm Config])
(:import [org.apache.storm.security.auth ReqContext SingleUserPrincipal ThriftServer ThriftConnectionType])
- (:import [org.apache.storm.utils DRPCClient])
+ (:import [org.apache.storm.utils DRPCClient ConfigUtils])
(:import [org.apache.storm.drpc DRPCInvocationsClient])
(:import [java.util.concurrent TimeUnit])
(:import [javax.security.auth Subject])
@@ -65,7 +65,7 @@
(deftest deny-drpc-test
(let [client-port (available-port)
invocations-port (available-port (inc client-port))
- storm-conf (read-storm-config)]
+ storm-conf (clojurify-structure (ConfigUtils/readStormConfig))]
(with-server [storm-conf "org.apache.storm.security.auth.authorizer.DenyAuthorizer"
nil nil client-port invocations-port]
(let [drpc (DRPCClient. storm-conf "localhost" client-port)
@@ -80,7 +80,7 @@
(deftest deny-drpc-digest-test
(let [client-port (available-port)
invocations-port (available-port (inc client-port))
- storm-conf (read-storm-config)]
+ storm-conf (clojurify-structure (ConfigUtils/readStormConfig))]
(with-server [storm-conf "org.apache.storm.security.auth.authorizer.DenyAuthorizer"
"org.apache.storm.security.auth.digest.DigestSaslTransportPlugin"
"test/clj/org/apache/storm/security/auth/jaas_digest.conf"
@@ -100,7 +100,7 @@
[[strict? alice-client bob-client charlie-client alice-invok charlie-invok] & body]
(let [client-port (available-port)
invocations-port (available-port (inc client-port))
- storm-conf (merge (read-storm-config)
+ storm-conf (merge (clojurify-structure (ConfigUtils/readStormConfig))
{DRPC-AUTHORIZER-ACL-STRICT strict?
DRPC-AUTHORIZER-ACL-FILENAME "drpc-simple-acl-test-scenario.yaml"
STORM-THRIFT-TRANSPORT-PLUGIN "org.apache.storm.security.auth.digest.DigestSaslTransportPlugin"})]
http://git-wip-us.apache.org/repos/asf/storm/blob/f350f1ae/storm-core/test/clj/org/apache/storm/security/auth/nimbus_auth_test.clj
----------------------------------------------------------------------
diff --git a/storm-core/test/clj/org/apache/storm/security/auth/nimbus_auth_test.clj b/storm-core/test/clj/org/apache/storm/security/auth/nimbus_auth_test.clj
index 5e1d1d4..361c4be 100644
--- a/storm-core/test/clj/org/apache/storm/security/auth/nimbus_auth_test.clj
+++ b/storm-core/test/clj/org/apache/storm/security/auth/nimbus_auth_test.clj
@@ -21,7 +21,7 @@
(:require [org.apache.storm.security.auth [auth-test :refer [nimbus-timeout]]])
(:import [java.nio ByteBuffer])
(:import [org.apache.storm Config])
- (:import [org.apache.storm.utils NimbusClient])
+ (:import [org.apache.storm.utils NimbusClient ConfigUtils])
(:import [org.apache.storm.generated NotAliveException])
(:import [org.apache.storm.security.auth AuthUtils ThriftServer ThriftClient
ReqContext ThriftConnectionType])
@@ -58,7 +58,7 @@
(deftest Simple-authentication-test
(let [port (available-port)]
(with-test-cluster [port nil nil "org.apache.storm.security.auth.SimpleTransportPlugin"]
- (let [storm-conf (merge (read-storm-config)
+ (let [storm-conf (merge (clojurify-structure (ConfigUtils/readStormConfig))
{STORM-THRIFT-TRANSPORT-PLUGIN "org.apache.storm.security.auth.SimpleTransportPlugin"
STORM-NIMBUS-RETRY-TIMES 0})
client (NimbusClient. storm-conf "localhost" port nimbus-timeout)
@@ -73,7 +73,7 @@
(with-test-cluster [port nil
"org.apache.storm.security.auth.authorizer.NoopAuthorizer"
"org.apache.storm.security.auth.SimpleTransportPlugin"]
- (let [storm-conf (merge (read-storm-config)
+ (let [storm-conf (merge (clojurify-structure (ConfigUtils/readStormConfig))
{STORM-THRIFT-TRANSPORT-PLUGIN "org.apache.storm.security.auth.SimpleTransportPlugin"
STORM-NIMBUS-RETRY-TIMES 0})
client (NimbusClient. storm-conf "localhost" port nimbus-timeout)
@@ -88,7 +88,7 @@
(with-test-cluster [port nil
"org.apache.storm.security.auth.authorizer.DenyAuthorizer"
"org.apache.storm.security.auth.SimpleTransportPlugin"]
- (let [storm-conf (merge (read-storm-config)
+ (let [storm-conf (merge (clojurify-structure (ConfigUtils/readStormConfig))
{STORM-THRIFT-TRANSPORT-PLUGIN "org.apache.storm.security.auth.SimpleTransportPlugin"
Config/NIMBUS_THRIFT_PORT port
STORM-NIMBUS-RETRY-TIMES 0})
@@ -127,7 +127,7 @@
"test/clj/org/apache/storm/security/auth/jaas_digest.conf"
"org.apache.storm.security.auth.authorizer.NoopAuthorizer"
"org.apache.storm.security.auth.digest.DigestSaslTransportPlugin"]
- (let [storm-conf (merge (read-storm-config)
+ (let [storm-conf (merge (clojurify-structure (ConfigUtils/readStormConfig))
{STORM-THRIFT-TRANSPORT-PLUGIN "org.apache.storm.security.auth.digest.DigestSaslTransportPlugin"
"java.security.auth.login.config" "test/clj/org/apache/storm/security/auth/jaas_digest.conf"
Config/NIMBUS_THRIFT_PORT port
@@ -145,7 +145,7 @@
"test/clj/org/apache/storm/security/auth/jaas_digest.conf"
"org.apache.storm.security.auth.authorizer.DenyAuthorizer"
"org.apache.storm.security.auth.digest.DigestSaslTransportPlugin"]
- (let [storm-conf (merge (read-storm-config)
+ (let [storm-conf (merge (clojurify-structure (ConfigUtils/readStormConfig))
{STORM-THRIFT-TRANSPORT-PLUGIN "org.apache.storm.security.auth.digest.DigestSaslTransportPlugin"
"java.security.auth.login.config" "test/clj/org/apache/storm/security/auth/jaas_digest.conf"
Config/NIMBUS_THRIFT_PORT port
http://git-wip-us.apache.org/repos/asf/storm/blob/f350f1ae/storm-core/test/clj/org/apache/storm/utils_test.clj
----------------------------------------------------------------------
diff --git a/storm-core/test/clj/org/apache/storm/utils_test.clj b/storm-core/test/clj/org/apache/storm/utils_test.clj
index f1f3fc7..cc78e74 100644
--- a/storm-core/test/clj/org/apache/storm/utils_test.clj
+++ b/storm-core/test/clj/org/apache/storm/utils_test.clj
@@ -18,6 +18,7 @@
(:import [org.apache.storm.utils NimbusClient Utils])
(:import [org.apache.curator.retry ExponentialBackoffRetry])
(:import [org.apache.thrift.transport TTransportException])
+ (:import [org.apache.storm.utils ConfigUtils])
(:use [org.apache.storm config util])
(:use [clojure test])
)
@@ -44,7 +45,7 @@
(deftest test-getConfiguredClient-throws-RunTimeException-on-bad-args
(let [storm-conf (merge
- (read-storm-config)
+ (clojurify-structure (ConfigUtils/readStormConfig))
{STORM-NIMBUS-RETRY-TIMES 0})]
(is (thrown-cause? TTransportException
(NimbusClient. storm-conf "" 65535)