curator-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cammcken...@apache.org
Subject [1/2] git commit: CURATOR-147 Remove use of deprecated APIs
Date Mon, 15 Sep 2014 06:56:33 GMT
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 <mdrob@cloudera.com>
Authored: Thu Sep 11 16:03:06 2014 -0700
Committer: Mike Drob <mdrob@cloudera.com>
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<T> implements QueueBase<T>
             {
                 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<Exception>        error = new AtomicReference<Exception>(null);
             final AtomicReference<String>           lockNode = new AtomicReference<String>(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)
                             {


Mime
View raw message