From ef6fa09c948d5a22bc27318794214ea5b89ed70d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stig=20Rohde=20D=C3=B8ssing?= Date: Tue, 17 Oct 2017 23:10:52 +0200 Subject: [PATCH] STORM-2706: Upgrade to Curator 4.0.0 --- external/storm-eventhubs/pom.xml | 11 ------- external/storm-kafka-monitor/pom.xml | 6 ---- external/storm-kafka/pom.xml | 29 ------------------ external/storm-kinesis/pom.xml | 11 ------- pom.xml | 22 ++++---------- storm-core/pom.xml | 30 ------------------- .../org/apache/storm/transactional_test.clj | 4 +-- .../org/apache/storm/trident/state_test.clj | 4 +-- .../storm/blobstore/BlobSynchronizerTest.java | 23 +++++++------- 9 files changed, 21 insertions(+), 119 deletions(-) diff --git a/external/storm-eventhubs/pom.xml b/external/storm-eventhubs/pom.xml index 0809b6eaa39..e13f3059ce4 100755 --- a/external/storm-eventhubs/pom.xml +++ b/external/storm-eventhubs/pom.xml @@ -67,17 +67,6 @@ org.apache.curator curator-framework - ${curator.version} - - - log4j - log4j - - - org.slf4j - slf4j-log4j12 - - org.apache.qpid diff --git a/external/storm-kafka-monitor/pom.xml b/external/storm-kafka-monitor/pom.xml index c66e701c94e..76e7c871533 100644 --- a/external/storm-kafka-monitor/pom.xml +++ b/external/storm-kafka-monitor/pom.xml @@ -57,12 +57,6 @@ org.apache.curator curator-framework - - - org.slf4j - slf4j-log4j12 - - com.googlecode.json-simple diff --git a/external/storm-kafka/pom.xml b/external/storm-kafka/pom.xml index f9cd57e6aca..3fa532ce71b 100644 --- a/external/storm-kafka/pom.xml +++ b/external/storm-kafka/pom.xml @@ -77,44 +77,15 @@ org.apache.curator curator-framework - ${curator.version} - - - log4j - log4j - - - org.slf4j - slf4j-log4j12 - - org.apache.curator curator-recipes - ${curator.version} - - - log4j - log4j - - test org.apache.curator curator-test - ${curator.version} - - - log4j - log4j - - - org.testng - testng - - test diff --git a/external/storm-kinesis/pom.xml b/external/storm-kinesis/pom.xml index f97a3a372f9..88c67d2347b 100644 --- a/external/storm-kinesis/pom.xml +++ b/external/storm-kinesis/pom.xml @@ -45,17 +45,6 @@ org.apache.curator curator-framework - ${curator.version} - - - log4j - log4j - - - org.slf4j - slf4j-log4j12 - - com.googlecode.json-simple diff --git a/pom.xml b/pom.xml index 21ec2bc6425..3b0d39b88b3 100644 --- a/pom.xml +++ b/pom.xml @@ -229,7 +229,8 @@ 1.6 1.3.1 0.8.0 - 2.12.0 + 4.0.0 + 2.12.0 1.1 1.3.1 0.3.1 @@ -701,10 +702,6 @@ curator-framework ${curator.version} - - log4j - log4j - org.jboss.netty netty @@ -715,16 +712,6 @@ org.apache.curator curator-recipes ${curator.version} - - - log4j - log4j - - - org.slf4j - slf4j-log4j12 - - org.apache.curator @@ -734,7 +721,10 @@ org.apache.curator curator-test - ${curator.version} + + ${curator-test.version} test diff --git a/storm-core/pom.xml b/storm-core/pom.xml index 0497bdc4615..3d714c0c440 100644 --- a/storm-core/pom.xml +++ b/storm-core/pom.xml @@ -188,44 +188,14 @@ org.apache.curator curator-framework compile - - - log4j - log4j - - - org.slf4j - slf4j-log4j12 - - org.apache.curator curator-recipes - - - log4j - log4j - - - org.slf4j - slf4j-log4j12 - - org.apache.curator curator-test - - - log4j - log4j - - - org.slf4j - slf4j-log4j12 - - com.googlecode.json-simple diff --git a/storm-core/test/clj/org/apache/storm/transactional_test.clj b/storm-core/test/clj/org/apache/storm/transactional_test.clj index 2920ea54b9b..68d009a2113 100644 --- a/storm-core/test/clj/org/apache/storm/transactional_test.clj +++ b/storm-core/test/clj/org/apache/storm/transactional_test.clj @@ -31,7 +31,7 @@ IdentityBolt CountingCommitBolt OpaqueMemoryTransactionalSpout]) (:import [org.apache.storm.utils ZookeeperAuthInfo]) (:import [org.apache.curator.framework CuratorFramework]) - (:import [org.apache.curator.framework.api CreateBuilder ProtectACLCreateModePathAndBytesable]) + (:import [org.apache.curator.framework.api CreateBuilder ProtectACLCreateModeStatPathAndBytesable]) (:import [org.apache.zookeeper CreateMode ZooDefs ZooDefs$Ids]) (:import [org.mockito Matchers Mockito]) (:import [org.mockito.exceptions.base MockitoAssertionError]) @@ -722,7 +722,7 @@ (testing "Creates ZooKeeper nodes with the correct ACLs" (let [curator (Mockito/mock CuratorFramework) builder0 (Mockito/mock CreateBuilder) - builder1 (Mockito/mock ProtectACLCreateModePathAndBytesable) + builder1 (Mockito/mock ProtectACLCreateModeStatPathAndBytesable) expectedAcls ZooDefs$Ids/CREATOR_ALL_ACL] (. (Mockito/when (.create curator)) (thenReturn builder0)) (. (Mockito/when (.creatingParentsIfNeeded builder0)) (thenReturn builder1)) diff --git a/storm-core/test/clj/org/apache/storm/trident/state_test.clj b/storm-core/test/clj/org/apache/storm/trident/state_test.clj index 58a0cb8a5e2..2aba02ca471 100644 --- a/storm-core/test/clj/org/apache/storm/trident/state_test.clj +++ b/storm-core/test/clj/org/apache/storm/trident/state_test.clj @@ -24,7 +24,7 @@ (:import [org.apache.storm.trident.testing MemoryBackingMap MemoryMapState]) (:import [org.apache.storm.utils ZookeeperAuthInfo]) (:import [org.apache.curator.framework CuratorFramework]) - (:import [org.apache.curator.framework.api CreateBuilder ProtectACLCreateModePathAndBytesable]) + (:import [org.apache.curator.framework.api CreateBuilder ProtectACLCreateModeStatPathAndBytesable]) (:import [org.apache.zookeeper CreateMode ZooDefs ZooDefs$Ids]) (:import [org.mockito Matchers Mockito]) (:import [org.mockito.exceptions.base MockitoAssertionError]) @@ -114,7 +114,7 @@ (testing "Creates ZooKeeper nodes with the correct ACLs" (let [curator (Mockito/mock CuratorFramework) builder0 (Mockito/mock CreateBuilder) - builder1 (Mockito/mock ProtectACLCreateModePathAndBytesable) + builder1 (Mockito/mock ProtectACLCreateModeStatPathAndBytesable) expectedAcls ZooDefs$Ids/CREATOR_ALL_ACL] (. (Mockito/when (.create curator)) (thenReturn builder0)) (. (Mockito/when (.creatingParentsIfNeeded builder0)) (thenReturn builder1)) diff --git a/storm-core/test/jvm/org/apache/storm/blobstore/BlobSynchronizerTest.java b/storm-core/test/jvm/org/apache/storm/blobstore/BlobSynchronizerTest.java index 40201a8b534..5392b739fde 100644 --- a/storm-core/test/jvm/org/apache/storm/blobstore/BlobSynchronizerTest.java +++ b/storm-core/test/jvm/org/apache/storm/blobstore/BlobSynchronizerTest.java @@ -111,18 +111,17 @@ public void testGetLatestSequenceNumber() throws Exception { @Test public void testNimbodesWithLatestVersionOfBlob() throws Exception { - TestingServer server = new TestingServer(); - CuratorFramework zkClient = CuratorFrameworkFactory.newClient(server.getConnectString(), new ExponentialBackoffRetry(1000, 3)); - zkClient.start(); - // Creating nimbus hosts containing latest version of blob - zkClient.create().creatingParentContainersIfNeeded().forPath("/blobstore/key1/nimbus1:7800-1"); - zkClient.create().creatingParentContainersIfNeeded().forPath("/blobstore/key1/nimbus2:7800-2"); - Set set = BlobStoreUtils.getNimbodesWithLatestSequenceNumberOfBlob(zkClient, "key1"); - assertEquals("Failed to get the correct nimbus hosts with latest blob version", (set.iterator().next()).getHost(),"nimbus2"); - zkClient.delete().deletingChildrenIfNeeded().forPath("/blobstore/key1/nimbus1:7800-1"); - zkClient.delete().deletingChildrenIfNeeded().forPath("/blobstore/key1/nimbus2:7800-2"); - zkClient.close(); - server.close(); + try (TestingServer server = new TestingServer(); + CuratorFramework zkClient = CuratorFrameworkFactory.newClient(server.getConnectString(), new ExponentialBackoffRetry(1000, 3));) { + zkClient.start(); + // Creating nimbus hosts containing latest version of blob + zkClient.create().creatingParentContainersIfNeeded().forPath("/blobstore/key1/nimbus1:7800-1"); + zkClient.create().creatingParentContainersIfNeeded().forPath("/blobstore/key1/nimbus2:7800-2"); + Set set = BlobStoreUtils.getNimbodesWithLatestSequenceNumberOfBlob(zkClient, "key1"); + assertEquals("Failed to get the correct nimbus hosts with latest blob version", (set.iterator().next()).getHost(), "nimbus2"); + zkClient.delete().deletingChildrenIfNeeded().forPath("/blobstore/key1/nimbus1:7800-1"); + zkClient.delete().deletingChildrenIfNeeded().forPath("/blobstore/key1/nimbus2:7800-2"); + } } @Test