storm-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ptgo...@apache.org
Subject [1/4] git commit: STORM-70 Upgrade to ZK-3.4.5 and curator-1.3.3
Date Wed, 12 Mar 2014 16:27:26 GMT
Repository: incubator-storm
Updated Branches:
  refs/heads/master 017d73f20 -> da8489a5c


STORM-70 Upgrade to ZK-3.4.5 and curator-1.3.3


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

Branch: refs/heads/master
Commit: a63c0d976aabbb4ff9692ab25aa70aa216a0b0d7
Parents: 22b8327
Author: Robert (Bobby) Evans <evans@yahoo-inc.com>
Authored: Fri Feb 7 22:43:32 2014 +0000
Committer: Robert (Bobby) Evans <evans@yahoo-inc.com>
Committed: Fri Feb 7 22:43:32 2014 +0000

----------------------------------------------------------------------
 pom.xml                                         | 35 ++++++++++++++++++--
 storm-core/src/clj/backtype/storm/zookeeper.clj |  4 +--
 .../src/jvm/backtype/storm/utils/Utils.java     | 26 ++++++---------
 3 files changed, 46 insertions(+), 19 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-storm/blob/a63c0d97/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 7a3a840..c66ee22 100644
--- a/pom.xml
+++ b/pom.xml
@@ -155,7 +155,7 @@
         <commons-lang.version>2.5</commons-lang.version>
         <commons-exec.version>1.1</commons-exec.version>
         <clj-time.version>0.4.1</clj-time.version>
-        <curator.version>1.0.1</curator.version>
+        <curator.version>1.3.3</curator.version>
         <json-simple.version>1.1</json-simple.version>
         <ring.version>0.3.11</ring.version>
         <clojure.tools.logging.version>0.2.3</clojure.tools.logging.version>
@@ -174,7 +174,7 @@
         <clojure-complete.version>0.2.3</clojure-complete.version>
         <mockito.version>1.9.5</mockito.version>
         <reply.version>0.3.0</reply.version>
-
+        <zookeeper.version>3.4.5</zookeeper.version>
 
     </properties>
 
@@ -285,6 +285,37 @@
                 <version>${clj-time.version}</version>
             </dependency>
             <dependency>
+                <groupId>org.apache.zookeeper</groupId>
+                <artifactId>zookeeper</artifactId>
+                <version>${zookeeper.version}</version>
+                <exclusions>
+                    <exclusion>
+                        <groupId>com.sun.jmx</groupId>
+                        <artifactId>jmxri</artifactId>
+                    </exclusion>
+                    <exclusion>
+                        <groupId>com.sun.jdmk</groupId>
+                        <artifactId>jmxtools</artifactId>
+                    </exclusion>
+                    <exclusion>
+                        <groupId>javax.jms</groupId>
+                        <artifactId>jms</artifactId>
+                    </exclusion>
+                    <exclusion>
+                        <groupId>org.slf4j</groupId>
+                        <artifactId>slf4j-api</artifactId>
+                    </exclusion>
+                    <exclusion>
+                        <groupId>org.slf4j</groupId>
+                        <artifactId>slf4j-log4j12</artifactId>
+                    </exclusion>
+                    <exclusion>
+                        <groupId>log4j</groupId>
+                        <artifactId>log4j</artifactId>
+                    </exclusion>
+                </exclusions>
+            </dependency>
+            <dependency>
                 <groupId>com.netflix.curator</groupId>
                 <artifactId>curator-framework</artifactId>
                 <version>${curator.version}</version>

http://git-wip-us.apache.org/repos/asf/incubator-storm/blob/a63c0d97/storm-core/src/clj/backtype/storm/zookeeper.clj
----------------------------------------------------------------------
diff --git a/storm-core/src/clj/backtype/storm/zookeeper.clj b/storm-core/src/clj/backtype/storm/zookeeper.clj
index 617e69b..5e70cb1 100644
--- a/storm-core/src/clj/backtype/storm/zookeeper.clj
+++ b/storm-core/src/clj/backtype/storm/zookeeper.clj
@@ -21,7 +21,7 @@
             ZooDefs ZooDefs$Ids CreateMode WatchedEvent Watcher$Event Watcher$Event$KeeperState
             Watcher$Event$EventType KeeperException$NodeExistsException])
   (:import [org.apache.zookeeper.data Stat])
-  (:import [org.apache.zookeeper.server ZooKeeperServer NIOServerCnxn$Factory])
+  (:import [org.apache.zookeeper.server ZooKeeperServer NIOServerCnxnFactory])
   (:import [java.net InetSocketAddress BindException])
   (:import [java.io File])
   (:import [backtype.storm.utils Utils ZookeeperAuthInfo])
@@ -156,7 +156,7 @@
   (let [localfile (File. localdir)
         zk (ZooKeeperServer. localfile localfile 2000)
         [retport factory] (loop [retport (if port port 2000)]
-                            (if-let [factory-tmp (try-cause (NIOServerCnxn$Factory. (InetSocketAddress.
retport))
+                            (if-let [factory-tmp (try-cause (doto (NIOServerCnxnFactory.)
(.configure (InetSocketAddress. retport) 0))
                                               (catch BindException e
                                                 (when (> (inc retport) (if port port 65535))
                                                   (throw (RuntimeException. "No port is available
to launch an inprocess zookeeper.")))))]

http://git-wip-us.apache.org/repos/asf/incubator-storm/blob/a63c0d97/storm-core/src/jvm/backtype/storm/utils/Utils.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/backtype/storm/utils/Utils.java b/storm-core/src/jvm/backtype/storm/utils/Utils.java
index 8a05fe4..0e04728 100644
--- a/storm-core/src/jvm/backtype/storm/utils/Utils.java
+++ b/storm-core/src/jvm/backtype/storm/utils/Utils.java
@@ -335,22 +335,18 @@ public class Utils {
             serverPorts.add(zkServer + ":" + Utils.getInt(port));
         }
         String zkStr = StringUtils.join(serverPorts, ",") + root;
-        try {
-            CuratorFrameworkFactory.Builder builder = CuratorFrameworkFactory.builder()
-                    .connectString(zkStr)
-                    .connectionTimeoutMs(Utils.getInt(conf.get(Config.STORM_ZOOKEEPER_CONNECTION_TIMEOUT)))
-                    .sessionTimeoutMs(Utils.getInt(conf.get(Config.STORM_ZOOKEEPER_SESSION_TIMEOUT)))
-                    .retryPolicy(new BoundedExponentialBackoffRetry(
-                                Utils.getInt(conf.get(Config.STORM_ZOOKEEPER_RETRY_INTERVAL)),
-                                Utils.getInt(conf.get(Config.STORM_ZOOKEEPER_RETRY_TIMES)),
-                                Utils.getInt(conf.get(Config.STORM_ZOOKEEPER_RETRY_INTERVAL_CEILING))));
-            if(auth!=null && auth.scheme!=null) {
-                builder = builder.authorization(auth.scheme, auth.payload);
-            }
-            return builder.build();
-        } catch (IOException e) {
-           throw new RuntimeException(e);
+        CuratorFrameworkFactory.Builder builder = CuratorFrameworkFactory.builder()
+                .connectString(zkStr)
+                .connectionTimeoutMs(Utils.getInt(conf.get(Config.STORM_ZOOKEEPER_CONNECTION_TIMEOUT)))
+                .sessionTimeoutMs(Utils.getInt(conf.get(Config.STORM_ZOOKEEPER_SESSION_TIMEOUT)))
+                .retryPolicy(new BoundedExponentialBackoffRetry(
+                            Utils.getInt(conf.get(Config.STORM_ZOOKEEPER_RETRY_INTERVAL)),
+                            Utils.getInt(conf.get(Config.STORM_ZOOKEEPER_RETRY_TIMES)),
+                            Utils.getInt(conf.get(Config.STORM_ZOOKEEPER_RETRY_INTERVAL_CEILING))));
+        if(auth!=null && auth.scheme!=null) {
+            builder = builder.authorization(auth.scheme, auth.payload);
         }
+        return builder.build();
     }
 
     public static CuratorFramework newCurator(Map conf, List<String> servers, Object
port) {


Mime
View raw message