You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@storm.apache.org by bo...@apache.org on 2016/01/30 19:47:48 UTC

[09/14] storm git commit: Fixed the rest of the errors.

Fixed the rest of the errors.


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

Branch: refs/heads/master
Commit: 122fc0901acbbec89b735f430f2770cf711b11e4
Parents: 795fda8
Author: Robert (Bobby) Evans <ev...@yahoo-inc.com>
Authored: Thu Jan 28 15:41:01 2016 -0600
Committer: Robert (Bobby) Evans <ev...@yahoo-inc.com>
Committed: Thu Jan 28 15:41:01 2016 -0600

----------------------------------------------------------------------
 .../jvm/org/apache/storm/zookeeper/Factory.java | 37 --------------------
 .../org/apache/storm/zookeeper/Zookeeper.java   |  8 ++---
 .../test/clj/org/apache/storm/cluster_test.clj  |  2 +-
 3 files changed, 5 insertions(+), 42 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/storm/blob/122fc090/storm-core/src/jvm/org/apache/storm/zookeeper/Factory.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/org/apache/storm/zookeeper/Factory.java b/storm-core/src/jvm/org/apache/storm/zookeeper/Factory.java
deleted file mode 100644
index 0b80952..0000000
--- a/storm-core/src/jvm/org/apache/storm/zookeeper/Factory.java
+++ /dev/null
@@ -1,37 +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.
- */
-package org.apache.storm.zookeeper;
-
-import org.apache.zookeeper.server.NIOServerCnxnFactory;
-import org.apache.zookeeper.server.ZooKeeperServer;
-
-import java.io.IOException;
-import java.net.InetSocketAddress;
-
-public class Factory extends NIOServerCnxnFactory {
-
-    public Factory(InetSocketAddress addr, int maxcc) throws IOException {
-        super();
-        this.configure(addr, maxcc);
-    }
-
-    public ZooKeeperServer getZooKeeperServer() {
-        return zkServer;
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/storm/blob/122fc090/storm-core/src/jvm/org/apache/storm/zookeeper/Zookeeper.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/org/apache/storm/zookeeper/Zookeeper.java b/storm-core/src/jvm/org/apache/storm/zookeeper/Zookeeper.java
index ad4b405..503bd86 100644
--- a/storm-core/src/jvm/org/apache/storm/zookeeper/Zookeeper.java
+++ b/storm-core/src/jvm/org/apache/storm/zookeeper/Zookeeper.java
@@ -132,7 +132,7 @@ public class Zookeeper {
         String ret = null;
         try {
             String npath = normalizePath(path);
-            ret = zk.create().withMode(mode).withACL(acls).forPath(npath, data);
+            ret = zk.create().creatingParentsIfNeeded().withMode(mode).withACL(acls).forPath(npath, data);
         } catch (Exception e) {
             throw Utils.wrapInRuntime(e);
         }
@@ -177,7 +177,7 @@ public class Zookeeper {
         _instance.mkdirsImpl(zk, path, acls);
     }
 
-    protected void mkdirsImpl(CuratorFramework zk, String path, List<ACL> acls) {
+    public void mkdirsImpl(CuratorFramework zk, String path, List<ACL> acls) {
         String npath = normalizePath(path);
         if (npath.equals("/")) {
             return;
@@ -284,7 +284,6 @@ public class Zookeeper {
     }
 
     public static List mkInprocessZookeeper(String localdir, Integer port) throws Exception {
-        LOG.info("Starting inprocess zookeeper at port {} and dir {}", port, localdir);
         File localfile = new File(localdir);
         ZooKeeperServer zk = new ZooKeeperServer(localfile, localfile, 2000);
         NIOServerCnxnFactory factory = null;
@@ -306,11 +305,12 @@ public class Zookeeper {
                 }
             }
         }
+        LOG.info("Starting inprocess zookeeper at port {} and dir {}", report, localdir);
         factory.startup(zk);
         return Arrays.asList((Object)new Long(report), (Object)factory);
     }
 
-    public static void shutdownInprocessZookeeper(Factory handle) {
+    public static void shutdownInprocessZookeeper(NIOServerCnxnFactory handle) {
         handle.shutdown();
     }
 

http://git-wip-us.apache.org/repos/asf/storm/blob/122fc090/storm-core/test/clj/org/apache/storm/cluster_test.clj
----------------------------------------------------------------------
diff --git a/storm-core/test/clj/org/apache/storm/cluster_test.clj b/storm-core/test/clj/org/apache/storm/cluster_test.clj
index e558e96..ffd913e 100644
--- a/storm-core/test/clj/org/apache/storm/cluster_test.clj
+++ b/storm-core/test/clj/org/apache/storm/cluster_test.clj
@@ -315,7 +315,7 @@
       (with-open [_ (MockedZookeeper. zk-mock)]
         (stubbing [zk/mk-client (reify CuratorFramework (^void close [this] nil))]
           (mk-distributed-cluster-state {})
-          (.mkdirs (Mockito/verify zk-mock (Mockito/times 1)) (Mockito/any) (Mockito/anyString) nil))))
+          (.mkdirsImpl (Mockito/verify zk-mock (Mockito/times 1)) (Mockito/any) (Mockito/anyString) (Mockito/eq nil)))))
     (stubbing [mk-distributed-cluster-state (reify ClusterState
                                               (register [this callback] nil)
                                               (mkdirs [this path acls] nil))]