Repository: storm Updated Branches: refs/heads/master 8aff56fb0 -> bb60f11c0
port dev_zookeeper.clj to java Project: http://git-wip-us.apache.org/repos/asf/storm/repo Commit: http://git-wip-us.apache.org/repos/asf/storm/commit/930014bf Tree: http://git-wip-us.apache.org/repos/asf/storm/tree/930014bf Diff: http://git-wip-us.apache.org/repos/asf/storm/diff/930014bf Branch: refs/heads/master Commit: 930014bf66e841c503f70185aec56ab708af88a2 Parents: 12ceb09 Author: xiaojian.fxj <[email protected]> Authored: Tue Feb 16 19:32:51 2016 +0800 Committer: xiaojian.fxj <[email protected]> Committed: Tue Feb 16 19:32:51 2016 +0800 ---------------------------------------------------------------------- bin/storm.cmd | 2 +- bin/storm.py | 2 +- .../org/apache/storm/command/dev_zookeeper.clj | 28 ---------------- storm-core/src/jvm/org/apache/storm/Config.java | 2 +- .../org/apache/storm/command/devZookeeper.java | 35 ++++++++++++++++++++ 5 files changed, 38 insertions(+), 31 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/storm/blob/930014bf/bin/storm.cmd ---------------------------------------------------------------------- diff --git a/bin/storm.cmd b/bin/storm.cmd index 6f4e934..8b89fd6 100644 --- a/bin/storm.cmd +++ b/bin/storm.cmd @@ -139,7 +139,7 @@ goto :eof :dev-zookeeper - set CLASS=org.apache.storm.command.dev_zookeeper + set CLASS=org.apache.storm.command.devZookeeper set STORM_OPTS=%STORM_SERVER_OPTS% %STORM_OPTS% goto :eof http://git-wip-us.apache.org/repos/asf/storm/blob/930014bf/bin/storm.py ---------------------------------------------------------------------- diff --git a/bin/storm.py b/bin/storm.py index f2aca95..0dfed26 100755 --- a/bin/storm.py +++ b/bin/storm.py @@ -651,7 +651,7 @@ def dev_zookeeper(): """ cppaths = [CLUSTER_CONF_DIR] exec_storm_class( - "org.apache.storm.command.dev_zookeeper", + "org.apache.storm.command.devZookeeper", jvmtype="-server", extrajars=[CLUSTER_CONF_DIR]) http://git-wip-us.apache.org/repos/asf/storm/blob/930014bf/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 deleted file mode 100644 index 657e242..0000000 --- a/storm-core/src/clj/org/apache/storm/command/dev_zookeeper.clj +++ /dev/null @@ -1,28 +0,0 @@ -;; Licensed to the Apache Software Foundation (ASF) under one -;; or more contributor license agreements. See the NOTICE file -;; distributed with this work for additional information -;; regarding copyright ownership. The ASF licenses this file -;; to you under the Apache License, Version 2.0 (the -;; "License"); you may not use this file except in compliance -;; with the License. You may obtain a copy of the License at -;; -;; http://www.apache.org/licenses/LICENSE-2.0 -;; -;; Unless required by applicable law or agreed to in writing, software -;; distributed under the License is distributed on an "AS IS" BASIS, -;; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -;; See the License for the specific language governing permissions and -;; limitations under the License. -(ns org.apache.storm.command.dev-zookeeper - (:import [org.apache.storm.utils Utils]) - (:use [org.apache.storm zookeeper util config]) - (:import [org.apache.storm.utils ConfigUtils]) - (:import [org.apache.storm.zookeeper Zookeeper]) - (:gen-class)) - -(defn -main [& args] - (let [conf (clojurify-structure (ConfigUtils/readStormConfig)) - port (conf STORM-ZOOKEEPER-PORT) - localpath (conf DEV-ZOOKEEPER-PATH)] - (Utils/forceDelete localpath) - (Zookeeper/mkInprocessZookeeper localpath port))) http://git-wip-us.apache.org/repos/asf/storm/blob/930014bf/storm-core/src/jvm/org/apache/storm/Config.java ---------------------------------------------------------------------- diff --git a/storm-core/src/jvm/org/apache/storm/Config.java b/storm-core/src/jvm/org/apache/storm/Config.java index 74231a0..951e524 100644 --- a/storm-core/src/jvm/org/apache/storm/Config.java +++ b/storm-core/src/jvm/org/apache/storm/Config.java @@ -2086,7 +2086,7 @@ public class Config extends HashMap<String, Object> { /** * The path to use as the zookeeper dir when running a zookeeper server via - * "storm dev-zookeeper". This zookeeper instance is only intended for development; + * "storm devZookeeper". This zookeeper instance is only intended for development; * it is not a production grade zookeeper setup. */ @isString http://git-wip-us.apache.org/repos/asf/storm/blob/930014bf/storm-core/src/jvm/org/apache/storm/command/devZookeeper.java ---------------------------------------------------------------------- diff --git a/storm-core/src/jvm/org/apache/storm/command/devZookeeper.java b/storm-core/src/jvm/org/apache/storm/command/devZookeeper.java new file mode 100644 index 0000000..e9ad554 --- /dev/null +++ b/storm-core/src/jvm/org/apache/storm/command/devZookeeper.java @@ -0,0 +1,35 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.storm.command; + +import org.apache.storm.Config; +import org.apache.storm.utils.ConfigUtils; +import org.apache.storm.utils.Utils; +import org.apache.storm.zookeeper.Zookeeper; + +import java.util.Map; + +public class devZookeeper { + public static void main(String[] args) throws Exception { + Map<String, Object> conf = ConfigUtils.readStormConfig(); + Object port = conf.get(Config.STORM_ZOOKEEPER_PORT); + String localPath = (String) conf.get(Config.DEV_ZOOKEEPER_PATH); + Utils.forceDelete(localPath); + Zookeeper.mkInprocessZookeeper(localPath, Utils.getInt(port)); + } +}
