You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@storm.apache.org by ka...@apache.org on 2016/02/09 03:38:43 UTC

[1/3] storm git commit: STORM-1520 Nimbus Clojure/Zookeeper issue ("stateChanged" method not found)

Repository: storm
Updated Branches:
  refs/heads/1.x-branch 0164e522e -> ec25fad1b


STORM-1520 Nimbus Clojure/Zookeeper issue ("stateChanged" method not found)

* fix a bug which passes wrong type of parameter to ClusterStateListener.stateChanged()
  * we passed ConnectionState from Curator which method needs storm's ConnectionState


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

Branch: refs/heads/1.x-branch
Commit: ed4a55f50f5e73589e2a59c99236651edf0f18b1
Parents: 0164e52
Author: Jungtaek Lim <ka...@gmail.com>
Authored: Tue Feb 9 11:26:06 2016 +0900
Committer: Jungtaek Lim <ka...@gmail.com>
Committed: Tue Feb 9 11:26:06 2016 +0900

----------------------------------------------------------------------
 .../cluster_state/zookeeper_state_factory.clj   |  3 +-
 .../utils/StormConnectionStateConverter.java    | 44 ++++++++++++++++++++
 2 files changed, 46 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/storm/blob/ed4a55f5/storm-core/src/clj/org/apache/storm/cluster_state/zookeeper_state_factory.clj
----------------------------------------------------------------------
diff --git a/storm-core/src/clj/org/apache/storm/cluster_state/zookeeper_state_factory.clj b/storm-core/src/clj/org/apache/storm/cluster_state/zookeeper_state_factory.clj
index 3104c52..7eca328 100644
--- a/storm-core/src/clj/org/apache/storm/cluster_state/zookeeper_state_factory.clj
+++ b/storm-core/src/clj/org/apache/storm/cluster_state/zookeeper_state_factory.clj
@@ -18,6 +18,7 @@
   (:import [org.apache.curator.framework.state ConnectionStateListener])
   (:import [org.apache.zookeeper KeeperException$NoNodeException]
            [org.apache.storm.cluster ClusterState DaemonType])
+  (:import [org.apache.storm.utils StormConnectionStateConverter])
   (:use [org.apache.storm cluster config log util])
   (:require [org.apache.storm [zookeeper :as zk]])
   (:gen-class
@@ -142,7 +143,7 @@
        (let [curator-listener (reify ConnectionStateListener
                                 (stateChanged
                                   [this client newState]
-                                  (.stateChanged listener client newState)))]
+                                  (.stateChanged listener (StormConnectionStateConverter/convert newState))))]
          (zk/add-listener zk-reader curator-listener)))
 
      (sync-path

http://git-wip-us.apache.org/repos/asf/storm/blob/ed4a55f5/storm-core/src/jvm/org/apache/storm/utils/StormConnectionStateConverter.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/org/apache/storm/utils/StormConnectionStateConverter.java b/storm-core/src/jvm/org/apache/storm/utils/StormConnectionStateConverter.java
new file mode 100644
index 0000000..587b5eb
--- /dev/null
+++ b/storm-core/src/jvm/org/apache/storm/utils/StormConnectionStateConverter.java
@@ -0,0 +1,44 @@
+/**
+ * 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.utils;
+
+import org.apache.storm.cluster.ConnectionState;
+
+import java.util.HashMap;
+import java.util.Map;
+
+public class StormConnectionStateConverter {
+
+    private static final Map<org.apache.curator.framework.state.ConnectionState, ConnectionState> mapCuratorToStorm = new HashMap<>();
+    static {
+        mapCuratorToStorm.put(org.apache.curator.framework.state.ConnectionState.CONNECTED, ConnectionState.CONNECTED);
+        mapCuratorToStorm.put(org.apache.curator.framework.state.ConnectionState.LOST, ConnectionState.LOST);
+        mapCuratorToStorm.put(org.apache.curator.framework.state.ConnectionState.RECONNECTED, ConnectionState.RECONNECTED);
+        mapCuratorToStorm.put(org.apache.curator.framework.state.ConnectionState.READ_ONLY, ConnectionState.LOST);
+        mapCuratorToStorm.put(org.apache.curator.framework.state.ConnectionState.SUSPENDED, ConnectionState.LOST);
+    }
+
+    public static ConnectionState convert(org.apache.curator.framework.state.ConnectionState state) {
+        ConnectionState stormState = mapCuratorToStorm.get(state);
+        if (stormState != null) {
+            return stormState;
+        }
+        throw new IllegalStateException("Unknown ConnectionState from Curator: " + state);
+    }
+}
\ No newline at end of file


[2/3] storm git commit: Merge branch 'STORM-1520-1.x' into 1.x-branch

Posted by ka...@apache.org.
Merge branch 'STORM-1520-1.x' into 1.x-branch


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

Branch: refs/heads/1.x-branch
Commit: d8d8e696b539597dd0b5be82dff5e89643181c0e
Parents: 0164e52 ed4a55f
Author: Jungtaek Lim <ka...@gmail.com>
Authored: Tue Feb 9 11:37:54 2016 +0900
Committer: Jungtaek Lim <ka...@gmail.com>
Committed: Tue Feb 9 11:37:54 2016 +0900

----------------------------------------------------------------------
 .../cluster_state/zookeeper_state_factory.clj   |  3 +-
 .../utils/StormConnectionStateConverter.java    | 44 ++++++++++++++++++++
 2 files changed, 46 insertions(+), 1 deletion(-)
----------------------------------------------------------------------



[3/3] storm git commit: add STORM-1520 to CHANGELOG.md

Posted by ka...@apache.org.
add STORM-1520 to CHANGELOG.md


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

Branch: refs/heads/1.x-branch
Commit: ec25fad1bc18cfde4736c00016543658e610eeb7
Parents: d8d8e69
Author: Jungtaek Lim <ka...@gmail.com>
Authored: Tue Feb 9 11:38:31 2016 +0900
Committer: Jungtaek Lim <ka...@gmail.com>
Committed: Tue Feb 9 11:38:31 2016 +0900

----------------------------------------------------------------------
 CHANGELOG.md | 1 +
 1 file changed, 1 insertion(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/storm/blob/ec25fad1/CHANGELOG.md
----------------------------------------------------------------------
diff --git a/CHANGELOG.md b/CHANGELOG.md
index def5816..15a0fd4 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,4 +1,5 @@
 ## 1.0.0
+ * STORM-1520: Nimbus Clojure/Zookeeper issue ("stateChanged" method not found)
  * STORM-1531: Junit and mockito dependencies need to have correct scope defined in storm-elasticsearch pom.xml
  * STORM-1526: Improve Storm core performance
  * STORM-1524: Add Pluggable daemon metrics Reporters