You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@curator.apache.org by ra...@apache.org on 2017/06/30 04:21:06 UTC

[1/2] curator git commit: no need to use EnsureContainers object

Repository: curator
Updated Branches:
  refs/heads/CURATOR-397 09f9bc06a -> 7e6551f3f


no need to use EnsureContainers object


Project: http://git-wip-us.apache.org/repos/asf/curator/repo
Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/738c3617
Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/738c3617
Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/738c3617

Branch: refs/heads/CURATOR-397
Commit: 738c3617ee4887fefcf8dd5082b9b71c9f7021db
Parents: 09f9bc0
Author: randgalt <ra...@apache.org>
Authored: Thu Jun 29 23:20:45 2017 -0500
Committer: randgalt <ra...@apache.org>
Committed: Thu Jun 29 23:20:45 2017 -0500

----------------------------------------------------------------------
 .../main/java/org/apache/curator/x/async/AsyncWrappers.java | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/curator/blob/738c3617/curator-x-async/src/main/java/org/apache/curator/x/async/AsyncWrappers.java
----------------------------------------------------------------------
diff --git a/curator-x-async/src/main/java/org/apache/curator/x/async/AsyncWrappers.java b/curator-x-async/src/main/java/org/apache/curator/x/async/AsyncWrappers.java
index 8ff507c..e982cf2 100644
--- a/curator-x-async/src/main/java/org/apache/curator/x/async/AsyncWrappers.java
+++ b/curator-x-async/src/main/java/org/apache/curator/x/async/AsyncWrappers.java
@@ -18,7 +18,6 @@
  */
 package org.apache.curator.x.async;
 
-import org.apache.curator.framework.EnsureContainers;
 import org.apache.curator.framework.recipes.locks.InterProcessLock;
 import org.apache.curator.utils.ThreadUtils;
 import org.apache.curator.x.async.modeled.ZPath;
@@ -67,7 +66,8 @@ import java.util.concurrent.TimeUnit;
 public class AsyncWrappers
 {
     /**
-     * Asynchronously call {@link org.apache.curator.framework.EnsureContainers} using the {@link java.util.concurrent.ForkJoinPool#commonPool()}.
+     * Asynchronously call {@link org.apache.curator.framework.CuratorFramework#createContainers(String)} using
+     * the {@link java.util.concurrent.ForkJoinPool#commonPool()}.
      *
      * @param client client
      * @param path path to ensure
@@ -79,7 +79,8 @@ public class AsyncWrappers
     }
 
     /**
-     * Asynchronously call {@link org.apache.curator.framework.EnsureContainers} using the given executor
+     * Asynchronously call {@link org.apache.curator.framework.CuratorFramework#createContainers(String)} using
+     * the given executor
      *
      * @param client client
      * @param path path to ensure
@@ -90,7 +91,7 @@ public class AsyncWrappers
         Runnable proc = () -> {
             try
             {
-                new EnsureContainers(client.unwrap(), path.fullPath()).ensure();
+                client.unwrap().createContainers(path.fullPath());
             }
             catch ( Exception e )
             {


[2/2] curator git commit: completeChildrenAsZNodes() wasn't handling empty children listsw

Posted by ra...@apache.org.
completeChildrenAsZNodes() wasn't handling empty children listsw


Project: http://git-wip-us.apache.org/repos/asf/curator/repo
Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/7e6551f3
Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/7e6551f3
Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/7e6551f3

Branch: refs/heads/CURATOR-397
Commit: 7e6551f3fe3f1abbcf797739df20acc5a4e5be16
Parents: 738c361
Author: randgalt <ra...@apache.org>
Authored: Thu Jun 29 23:21:02 2017 -0500
Committer: randgalt <ra...@apache.org>
Committed: Thu Jun 29 23:21:02 2017 -0500

----------------------------------------------------------------------
 .../curator/x/async/modeled/details/ModeledFrameworkImpl.java   | 5 +++++
 1 file changed, 5 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/curator/blob/7e6551f3/curator-x-async/src/main/java/org/apache/curator/x/async/modeled/details/ModeledFrameworkImpl.java
----------------------------------------------------------------------
diff --git a/curator-x-async/src/main/java/org/apache/curator/x/async/modeled/details/ModeledFrameworkImpl.java b/curator-x-async/src/main/java/org/apache/curator/x/async/modeled/details/ModeledFrameworkImpl.java
index 4951478..c1d19c4 100644
--- a/curator-x-async/src/main/java/org/apache/curator/x/async/modeled/details/ModeledFrameworkImpl.java
+++ b/curator-x-async/src/main/java/org/apache/curator/x/async/modeled/details/ModeledFrameworkImpl.java
@@ -251,6 +251,11 @@ public class ModeledFrameworkImpl<T> implements ModeledFramework<T>
     private void completeChildrenAsZNodes(ModelStage<List<ZNode<T>>> modelStage, List<ZPath> children)
     {
         List<ZNode<T>> nodes = Lists.newArrayList();
+        if ( children.size() == 0 )
+        {
+            modelStage.complete(nodes);
+            return;
+        }
         children.forEach(path -> withPath(path).readAsZNode().handle((node, e) -> {
             if ( e != null )
             {