storm-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bo...@apache.org
Subject [40/50] [abbrv] storm git commit: STORM-726: Adding nimbus.host config for backward compatibility.
Date Mon, 24 Aug 2015 13:52:25 GMT
STORM-726: Adding nimbus.host config for backward compatibility.

Conflicts:
	storm-core/src/jvm/backtype/storm/utils/NimbusClient.java


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

Branch: refs/heads/master
Commit: 3e20823c199c9babf3017cf1e8a8ff0753c7f24f
Parents: d1afefd
Author: Parth Brahmbhatt <brahmbhatt.parth@gmail.com>
Authored: Thu Mar 26 11:22:10 2015 -0700
Committer: Parth Brahmbhatt <brahmbhatt.parth@gmail.com>
Committed: Wed Aug 12 09:25:27 2015 -0700

----------------------------------------------------------------------
 storm-core/src/jvm/backtype/storm/Config.java             | 7 +++++++
 storm-core/src/jvm/backtype/storm/utils/NimbusClient.java | 9 ++++++++-
 2 files changed, 15 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/storm/blob/3e20823c/storm-core/src/jvm/backtype/storm/Config.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/backtype/storm/Config.java b/storm-core/src/jvm/backtype/storm/Config.java
index 3cba37c..36749ca 100644
--- a/storm-core/src/jvm/backtype/storm/Config.java
+++ b/storm-core/src/jvm/backtype/storm/Config.java
@@ -316,6 +316,13 @@ public class Config extends HashMap<String, Object> {
     public static final Object NIMBUS_THRIFT_TRANSPORT_PLUGIN_SCHEMA = String.class;
 
     /**
+     * The host that the master server is running on, only here for backward compatibility.
+     */
+    @Deprecated
+    public static final String NIMBUS_HOST = "nimbus.host";
+    public static final Object NIMBUS_HOST_SCHEMA = String.class;
+
+    /**
      * List of seed nimbus hosts:port to use for leader nimbus discovery.
      */
     public static final String NIMBUS_SEEDS = "nimbus.seeds";

http://git-wip-us.apache.org/repos/asf/storm/blob/3e20823c/storm-core/src/jvm/backtype/storm/utils/NimbusClient.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/backtype/storm/utils/NimbusClient.java b/storm-core/src/jvm/backtype/storm/utils/NimbusClient.java
index 08610e9..60fa3aa 100644
--- a/storm-core/src/jvm/backtype/storm/utils/NimbusClient.java
+++ b/storm-core/src/jvm/backtype/storm/utils/NimbusClient.java
@@ -29,6 +29,7 @@ import backtype.storm.security.auth.ThriftConnectionType;
 import clojure.lang.IFn;
 import clojure.lang.PersistentArrayMap;
 import com.google.common.base.Splitter;
+import com.google.common.collect.Lists;
 import org.apache.thrift.transport.TTransportException;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -55,7 +56,13 @@ public class NimbusClient extends ThriftClient {
         }
 
         List<String> seeds = (List<String>) conf.get(Config.NIMBUS_SEEDS);
-        for (String seed : seeds) {
+
+        if(seeds == null  || seeds.isEmpty()) {
+            LOG.warn("config {} has no value. Failing over to deprecated config {}. ", Config.NIMBUS_SEEDS,
Config.NIMBUS_HOST);
+            seeds = Lists.newArrayList(conf.get(Config.NIMBUS_HOST) + ":" + conf.get(Config.NIMBUS_THRIFT_PORT));
+        }
+
+        for(String seed : seeds) {
             String[] split = seed.split(":");
             String host = split[0];
             int port = Integer.parseInt(split[1]);


Mime
View raw message