Return-Path: X-Original-To: apmail-curator-commits-archive@minotaur.apache.org Delivered-To: apmail-curator-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id B9E74111B1 for ; Mon, 15 Sep 2014 06:56:33 +0000 (UTC) Received: (qmail 41614 invoked by uid 500); 15 Sep 2014 06:56:33 -0000 Delivered-To: apmail-curator-commits-archive@curator.apache.org Received: (qmail 41581 invoked by uid 500); 15 Sep 2014 06:56:33 -0000 Mailing-List: contact commits-help@curator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@curator.apache.org Delivered-To: mailing list commits@curator.apache.org Received: (qmail 41566 invoked by uid 99); 15 Sep 2014 06:56:33 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 15 Sep 2014 06:56:33 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 29BF89C5E92; Mon, 15 Sep 2014 06:56:33 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: cammckenzie@apache.org To: commits@curator.apache.org Date: Mon, 15 Sep 2014 06:56:33 -0000 Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: [1/2] git commit: CURATOR-147 Remove use of deprecated APIs Repository: curator Updated Branches: refs/heads/CURATOR-147 [created] ae6f4ecb6 CURATOR-147 Remove use of deprecated APIs Project: http://git-wip-us.apache.org/repos/asf/curator/repo Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/8929343e Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/8929343e Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/8929343e Branch: refs/heads/CURATOR-147 Commit: 8929343e22e51d1c109fe4143327d3c3958077f3 Parents: f9c6919 Author: Mike Drob Authored: Thu Sep 11 16:03:06 2014 -0700 Committer: Mike Drob Committed: Thu Sep 11 16:03:06 2014 -0700 ---------------------------------------------------------------------- .../org/apache/curator/framework/imps/FailedDeleteManager.java | 2 +- .../java/org/apache/curator/framework/imps/TestMultiClient.java | 2 +- .../org/apache/curator/framework/imps/TestNamespaceFacade.java | 4 ++-- .../java/org/apache/curator/framework/imps/TestTransactions.java | 2 +- .../apache/curator/framework/recipes/queue/DistributedQueue.java | 4 +++- .../framework/recipes/leader/TestLeaderSelectorCluster.java | 2 +- .../framework/recipes/queue/TestBoundedDistributedQueue.java | 3 ++- 7 files changed, 11 insertions(+), 8 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/curator/blob/8929343e/curator-framework/src/main/java/org/apache/curator/framework/imps/FailedDeleteManager.java ---------------------------------------------------------------------- diff --git a/curator-framework/src/main/java/org/apache/curator/framework/imps/FailedDeleteManager.java b/curator-framework/src/main/java/org/apache/curator/framework/imps/FailedDeleteManager.java index f02e852..deb7f40 100644 --- a/curator-framework/src/main/java/org/apache/curator/framework/imps/FailedDeleteManager.java +++ b/curator-framework/src/main/java/org/apache/curator/framework/imps/FailedDeleteManager.java @@ -47,7 +47,7 @@ class FailedDeleteManager } - if ( client.isStarted() ) + if ( client.getState() == CuratorFrameworkState.STARTED ) { log.debug("Path being added to guaranteed delete set: " + path); try http://git-wip-us.apache.org/repos/asf/curator/blob/8929343e/curator-framework/src/test/java/org/apache/curator/framework/imps/TestMultiClient.java ---------------------------------------------------------------------- diff --git a/curator-framework/src/test/java/org/apache/curator/framework/imps/TestMultiClient.java b/curator-framework/src/test/java/org/apache/curator/framework/imps/TestMultiClient.java index 1d7634b..de210ab 100644 --- a/curator-framework/src/test/java/org/apache/curator/framework/imps/TestMultiClient.java +++ b/curator-framework/src/test/java/org/apache/curator/framework/imps/TestMultiClient.java @@ -87,7 +87,7 @@ public class TestMultiClient extends BaseClassForTests } ); - client2.sync("/test", null); + client2.sync().forPath("/test"); Assert.assertTrue(latch.await(10, TimeUnit.SECONDS)); } http://git-wip-us.apache.org/repos/asf/curator/blob/8929343e/curator-framework/src/test/java/org/apache/curator/framework/imps/TestNamespaceFacade.java ---------------------------------------------------------------------- diff --git a/curator-framework/src/test/java/org/apache/curator/framework/imps/TestNamespaceFacade.java b/curator-framework/src/test/java/org/apache/curator/framework/imps/TestNamespaceFacade.java index 475e7e9..d09dd18 100644 --- a/curator-framework/src/test/java/org/apache/curator/framework/imps/TestNamespaceFacade.java +++ b/curator-framework/src/test/java/org/apache/curator/framework/imps/TestNamespaceFacade.java @@ -185,10 +185,10 @@ public class TestNamespaceFacade extends BaseClassForTests client.start(); CuratorFramework namespaced = client.usingNamespace(null); - Assert.assertEquals(client.isStarted(), namespaced.isStarted()); + Assert.assertEquals(client.getState(), namespaced.getState(), "Namespaced state did not match true state after call to start."); client.close(); - Assert.assertEquals(client.isStarted(), namespaced.isStarted()); + Assert.assertEquals(client.getState(), namespaced.getState(), "Namespaced state did not match true state after call to close."); } /** http://git-wip-us.apache.org/repos/asf/curator/blob/8929343e/curator-framework/src/test/java/org/apache/curator/framework/imps/TestTransactions.java ---------------------------------------------------------------------- diff --git a/curator-framework/src/test/java/org/apache/curator/framework/imps/TestTransactions.java b/curator-framework/src/test/java/org/apache/curator/framework/imps/TestTransactions.java index 3b7e062..ae2cf1d 100644 --- a/curator-framework/src/test/java/org/apache/curator/framework/imps/TestTransactions.java +++ b/curator-framework/src/test/java/org/apache/curator/framework/imps/TestTransactions.java @@ -90,7 +90,7 @@ public class TestTransactions extends BaseClassForTests .commit(); Assert.assertTrue(client.checkExists().forPath("/foo") != null); - Assert.assertTrue(client.nonNamespaceView().checkExists().forPath("/galt/foo") != null); + Assert.assertTrue(client.usingNamespace(null).checkExists().forPath("/galt/foo") != null); Assert.assertEquals(client.getData().forPath("/foo"), "two".getBytes()); Assert.assertTrue(client.checkExists().forPath("/foo/bar") == null); http://git-wip-us.apache.org/repos/asf/curator/blob/8929343e/curator-recipes/src/main/java/org/apache/curator/framework/recipes/queue/DistributedQueue.java ---------------------------------------------------------------------- diff --git a/curator-recipes/src/main/java/org/apache/curator/framework/recipes/queue/DistributedQueue.java b/curator-recipes/src/main/java/org/apache/curator/framework/recipes/queue/DistributedQueue.java index 671bea9..7b4e877 100644 --- a/curator-recipes/src/main/java/org/apache/curator/framework/recipes/queue/DistributedQueue.java +++ b/curator-recipes/src/main/java/org/apache/curator/framework/recipes/queue/DistributedQueue.java @@ -22,11 +22,13 @@ import com.google.common.annotations.VisibleForTesting; import com.google.common.base.Function; import com.google.common.base.Preconditions; import com.google.common.collect.Lists; + import org.apache.curator.utils.CloseableUtils; import org.apache.curator.framework.CuratorFramework; import org.apache.curator.framework.api.BackgroundCallback; import org.apache.curator.framework.api.CuratorEvent; import org.apache.curator.framework.api.CuratorEventType; +import org.apache.curator.framework.imps.CuratorFrameworkState; import org.apache.curator.framework.listen.ListenerContainer; import org.apache.curator.framework.recipes.leader.LeaderSelector; import org.apache.curator.utils.ZKPaths; @@ -702,7 +704,7 @@ public class DistributedQueue implements QueueBase { bytes = client.getData().storingStatIn(stat).forPath(itemPath); } - if ( client.isStarted() ) + if ( client.getState() == CuratorFrameworkState.STARTED ) { client.delete().withVersion(stat.getVersion()).forPath(itemPath); } http://git-wip-us.apache.org/repos/asf/curator/blob/8929343e/curator-recipes/src/test/java/org/apache/curator/framework/recipes/leader/TestLeaderSelectorCluster.java ---------------------------------------------------------------------- diff --git a/curator-recipes/src/test/java/org/apache/curator/framework/recipes/leader/TestLeaderSelectorCluster.java b/curator-recipes/src/test/java/org/apache/curator/framework/recipes/leader/TestLeaderSelectorCluster.java index 8f5d858..48d933f 100644 --- a/curator-recipes/src/test/java/org/apache/curator/framework/recipes/leader/TestLeaderSelectorCluster.java +++ b/curator-recipes/src/test/java/org/apache/curator/framework/recipes/leader/TestLeaderSelectorCluster.java @@ -96,7 +96,7 @@ public class TestLeaderSelectorCluster { client = CuratorFrameworkFactory.newClient(cluster.getConnectString(), timing.session(), timing.connection(), new RetryOneTime(1)); client.start(); - client.sync("/", null); + client.sync().forPath("/"); final AtomicReference error = new AtomicReference(null); final AtomicReference lockNode = new AtomicReference(null); http://git-wip-us.apache.org/repos/asf/curator/blob/8929343e/curator-recipes/src/test/java/org/apache/curator/framework/recipes/queue/TestBoundedDistributedQueue.java ---------------------------------------------------------------------- diff --git a/curator-recipes/src/test/java/org/apache/curator/framework/recipes/queue/TestBoundedDistributedQueue.java b/curator-recipes/src/test/java/org/apache/curator/framework/recipes/queue/TestBoundedDistributedQueue.java index edae618..973ef51 100644 --- a/curator-recipes/src/test/java/org/apache/curator/framework/recipes/queue/TestBoundedDistributedQueue.java +++ b/curator-recipes/src/test/java/org/apache/curator/framework/recipes/queue/TestBoundedDistributedQueue.java @@ -20,6 +20,7 @@ package org.apache.curator.framework.recipes.queue; import org.apache.curator.framework.CuratorFramework; import org.apache.curator.framework.CuratorFrameworkFactory; +import org.apache.curator.framework.imps.CuratorFrameworkState; import org.apache.curator.framework.state.ConnectionState; import org.apache.curator.retry.RetryOneTime; import org.apache.curator.test.BaseClassForTests; @@ -115,7 +116,7 @@ public class TestBoundedDistributedQueue extends BaseClassForTests } }; - while ( !Thread.currentThread().isInterrupted() && client.isStarted() && !isDone.get() ) + while ( !Thread.currentThread().isInterrupted() && client.getState() == CuratorFrameworkState.STARTED && !isDone.get() ) { synchronized(lock) {