Repository: storm
Updated Branches:
  refs/heads/master 5e5e83cab -> eb02edeaa


STORM-1664: Allow Java users to start a local cluster with a Nimbus Thrift 
server


Project: http://git-wip-us.apache.org/repos/asf/storm/repo
Commit: http://git-wip-us.apache.org/repos/asf/storm/commit/045b507d
Tree: http://git-wip-us.apache.org/repos/asf/storm/tree/045b507d
Diff: http://git-wip-us.apache.org/repos/asf/storm/diff/045b507d

Branch: refs/heads/master
Commit: 045b507dc7d97b42fcccbb405f236113e62a2434
Parents: e2ca82f
Author: Stig Døssing <s...@it-minds.dk>
Authored: Tue Mar 29 18:58:45 2016 +0200
Committer: Stig Døssing <s...@it-minds.dk>
Committed: Tue Mar 29 19:39:56 2016 +0200

----------------------------------------------------------------------
 storm-core/src/clj/org/apache/storm/testing4j.clj     |  6 ++++--
 .../jvm/org/apache/storm/testing/MkClusterParam.java  | 14 +++++++++++++-
 2 files changed, 17 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/storm/blob/045b507d/storm-core/src/clj/org/apache/storm/testing4j.clj
----------------------------------------------------------------------
diff --git a/storm-core/src/clj/org/apache/storm/testing4j.clj 
b/storm-core/src/clj/org/apache/storm/testing4j.clj
index 5850262..a0bbf3c 100644
--- a/storm-core/src/clj/org/apache/storm/testing4j.clj
+++ b/storm-core/src/clj/org/apache/storm/testing4j.clj
@@ -79,10 +79,12 @@
   [cluster-type mkClusterParam code]
   `(let [supervisors# (or (.getSupervisors ~mkClusterParam) 2)
          ports-per-supervisor# (or (.getPortsPerSupervisor ~mkClusterParam) 3)
-         daemon-conf# (or (.getDaemonConf ~mkClusterParam) {})]
+         daemon-conf# (or (.getDaemonConf ~mkClusterParam) {})
+         nimbus-daemon# (or (.isNimbusDaemon ~mkClusterParam) false)]
      (~cluster-type [cluster# :supervisors supervisors#
                      :ports-per-supervisor ports-per-supervisor#
-                     :daemon-conf daemon-conf#]
+                     :daemon-conf daemon-conf#
+                     :nimbus-daemon nimbus-daemon#]
                     (let [cluster# (LocalCluster. cluster#)]
                       (.run ~code cluster#)))))
 

http://git-wip-us.apache.org/repos/asf/storm/blob/045b507d/storm-core/src/jvm/org/apache/storm/testing/MkClusterParam.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/org/apache/storm/testing/MkClusterParam.java 
b/storm-core/src/jvm/org/apache/storm/testing/MkClusterParam.java
index 08459cb..c3946fa 100644
--- a/storm-core/src/jvm/org/apache/storm/testing/MkClusterParam.java
+++ b/storm-core/src/jvm/org/apache/storm/testing/MkClusterParam.java
@@ -20,7 +20,7 @@ package org.apache.storm.testing;
 import java.util.Map;
 
 /**
- * The param arg for `Testing.withSimulatedTimeCluster` and 
`Testing.withTrackedCluster`
+ * The param arg for `Testing.withSimulatedTimeCluster`, 
`Testing.withTrackedCluster` and `Testing.withLocalCluster` 
  */
 public class MkClusterParam {
        /**
@@ -35,6 +35,8 @@ public class MkClusterParam {
         * cluster config
         */
        private Map daemonConf;
+
+       private Boolean nimbusDaemon;
        
        public Integer getSupervisors() {
                return supervisors;
@@ -45,6 +47,9 @@ public class MkClusterParam {
        public Integer getPortsPerSupervisor() {
                return portsPerSupervisor;
        }
+       public Boolean isNimbusDaemon() {
+         return nimbusDaemon;
+       }
        public void setPortsPerSupervisor(Integer portsPerSupervisor) {
                this.portsPerSupervisor = portsPerSupervisor;
        }
@@ -54,4 +59,11 @@ public class MkClusterParam {
        public void setDaemonConf(Map daemonConf) {
                this.daemonConf = daemonConf;
        }
+       /**
+       * When nimbusDaemon is true, the local cluster will be started with a 
Nimbus
+       * Thrift server, allowing communication through for example 
org.apache.storm.utils.NimbusClient
+       */
+       public void setNimbusDaemon(Boolean nimbusDaemon) {
+         this.nimbusDaemon = nimbusDaemon;
+       }
 }

Reply via email to