You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@curator.apache.org by dr...@apache.org on 2017/05/02 20:06:09 UTC

[01/50] curator git commit: added doxia doc

Repository: curator
Updated Branches:
  refs/heads/master abaabb5f6 -> ed3082ecf


added doxia doc


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

Branch: refs/heads/master
Commit: 908b5c6c2768b9135de05d67ed80db8af7b310a4
Parents: e8d1352
Author: randgalt <ra...@apache.org>
Authored: Sat Jan 7 11:26:35 2017 -0500
Committer: randgalt <ra...@apache.org>
Committed: Sat Jan 7 11:26:35 2017 -0500

----------------------------------------------------------------------
 .../src/site/confluence/index.confluence        | 97 ++++++++++++++++++++
 curator-x-async/src/site/site.xml               | 33 +++++++
 .../curator/framework/imps/TestFramework.java   | 18 ++++
 .../framework/imps/TestFrameworkBackground.java | 18 ++++
 .../curator/x/async/TestBasicOperations.java    | 14 +++
 curator-x-rpc/src/site/site.xml                 |  2 +-
 pom.xml                                         |  2 +-
 src/site/site.xml                               |  1 +
 8 files changed, 183 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/curator/blob/908b5c6c/curator-x-async/src/site/confluence/index.confluence
----------------------------------------------------------------------
diff --git a/curator-x-async/src/site/confluence/index.confluence b/curator-x-async/src/site/confluence/index.confluence
new file mode 100644
index 0000000..7e1449b
--- /dev/null
+++ b/curator-x-async/src/site/confluence/index.confluence
@@ -0,0 +1,97 @@
+h1. Curator Async
+
+h2. Packaging
+
+Curator Async is in its own package in Maven Central: curator\-x\-async
+
+h2. What Is a Curator Async?
+
+Curator Async is a brand new [DSL|https://en.wikipedia.org/wiki/Domain-specific_language] that wraps existing
+{{CuratorFramework}} instances. This new DSL is entirely asynchronous and uses
+[Java 8's CompletionStage|https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/CompletionStage.html]
+mechanism for chaining, composing, etc. Additionally, Curator's original DSL has been cleaned up
+and simplified, in particular for operations such as {{create()}}.
+
+With this new async DSL you can do asynchronous tasks in a more natural, functional way using
+[Java 8 lambdas|https://docs.oracle.com/javase/tutorial/java/javaOO/lambdaexpressions.html]. For example:
+
+{code}
+// let "client" be a CuratorFramework instance
+AsyncCuratorFramework async = AsyncCuratorFramework.wrap(client);
+async.checkExists().forPath(somePath).thenRun(() -> mySuccessOperation());
+{code}
+
+h2. Usage
+
+Note: To use Curator Async, you should be familiar with Java 8's lambdas, CompletedFuture and CompletionStage.
+
+Create a CuratorFramework instance in the normal way. You then wrap this instance using
+AsyncCuratorFramework. i.e.
+
+{code}
+// let "client" be a CuratorFramework instance
+AsyncCuratorFramework async = AsyncCuratorFramework.wrap(client);
+{code}
+
+AsyncCuratorFramework has most of the same builder methods that CuratorFramework does with some important
+differences:
+
+* AsyncCuratorFramework builders return {{AsyncStage}} instances
+* AsyncCuratorFramework builders have no checked exceptions
+* Many of the builder methods have been simplified/clarified
+* All builders invoke the asynchronous versions of ZooKeeper APIs
+* Watchers also use CompletionStages \- see below for details
+
+h4. AsyncStage
+
+AsyncStage instances extend Java 8's CompletionStage. CompletionStage objects can be "completed" with a success
+value or an exception. The parameterized type of the AsyncStage will
+be whatever the builder used would naturally return as a success value. E.g. the async getData() builder's AsyncStage is
+parameterized with {{byte[]}}. For the exception, Curator Async always uses AsyncEventException (see below).
+
+h4. Watchers
+
+ZooKeeper watchers also get the CompletionStage treatment in Curator Async. To add a watcher, call
+watched() prior to starting the appropriate builders. E.g.
+
+{code}
+async.watched().getData().forPath(path) ...
+{code}
+
+Thus, a data watcher will be set on the specified path. You access the CompletionStage for the watcher
+by using the event() method of AsyncStage. Here is a complete example:
+
+{code}
+async.watched().getData().forPath(path).event().thenAccept(watchedEvent -> watchWasTriggered(watchedEvent));
+{code}
+
+ZooKeeper calls watchers when there is a connection loss. This can make using the CompletionStage
+somewhat complicated (see AsyncEventException below). If you are not interested in watcher connection
+problems, you can tell Curator Async to not send them by calling:
+
+{code}
+// only complete the CompletionStage when the watcher is successfully triggered
+// i.e. don't complete on connection issues
+async.watched(WatchMode.successOnly)...
+{code}
+
+h4. AsyncEventException
+
+When an async watcher fails the exception set in the CompletionStage will be of type {{AsyncEventException}}.
+This exception allows you to see the KeeperState that caused the trigger and allows you to reset the
+completion stage. Reset is needed because ZooKeeper temporarily triggers watchers when there is a connection
+event. However, the watcher stays set for the original operation. Use {{AsyncEventException#reset()}}
+to start a new completion stage that will wait on the next trigger of the watcher.
+
+E.g.
+
+{code}
+AsyncStage stage = ...
+stage.event().exceptionally(e -> {
+    AsyncEventException asyncEx = (AsyncEventException)e;
+
+    ... noteAConnectionProblem ...
+
+    asyncEx.reset().thenRun(() -> successMethod());
+});
+{code}

http://git-wip-us.apache.org/repos/asf/curator/blob/908b5c6c/curator-x-async/src/site/site.xml
----------------------------------------------------------------------
diff --git a/curator-x-async/src/site/site.xml b/curator-x-async/src/site/site.xml
new file mode 100644
index 0000000..63fccaa
--- /dev/null
+++ b/curator-x-async/src/site/site.xml
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+    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.
+
+-->
+<project xmlns="http://maven.apache.org/DECORATION/1.1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/DECORATION/1.1.0 http://maven.apache.org/xsd/decoration-1.1.0.xsd" name="Curator Async">
+    <body>
+        <head>
+            <link rel="stylesheet" href="../css/site.css" />
+            <script type="text/javascript">
+                $(function(){
+                $('a[title="Curator RPC Proxy"]').parent().addClass("active");
+                });
+            </script>
+        </head>
+    </body>
+</project>

http://git-wip-us.apache.org/repos/asf/curator/blob/908b5c6c/curator-x-async/src/test/java/org/apache/curator/framework/imps/TestFramework.java
----------------------------------------------------------------------
diff --git a/curator-x-async/src/test/java/org/apache/curator/framework/imps/TestFramework.java b/curator-x-async/src/test/java/org/apache/curator/framework/imps/TestFramework.java
index cd2f598..adc85da 100644
--- a/curator-x-async/src/test/java/org/apache/curator/framework/imps/TestFramework.java
+++ b/curator-x-async/src/test/java/org/apache/curator/framework/imps/TestFramework.java
@@ -1,3 +1,21 @@
+/**
+ * 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.curator.framework.imps;
 
 import com.google.common.collect.Lists;

http://git-wip-us.apache.org/repos/asf/curator/blob/908b5c6c/curator-x-async/src/test/java/org/apache/curator/framework/imps/TestFrameworkBackground.java
----------------------------------------------------------------------
diff --git a/curator-x-async/src/test/java/org/apache/curator/framework/imps/TestFrameworkBackground.java b/curator-x-async/src/test/java/org/apache/curator/framework/imps/TestFrameworkBackground.java
index ce41d08..52c3faa 100644
--- a/curator-x-async/src/test/java/org/apache/curator/framework/imps/TestFrameworkBackground.java
+++ b/curator-x-async/src/test/java/org/apache/curator/framework/imps/TestFrameworkBackground.java
@@ -1,3 +1,21 @@
+/**
+ * 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.curator.framework.imps;
 
 import com.google.common.collect.Lists;

http://git-wip-us.apache.org/repos/asf/curator/blob/908b5c6c/curator-x-async/src/test/java/org/apache/curator/x/async/TestBasicOperations.java
----------------------------------------------------------------------
diff --git a/curator-x-async/src/test/java/org/apache/curator/x/async/TestBasicOperations.java b/curator-x-async/src/test/java/org/apache/curator/x/async/TestBasicOperations.java
index d66db72..34c02aa 100644
--- a/curator-x-async/src/test/java/org/apache/curator/x/async/TestBasicOperations.java
+++ b/curator-x-async/src/test/java/org/apache/curator/x/async/TestBasicOperations.java
@@ -24,6 +24,7 @@ import org.apache.curator.retry.RetryOneTime;
 import org.apache.curator.test.BaseClassForTests;
 import org.apache.curator.test.Timing;
 import org.apache.curator.utils.CloseableUtils;
+import org.apache.zookeeper.KeeperException;
 import org.apache.zookeeper.Watcher;
 import org.apache.zookeeper.data.Stat;
 import org.testng.Assert;
@@ -91,6 +92,19 @@ public class TestBasicOperations extends BaseClassForTests
     }
 
     @Test
+    public void testException()
+    {
+        CountDownLatch latch = new CountDownLatch(1);
+        client.getData().forPath("/woop").exceptionally(e -> {
+            Assert.assertTrue(e instanceof KeeperException);
+            Assert.assertEquals(((KeeperException)e).code(), KeeperException.Code.NONODE);
+            latch.countDown();
+            return null;
+        });
+        Assert.assertTrue(timing.awaitLatch(latch));
+    }
+
+    @Test
     public void testWatching()
     {
         CountDownLatch latch = new CountDownLatch(1);

http://git-wip-us.apache.org/repos/asf/curator/blob/908b5c6c/curator-x-rpc/src/site/site.xml
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/site/site.xml b/curator-x-rpc/src/site/site.xml
index fca1e73..135c902 100644
--- a/curator-x-rpc/src/site/site.xml
+++ b/curator-x-rpc/src/site/site.xml
@@ -25,7 +25,7 @@
             <link rel="stylesheet" href="../css/site.css" />
             <script type="text/javascript">
                 $(function(){
-                $('a[title="Curator RPC Proxy"]').parent().addClass("active");
+                $('a[title="Curator Async"]').parent().addClass("active");
                 });
             </script>
         </head>

http://git-wip-us.apache.org/repos/asf/curator/blob/908b5c6c/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 832fce1..b930b3b 100644
--- a/pom.xml
+++ b/pom.xml
@@ -61,7 +61,7 @@
         <!-- versions -->
         <zookeeper-version>3.5.1-alpha</zookeeper-version>
         <maven-project-info-reports-plugin-version>2.7</maven-project-info-reports-plugin-version>
-        <maven-bundle-plugin-version>2.3.7</maven-bundle-plugin-version>
+        <maven-bundle-plugin-version>3.2.0</maven-bundle-plugin-version>
         <maven-javadoc-plugin-version>2.10.3</maven-javadoc-plugin-version>
         <doxia-module-confluence-version>1.6</doxia-module-confluence-version>
         <maven-license-plugin-version>1.9.0</maven-license-plugin-version>

http://git-wip-us.apache.org/repos/asf/curator/blob/908b5c6c/src/site/site.xml
----------------------------------------------------------------------
diff --git a/src/site/site.xml b/src/site/site.xml
index c28df31..222ffde 100644
--- a/src/site/site.xml
+++ b/src/site/site.xml
@@ -94,6 +94,7 @@
             <item name="Service Discovery" href="curator-x-discovery/index.html"/>
             <item name="Service Discovery Server" href="curator-x-discovery-server/index.html"/>
             <item name="Curator RPC Proxy" href="curator-x-rpc/index.html"/>
+            <item name="Curator Async" href="curator-x-async/index.html"/>
         </menu>
 
         <menu name="Community" inherit="top">


[33/50] curator git commit: Merge branch 'master' into CURATOR-3.0

Posted by dr...@apache.org.
Merge branch 'master' into CURATOR-3.0


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

Branch: refs/heads/master
Commit: 7d44baee3d87890b67fc4900f204bb5111368079
Parents: 87a145c 1571588
Author: randgalt <ra...@apache.org>
Authored: Thu Mar 9 14:28:15 2017 -0800
Committer: randgalt <ra...@apache.org>
Committed: Thu Mar 9 14:28:15 2017 -0800

----------------------------------------------------------------------
 .../framework/recipes/nodes/PersistentNode.java |  9 +++-
 .../nodes/TestPersistentEphemeralNode.java      | 52 +++++++++++++++++++-
 2 files changed, 58 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/curator/blob/7d44baee/curator-recipes/src/main/java/org/apache/curator/framework/recipes/nodes/PersistentNode.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/curator/blob/7d44baee/curator-recipes/src/test/java/org/apache/curator/framework/recipes/nodes/TestPersistentEphemeralNode.java
----------------------------------------------------------------------
diff --cc curator-recipes/src/test/java/org/apache/curator/framework/recipes/nodes/TestPersistentEphemeralNode.java
index 15c5f2e,ef8a45a..7d52b58
--- a/curator-recipes/src/test/java/org/apache/curator/framework/recipes/nodes/TestPersistentEphemeralNode.java
+++ b/curator-recipes/src/test/java/org/apache/curator/framework/recipes/nodes/TestPersistentEphemeralNode.java
@@@ -23,9 -22,9 +23,10 @@@ import com.google.common.collect.Immuta
  import com.google.common.collect.Lists;
  import org.apache.curator.framework.CuratorFramework;
  import org.apache.curator.framework.CuratorFrameworkFactory;
+ import org.apache.curator.framework.api.ACLProvider;
  import org.apache.curator.framework.api.BackgroundCallback;
  import org.apache.curator.framework.api.CuratorEvent;
 +import org.apache.curator.framework.imps.TestCleanState;
  import org.apache.curator.framework.state.ConnectionState;
  import org.apache.curator.framework.state.ConnectionStateListener;
  import org.apache.curator.retry.RetryOneTime;
@@@ -49,8 -46,8 +50,9 @@@ import org.testng.annotations.Test
  import java.io.IOException;
  import java.util.Arrays;
  import java.util.Collection;
+ import java.util.Collections;
  import java.util.List;
 +import java.util.Set;
  import java.util.concurrent.CountDownLatch;
  import java.util.concurrent.Semaphore;
  import java.util.concurrent.TimeUnit;


[08/50] curator git commit: added info to pom - doc fixes

Posted by dr...@apache.org.
added info to pom - doc fixes


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

Branch: refs/heads/master
Commit: 8f592095d295a7dffe44fb6b0432d703bd4cf5b4
Parents: 21f3ac2
Author: randgalt <ra...@apache.org>
Authored: Sun Jan 8 09:41:54 2017 -0500
Committer: randgalt <ra...@apache.org>
Committed: Sun Jan 8 09:41:54 2017 -0500

----------------------------------------------------------------------
 curator-x-async/pom.xml                           |  4 ++++
 .../src/site/confluence/index.confluence          | 18 ++++++++++++++----
 2 files changed, 18 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/curator/blob/8f592095/curator-x-async/pom.xml
----------------------------------------------------------------------
diff --git a/curator-x-async/pom.xml b/curator-x-async/pom.xml
index e51e001..8821a47 100644
--- a/curator-x-async/pom.xml
+++ b/curator-x-async/pom.xml
@@ -9,6 +9,10 @@
 
     <artifactId>curator-x-async</artifactId>
 
+    <name>Curator Async</name>
+    <description>Java 8 Async DSL</description>
+    <inceptionYear>2017</inceptionYear>
+
     <dependencies>
         <dependency>
             <groupId>org.apache.curator</groupId>

http://git-wip-us.apache.org/repos/asf/curator/blob/8f592095/curator-x-async/src/site/confluence/index.confluence
----------------------------------------------------------------------
diff --git a/curator-x-async/src/site/confluence/index.confluence b/curator-x-async/src/site/confluence/index.confluence
index 757acc8..c896df7 100644
--- a/curator-x-async/src/site/confluence/index.confluence
+++ b/curator-x-async/src/site/confluence/index.confluence
@@ -6,13 +6,13 @@ Curator Async is in its own package in Maven Central: curator\-x\-async
 
 h2. What Is a Curator Async?
 
-Curator Async is a brand new [DSL|https://en.wikipedia.org/wiki/Domain-specific_language] that wraps existing
-{{CuratorFramework}} instances. This new DSL is entirely asynchronous and uses
+Curator Async is a [DSL|https://en.wikipedia.org/wiki/Domain-specific_language] that wraps existing
+{{CuratorFramework}} instances. This DSL is entirely asynchronous and uses
 [Java 8's CompletionStage|https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/CompletionStage.html]
 mechanism for chaining, composing, etc. Additionally, Curator's original DSL has been cleaned up
 and simplified, in particular for operations such as {{create()}}.
 
-With this new async DSL you can do asynchronous tasks in a more natural, functional way using
+With this DSL you can do asynchronous tasks in a more natural, functional way using
 [Java 8 lambdas|https://docs.oracle.com/javase/tutorial/java/javaOO/lambdaexpressions.html]. For example:
 
 {code}
@@ -92,12 +92,14 @@ stage.event().exceptionally(e -> {
 
     ... note a connection problem ...
 
-    asyncEx.reset().thenRun(() -> successMethod());
+    asyncEx.reset().thenAccept(watchedEvent -> watchWasTriggered(watchedEvent));
 });
 {code}
 
 h2. Examples
 
+h4. Create a sequential ZNode
+
 Create a sequential ZNode and, once successfully completed, set a watcher
 on the ZNode. Note: this code does not deal with errors. Should a connection
 problem occur or another exception occur, the completion lambda will never be called.
@@ -109,6 +111,8 @@ async.create().withMode(PERSISTENT_SEQUENTIAL).forPath(path).thenAccept(actualPa
 
 ----
 
+h4. AsyncStage canonical usage
+
 This is the canonical way to deal with AsyncStage. Use the handle() method which provides
 both the success value and the exception. The exception will be non\-null on error.
 
@@ -128,6 +132,8 @@ async.create().withOptions(EnumSet.of(doProtected)).forPath(path).handle((actual
 
 ----
 
+h4. Using executors
+
 Your completion routines can operate in a separate thread if you provide an executor.
 
 {code}
@@ -137,6 +143,8 @@ async.create().withOptions(EnumSet.of(createParentsIfNeeded)).forPath("/a/b/c")
 
 ----
 
+h4. Separate handlers
+
 This example shows specifying separate completion handlers for success and exception.
 
 {code}
@@ -157,6 +165,8 @@ stage.thenAccept(data -> processData(data));
 
 ----
 
+h4. Synchronous usage
+
 CompletionStage provides a blocking method as well so that you can block to get the result
 of an operation. i.e. this makes it possible to use the async APIs in a synchronous way.
 


[38/50] curator git commit: correct version of ZK that has TTL nodes

Posted by dr...@apache.org.
correct version of ZK that has TTL nodes


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

Branch: refs/heads/master
Commit: e7d57eccfc756efb2cac83edf25da9d57f740553
Parents: 9654778
Author: randgalt <ra...@apache.org>
Authored: Mon Apr 3 10:33:56 2017 -0500
Committer: randgalt <ra...@apache.org>
Committed: Mon Apr 3 10:33:56 2017 -0500

----------------------------------------------------------------------
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/curator/blob/e7d57ecc/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index b086df0..4027ae7 100644
--- a/pom.xml
+++ b/pom.xml
@@ -59,7 +59,7 @@
         <jdk-version>1.7</jdk-version>
 
         <!-- versions -->
-        <zookeeper-version>3.6.0-SNAPSHOT</zookeeper-version>
+        <zookeeper-version>3.5.3-beta</zookeeper-version>
         <maven-project-info-reports-plugin-version>2.7</maven-project-info-reports-plugin-version>
         <maven-bundle-plugin-version>2.3.7</maven-bundle-plugin-version>
         <maven-javadoc-plugin-version>2.10.3</maven-javadoc-plugin-version>


[35/50] curator git commit: Merge branch 'master' into CURATOR-3.0

Posted by dr...@apache.org.
Merge branch 'master' into CURATOR-3.0


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

Branch: refs/heads/master
Commit: 850b6e4e427028aa6366cd51d524570a10343a97
Parents: 0e23fba 29fb6de
Author: randgalt <ra...@apache.org>
Authored: Sat Mar 18 09:43:10 2017 -0500
Committer: randgalt <ra...@apache.org>
Committed: Sat Mar 18 09:43:10 2017 -0500

----------------------------------------------------------------------
 README                               |  7 -------
 README.md                            | 11 +++++++++++
 src/site/confluence/index.confluence |  2 ++
 3 files changed, 13 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/curator/blob/850b6e4e/src/site/confluence/index.confluence
----------------------------------------------------------------------


[21/50] curator git commit: Merge branch 'master' into CURATOR-3.0

Posted by dr...@apache.org.
Merge branch 'master' into CURATOR-3.0


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

Branch: refs/heads/master
Commit: 8e7fbac86dfe14f18a540a6a10c75f5bfe74120a
Parents: 304da97 a47ab1e
Author: randgalt <ra...@apache.org>
Authored: Mon Jan 16 13:27:31 2017 -0500
Committer: randgalt <ra...@apache.org>
Committed: Mon Jan 16 13:27:31 2017 -0500

----------------------------------------------------------------------
 curator-client/pom.xml      | 40 ++++++++++++++++++++++++++++++++--
 curator-recipes/pom.xml     |  6 +++++
 curator-test/pom.xml        | 47 +++++++++++++++++++++++++++++++++++-----
 curator-x-discovery/pom.xml |  6 +++++
 pom.xml                     | 43 +++++++++++++++++++++++++++++++++++-
 5 files changed, 133 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/curator/blob/8e7fbac8/curator-client/pom.xml
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/curator/blob/8e7fbac8/curator-recipes/pom.xml
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/curator/blob/8e7fbac8/curator-test/pom.xml
----------------------------------------------------------------------
diff --cc curator-test/pom.xml
index c81dfec,4cac12b..afc9f36
--- a/curator-test/pom.xml
+++ b/curator-test/pom.xml
@@@ -41,11 -41,11 +41,6 @@@
          </dependency>
  
          <dependency>
-             <groupId>org.apache.commons</groupId>
-             <artifactId>commons-math</artifactId>
 -            <groupId>org.javassist</groupId>
 -            <artifactId>javassist</artifactId>
--        </dependency>
--
--        <dependency>
              <groupId>com.google.guava</groupId>
              <artifactId>guava</artifactId>
          </dependency>

http://git-wip-us.apache.org/repos/asf/curator/blob/8e7fbac8/curator-x-discovery/pom.xml
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/curator/blob/8e7fbac8/pom.xml
----------------------------------------------------------------------


[34/50] curator git commit: Merge branch 'master' into CURATOR-3.0

Posted by dr...@apache.org.
Merge branch 'master' into CURATOR-3.0


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

Branch: refs/heads/master
Commit: 0e23fbac1be51df269f1b396af03980f8a614cab
Parents: 7d44bae 337b9d9
Author: randgalt <ra...@apache.org>
Authored: Sat Mar 11 15:51:56 2017 -0800
Committer: randgalt <ra...@apache.org>
Committed: Sat Mar 11 15:51:56 2017 -0800

----------------------------------------------------------------------
 .../org/apache/curator/ensemble/fixed/FixedEnsembleProvider.java | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/curator/blob/0e23fbac/curator-client/src/main/java/org/apache/curator/ensemble/fixed/FixedEnsembleProvider.java
----------------------------------------------------------------------
diff --cc curator-client/src/main/java/org/apache/curator/ensemble/fixed/FixedEnsembleProvider.java
index 5f486f4,ce650a9..0762607
--- a/curator-client/src/main/java/org/apache/curator/ensemble/fixed/FixedEnsembleProvider.java
+++ b/curator-client/src/main/java/org/apache/curator/ensemble/fixed/FixedEnsembleProvider.java
@@@ -19,10 -19,9 +19,11 @@@
  package org.apache.curator.ensemble.fixed;
  
  import com.google.common.base.Preconditions;
+ import com.google.common.base.Strings;
  import org.apache.curator.ensemble.EnsembleProvider;
 +import org.apache.zookeeper.ZooKeeper;
  import java.io.IOException;
 +import java.util.concurrent.atomic.AtomicReference;
  
  /**
   * Standard ensemble provider that wraps a fixed connection string
@@@ -39,19 -37,9 +40,20 @@@ public class FixedEnsembleProvider impl
       */
      public FixedEnsembleProvider(String connectionString)
      {
 -        Preconditions.checkArgument(!Strings.isNullOrEmpty(connectionString),
 -            "connectionString cannot be null or empty");
 -        this.connectionString = connectionString;
 +        this(connectionString, true);
 +    }
 +
 +    /**
 +     * The connection string to use
 +     *
 +     * @param connectionString connection string
 +     * @param updateServerListEnabled if true, allow Curator to call {@link ZooKeeper#updateServerList(String)}
 +     */
 +    public FixedEnsembleProvider(String connectionString, boolean updateServerListEnabled)
 +    {
 +        this.updateServerListEnabled = updateServerListEnabled;
-         this.connectionString.set(Preconditions.checkNotNull(connectionString, "connectionString cannot be null"));
++        Preconditions.checkArgument(!Strings.isNullOrEmpty(connectionString), "connectionString cannot be null or empty");
++        this.connectionString.set(connectionString);
      }
  
      @Override


[18/50] curator git commit: Merge branch 'master' into CURATOR-3.0

Posted by dr...@apache.org.
Merge branch 'master' into CURATOR-3.0


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

Branch: refs/heads/master
Commit: 540cd28a33bccc6423765851631a02dcd974b89f
Parents: f645190 2342578
Author: randgalt <ra...@apache.org>
Authored: Wed Jan 11 21:44:46 2017 -0500
Committer: randgalt <ra...@apache.org>
Committed: Wed Jan 11 21:44:46 2017 -0500

----------------------------------------------------------------------
 .../src/main/java/org/apache/curator/utils/DebugUtils.java          | 1 +
 1 file changed, 1 insertion(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/curator/blob/540cd28a/curator-client/src/main/java/org/apache/curator/utils/DebugUtils.java
----------------------------------------------------------------------
diff --cc curator-client/src/main/java/org/apache/curator/utils/DebugUtils.java
index beea726,ce751ec..45eea22
--- a/curator-client/src/main/java/org/apache/curator/utils/DebugUtils.java
+++ b/curator-client/src/main/java/org/apache/curator/utils/DebugUtils.java
@@@ -21,12 -20,10 +21,13 @@@ package org.apache.curator.utils
  
  public class DebugUtils
  {
 -    public static final String          PROPERTY_LOG_EVENTS = "curator-log-events";
 -    public static final String          PROPERTY_DONT_LOG_CONNECTION_ISSUES = "curator-dont-log-connection-problems";
 -    public static final String          PROPERTY_LOG_ONLY_FIRST_CONNECTION_ISSUE_AS_ERROR_LEVEL = "curator-log-only-first-connection-issue-as-error-level";
 +    public static final String PROPERTY_LOG_EVENTS = "curator-log-events";
 +    public static final String PROPERTY_DONT_LOG_CONNECTION_ISSUES = "curator-dont-log-connection-problems";
 +    public static final String PROPERTY_LOG_ONLY_FIRST_CONNECTION_ISSUE_AS_ERROR_LEVEL = "curator-log-only-first-connection-issue-as-error-level";
 +    public static final String PROPERTY_REMOVE_WATCHERS_IN_FOREGROUND = "curator-remove-watchers-in-foreground";
 +    public static final String PROPERTY_VALIDATE_NAMESPACE_WATCHER_MAP_EMPTY = "curator-validate-namespace-watcher-map-empty";
 +
+ 
      private DebugUtils()
      {
      }


[26/50] curator git commit: doc clarification

Posted by dr...@apache.org.
doc clarification


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

Branch: refs/heads/master
Commit: 3a966eae1eedfad1324ce689c9f168c48ad27bd1
Parents: 600a2f9
Author: randgalt <ra...@apache.org>
Authored: Mon Jan 23 21:55:28 2017 -0500
Committer: randgalt <ra...@apache.org>
Committed: Mon Jan 23 21:55:28 2017 -0500

----------------------------------------------------------------------
 curator-x-async/src/site/confluence/index.confluence | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/curator/blob/3a966eae/curator-x-async/src/site/confluence/index.confluence
----------------------------------------------------------------------
diff --git a/curator-x-async/src/site/confluence/index.confluence b/curator-x-async/src/site/confluence/index.confluence
index dedcef7..34b6c36 100644
--- a/curator-x-async/src/site/confluence/index.confluence
+++ b/curator-x-async/src/site/confluence/index.confluence
@@ -80,7 +80,7 @@ h4. AsyncEventException
 When an async watcher fails the exception set in the CompletionStage will be of type {{AsyncEventException}}.
 This exception allows you to see the KeeperState that caused the trigger and allows you to reset the
 completion stage. Reset is needed because ZooKeeper temporarily triggers watchers when there is a connection
-event. However, the watcher stays set for the original operation. Use {{AsyncEventException#reset}}
+event (unless {{WatchMode.successOnly}} is used). However, the watcher stays set for the original operation. Use {{AsyncEventException#reset}}
 to start a new completion stage that will wait on the next trigger of the watcher.
 
 E.g.


[30/50] curator git commit: not needed

Posted by dr...@apache.org.
not needed


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

Branch: refs/heads/master
Commit: 753142a7652401510096b35c516077b9b8fe38e5
Parents: d7a65ad
Author: randgalt <ra...@apache.org>
Authored: Tue Feb 28 19:56:12 2017 -0300
Committer: randgalt <ra...@apache.org>
Committed: Tue Feb 28 19:56:12 2017 -0300

----------------------------------------------------------------------
 .../apache/curator/ConnectionStateAccessor.java | 45 --------------------
 1 file changed, 45 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/curator/blob/753142a7/curator-framework/src/test/java/org/apache/curator/ConnectionStateAccessor.java
----------------------------------------------------------------------
diff --git a/curator-framework/src/test/java/org/apache/curator/ConnectionStateAccessor.java b/curator-framework/src/test/java/org/apache/curator/ConnectionStateAccessor.java
deleted file mode 100644
index 0efa989..0000000
--- a/curator-framework/src/test/java/org/apache/curator/ConnectionStateAccessor.java
+++ /dev/null
@@ -1,45 +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.curator;
-
-import org.apache.curator.framework.CuratorFramework;
-
-import java.lang.reflect.Field;
-
-public final class ConnectionStateAccessor
-{
-    public static void setDebugWaitOnExpiredForClient(CuratorFramework client)
-    {
-        CuratorZookeeperClient zookeeperClient = client.getZookeeperClient();
-        ConnectionState state = (ConnectionState)getInternalState(zookeeperClient, "state");
-        state.debugWaitOnExpiredEvent = true;
-    }
-
-    private static Object getInternalState(Object target, String field) {
-        Class<?> c = target.getClass();
-        try {
-            Field f = c.getDeclaredField(field);
-            f.setAccessible(true);
-            return f.get(target);
-        } catch (Exception e) {
-            throw new RuntimeException("Unable to get internal state on a private field.", e);
-        }
-    }
-}


[19/50] curator git commit: Merge branch 'master' into CURATOR-3.0

Posted by dr...@apache.org.
Merge branch 'master' into CURATOR-3.0


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

Branch: refs/heads/master
Commit: 5cf7d050fa9905332e358cfaeb93d2e739d158a0
Parents: 540cd28 cc49ae9
Author: randgalt <ra...@apache.org>
Authored: Thu Jan 12 12:09:03 2017 -0500
Committer: randgalt <ra...@apache.org>
Committed: Thu Jan 12 12:09:03 2017 -0500

----------------------------------------------------------------------
 .../recipes/nodes/TestGroupMember.java          | 28 ++++++++++++++++----
 1 file changed, 23 insertions(+), 5 deletions(-)
----------------------------------------------------------------------



[44/50] curator git commit: Merge branch 'CURATOR-3.0' into CURATOR-351

Posted by dr...@apache.org.
Merge branch 'CURATOR-3.0' into CURATOR-351


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

Branch: refs/heads/master
Commit: e3fec5bc7fcd1091c3f07317039d1d5ed20f2d66
Parents: f89c1ea 1939389
Author: randgalt <ra...@apache.org>
Authored: Mon Apr 17 13:27:13 2017 -0500
Committer: randgalt <ra...@apache.org>
Committed: Mon Apr 17 13:27:13 2017 -0500

----------------------------------------------------------------------
 doap.rdf | 4 +++-
 pom.xml  | 2 +-
 2 files changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/curator/blob/e3fec5bc/pom.xml
----------------------------------------------------------------------


[20/50] curator git commit: testChildReaperCleansUpLockNodes() didn't work when container nodes are used

Posted by dr...@apache.org.
testChildReaperCleansUpLockNodes() didn't work when container nodes are used


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

Branch: refs/heads/master
Commit: 304da977e32b7f311cefc9cba3d28e2ec236e38b
Parents: 5cf7d05
Author: randgalt <ra...@apache.org>
Authored: Fri Jan 13 09:04:31 2017 -0500
Committer: randgalt <ra...@apache.org>
Committed: Fri Jan 13 09:04:31 2017 -0500

----------------------------------------------------------------------
 .../recipes/locks/TestInterProcessSemaphore.java         | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/curator/blob/304da977/curator-recipes/src/test/java/org/apache/curator/framework/recipes/locks/TestInterProcessSemaphore.java
----------------------------------------------------------------------
diff --git a/curator-recipes/src/test/java/org/apache/curator/framework/recipes/locks/TestInterProcessSemaphore.java b/curator-recipes/src/test/java/org/apache/curator/framework/recipes/locks/TestInterProcessSemaphore.java
index 488b776..73c76e8 100644
--- a/curator-recipes/src/test/java/org/apache/curator/framework/recipes/locks/TestInterProcessSemaphore.java
+++ b/curator-recipes/src/test/java/org/apache/curator/framework/recipes/locks/TestInterProcessSemaphore.java
@@ -691,9 +691,16 @@ public class TestInterProcessSemaphore extends BaseClassForTests
 
             timing.forWaiting().sleepABit();
 
-            List<String> children = client.getChildren().forPath("/test");
+            try
+            {
+                List<String> children = client.getChildren().forPath("/test");
 
-            Assert.assertEquals(children.size(), 0, "All children of /test should have been reaped");
+                Assert.assertEquals(children.size(), 0, "All children of /test should have been reaped");
+            }
+            catch ( KeeperException.NoNodeException ok )
+            {
+                // this is OK - if Container Nodes are used the "/test" path will go away - no point in updating the test for deprecated code
+            }
         }
         finally
         {


[15/50] curator git commit: doc refinement

Posted by dr...@apache.org.
doc refinement


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

Branch: refs/heads/master
Commit: 2ef420cab3bc2951559304786b9789763b796292
Parents: e45466a
Author: randgalt <ra...@apache.org>
Authored: Mon Jan 9 20:03:51 2017 -0500
Committer: randgalt <ra...@apache.org>
Committed: Mon Jan 9 20:03:51 2017 -0500

----------------------------------------------------------------------
 curator-x-async/src/site/confluence/index.confluence | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/curator/blob/2ef420ca/curator-x-async/src/site/confluence/index.confluence
----------------------------------------------------------------------
diff --git a/curator-x-async/src/site/confluence/index.confluence b/curator-x-async/src/site/confluence/index.confluence
index 6ccc048..ca3c07e 100644
--- a/curator-x-async/src/site/confluence/index.confluence
+++ b/curator-x-async/src/site/confluence/index.confluence
@@ -25,7 +25,7 @@ h2. Usage
 
 Note: To use Curator Async, you should be familiar with Java 8's lambdas, CompletedFuture and CompletionStage.
 
-Create a CuratorFramework instance in the normal way. You then wrap this instance using
+Create a [[CuratorFramework|../curator\-framework/index.html]] instance in the normal way. You then wrap this instance using
 AsyncCuratorFramework. i.e.
 
 {code}
@@ -106,7 +106,7 @@ problem occur or another exception occur, the completion lambda will never be ca
 
 {code}
 async.create().withMode(PERSISTENT_SEQUENTIAL).forPath(path).thenAccept(actualPath ->
-    async.watched().getData().forPath(actualPath));
+    async.watched().getData().forPath(actualPath).thenApply(() -> watchTriggered()));
 {code}
 
 ----


[47/50] curator git commit: assertTrue for node.waitForInitialCreate

Posted by dr...@apache.org.
assertTrue for node.waitForInitialCreate


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

Branch: refs/heads/master
Commit: b84d351a5f3c44ab5450c690b462388cb0a90697
Parents: da7f18c
Author: randgalt <ra...@apache.org>
Authored: Mon Apr 17 20:26:59 2017 -0500
Committer: randgalt <ra...@apache.org>
Committed: Mon Apr 17 20:26:59 2017 -0500

----------------------------------------------------------------------
 .../curator/framework/recipes/nodes/TestPersistentTtlNode.java | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/curator/blob/b84d351a/curator-recipes/src/test/java/org/apache/curator/framework/recipes/nodes/TestPersistentTtlNode.java
----------------------------------------------------------------------
diff --git a/curator-recipes/src/test/java/org/apache/curator/framework/recipes/nodes/TestPersistentTtlNode.java b/curator-recipes/src/test/java/org/apache/curator/framework/recipes/nodes/TestPersistentTtlNode.java
index 2224bbf..43f5cc0 100644
--- a/curator-recipes/src/test/java/org/apache/curator/framework/recipes/nodes/TestPersistentTtlNode.java
+++ b/curator-recipes/src/test/java/org/apache/curator/framework/recipes/nodes/TestPersistentTtlNode.java
@@ -66,7 +66,7 @@ public class TestPersistentTtlNode extends BaseClassForTests
             try (PersistentTtlNode node = new PersistentTtlNode(client, "/test", 100, new byte[0]))
             {
                 node.start();
-                node.waitForInitialCreate(timing.session(), TimeUnit.MILLISECONDS);
+                Assert.assertTrue(node.waitForInitialCreate(timing.session(), TimeUnit.MILLISECONDS));
 
                 for ( int i = 0; i < 10; ++i )
                 {
@@ -91,7 +91,7 @@ public class TestPersistentTtlNode extends BaseClassForTests
             try (PersistentTtlNode node = new PersistentTtlNode(client, "/test", 10, new byte[0]))
             {
                 node.start();
-                node.waitForInitialCreate(timing.session(), TimeUnit.MILLISECONDS);
+                Assert.assertTrue(node.waitForInitialCreate(timing.session(), TimeUnit.MILLISECONDS));
 
                 for ( int i = 0; i < 10; ++i )
                 {
@@ -131,7 +131,7 @@ public class TestPersistentTtlNode extends BaseClassForTests
                     cache.getListenable().addListener(listener);
 
                     node.start();
-                    node.waitForInitialCreate(timing.session(), TimeUnit.MILLISECONDS);
+                    Assert.assertTrue(node.waitForInitialCreate(timing.session(), TimeUnit.MILLISECONDS));
                     cache.start(BUILD_INITIAL_CACHE);
 
                     Assert.assertEquals(changes.availablePermits(), 0);


[12/50] curator git commit: Merge branch 'master' into CURATOR-3.0

Posted by dr...@apache.org.
Merge branch 'master' into CURATOR-3.0


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

Branch: refs/heads/master
Commit: 770aa411d00f97ce6040f2b4182d6f0fe744262d
Parents: b58cfd0 144977f
Author: randgalt <ra...@apache.org>
Authored: Mon Jan 9 11:27:24 2017 -0500
Committer: randgalt <ra...@apache.org>
Committed: Mon Jan 9 11:27:24 2017 -0500

----------------------------------------------------------------------
 .../apache/curator/framework/recipes/nodes/PersistentNode.java  | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/curator/blob/770aa411/curator-recipes/src/main/java/org/apache/curator/framework/recipes/nodes/PersistentNode.java
----------------------------------------------------------------------
diff --cc curator-recipes/src/main/java/org/apache/curator/framework/recipes/nodes/PersistentNode.java
index 8375967,45f74ca..ecb5e57
--- a/curator-recipes/src/main/java/org/apache/curator/framework/recipes/nodes/PersistentNode.java
+++ b/curator-recipes/src/main/java/org/apache/curator/framework/recipes/nodes/PersistentNode.java
@@@ -61,8 -59,7 +61,7 @@@ public class PersistentNode implements 
  {
      private final AtomicReference<CountDownLatch> initialCreateLatch = new AtomicReference<CountDownLatch>(new CountDownLatch(1));
      private final Logger log = LoggerFactory.getLogger(getClass());
 -    private final CuratorFramework client;
 +    private final WatcherRemoveCuratorFramework client;
-     private final CreateModable<ACLBackgroundPathAndBytesable<String>> createMethod;
      private final AtomicReference<String> nodePath = new AtomicReference<String>(null);
      private final String basePath;
      private final CreateMode mode;


[43/50] curator git commit: Merge branch 'upgrade_clirr' into CURATOR-3.0

Posted by dr...@apache.org.
Merge branch 'upgrade_clirr' into CURATOR-3.0


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

Branch: refs/heads/master
Commit: 1939389e2c072d85385ff8134c26fde3e19437a4
Parents: 191aca2 fcec4b6
Author: Fangmin Lyu <fa...@apache.org>
Authored: Fri Apr 14 20:54:10 2017 -0700
Committer: Fangmin Lyu <fa...@apache.org>
Committed: Fri Apr 14 20:54:10 2017 -0700

----------------------------------------------------------------------
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------



[10/50] curator git commit: Merge branch 'master' into CURATOR-3.0

Posted by dr...@apache.org.
Merge branch 'master' into CURATOR-3.0


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

Branch: refs/heads/master
Commit: b58cfd068dbe4771f83365124693049b6051f63e
Parents: da48ef3 6d392ec
Author: randgalt <ra...@apache.org>
Authored: Sun Jan 8 11:11:17 2017 -0500
Committer: randgalt <ra...@apache.org>
Committed: Sun Jan 8 11:11:17 2017 -0500

----------------------------------------------------------------------
 .../framework/recipes/locks/InterProcessSemaphore.java       | 6 ++++++
 .../framework/recipes/locks/InterProcessSemaphoreV2.java     | 5 +++++
 .../org/apache/curator/framework/recipes/locks/Lease.java    | 8 ++++++++
 3 files changed, 19 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/curator/blob/b58cfd06/curator-recipes/src/main/java/org/apache/curator/framework/recipes/locks/InterProcessSemaphoreV2.java
----------------------------------------------------------------------


[39/50] curator git commit: Merge branch 'CURATOR-3.0' into CURATOR-351

Posted by dr...@apache.org.
Merge branch 'CURATOR-3.0' into CURATOR-351


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

Branch: refs/heads/master
Commit: 1826b66d72f6e543a57aaf5f3acc3cd9ca6e965d
Parents: e7d57ec b3939ac
Author: randgalt <ra...@apache.org>
Authored: Mon Apr 3 10:54:50 2017 -0500
Committer: randgalt <ra...@apache.org>
Committed: Mon Apr 3 10:54:50 2017 -0500

----------------------------------------------------------------------
 README                                          |   7 -
 README.md                                       |  11 +
 curator-client/pom.xml                          |  44 +-
 .../org/apache/curator/ConnectionState.java     |  18 +-
 .../ensemble/fixed/FixedEnsembleProvider.java   |   4 +-
 .../org/apache/curator/utils/DebugUtils.java    |   1 +
 curator-examples/pom.xml                        |   2 +-
 curator-framework/pom.xml                       |   4 +-
 .../curator/framework/CuratorFramework.java     |   1 +
 .../curator/framework/api/CreateBuilder.java    |  10 +
 .../curator/framework/api/CreateBuilder2.java   |  10 +
 .../curator/framework/api/ExistsBuilder.java    |   7 +
 .../curator/framework/imps/Backgrounding.java   |  10 +-
 .../framework/imps/CreateBuilderImpl.java       |  24 +-
 .../imps/CuratorMultiTransactionImpl.java       |   6 +
 .../framework/imps/DeleteBuilderImpl.java       |  12 +-
 .../curator/framework/imps/EnsembleTracker.java |   4 +-
 .../framework/imps/ExistsBuilderImpl.java       |  29 +-
 .../framework/imps/GetACLBuilderImpl.java       |   9 +-
 .../framework/imps/GetChildrenBuilderImpl.java  |  10 +-
 .../framework/imps/GetConfigBuilderImpl.java    |   8 +
 .../framework/imps/GetDataBuilderImpl.java      |  11 +-
 .../curator/framework/imps/NamespaceImpl.java   |   2 +-
 .../framework/imps/ReconfigBuilderImpl.java     |  13 +-
 .../imps/RemoveWatchesBuilderImpl.java          |  12 +
 .../framework/imps/SetACLBuilderImpl.java       |  10 +-
 .../framework/imps/SetDataBuilderImpl.java      |  10 +-
 .../curator/framework/imps/SyncBuilderImpl.java |   6 +
 .../src/site/confluence/index.confluence        |   2 +
 .../framework/imps/TestNamespaceFacade.java     |  10 +
 curator-recipes/pom.xml                         |  10 +-
 .../recipes/cache/PathChildrenCache.java        |   2 +-
 .../framework/recipes/cache/TreeCache.java      |  67 +-
 .../recipes/leader/LeaderSelector.java          |  48 +-
 .../recipes/locks/InterProcessSemaphore.java    |   6 +
 .../locks/InterProcessSemaphoreMutex.java       |  13 +-
 .../recipes/locks/InterProcessSemaphoreV2.java  |   5 +
 .../curator/framework/recipes/locks/Lease.java  |   8 +
 .../framework/recipes/nodes/PersistentNode.java |  28 +-
 .../cache/TestPathChildrenCacheInCluster.java   |  60 ++
 .../recipes/leader/TestLeaderAcls.java          | 133 ++++
 .../recipes/leader/TestLeaderSelector.java      |   2 +-
 .../leader/TestLeaderSelectorParticipants.java  |   2 +-
 .../locks/TestInterProcessSemaphore.java        |  11 +-
 .../recipes/nodes/TestGroupMember.java          |  28 +-
 .../nodes/TestPersistentEphemeralNode.java      |  52 +-
 curator-test/pom.xml                            |  51 +-
 .../apache/curator/test/BaseClassForTests.java  | 148 ++++-
 .../org/apache/curator/test/InstanceSpec.java   |  58 +-
 .../curator/test/QuorumConfigBuilder.java       |   9 +-
 .../curator/test/TestQuorumConfigBuilder.java   |  49 ++
 curator-x-async/pom.xml                         |  46 ++
 .../curator/x/async/AsyncCuratorFramework.java  | 110 ++++
 .../curator/x/async/AsyncEventException.java    |  46 ++
 .../org/apache/curator/x/async/AsyncResult.java | 118 ++++
 .../org/apache/curator/x/async/AsyncStage.java  |  37 ++
 .../org/apache/curator/x/async/WatchMode.java   |  43 ++
 .../curator/x/async/api/AsyncCreateBuilder.java | 144 +++++
 .../x/async/api/AsyncCuratorFrameworkDsl.java   | 116 ++++
 .../curator/x/async/api/AsyncDeleteBuilder.java |  55 ++
 .../curator/x/async/api/AsyncEnsemblable.java   |  32 +
 .../curator/x/async/api/AsyncExistsBuilder.java |  37 ++
 .../curator/x/async/api/AsyncGetACLBuilder.java |  38 ++
 .../x/async/api/AsyncGetChildrenBuilder.java    |  37 ++
 .../x/async/api/AsyncGetConfigBuilder.java      |  36 ++
 .../x/async/api/AsyncGetDataBuilder.java        |  53 ++
 .../x/async/api/AsyncMultiTransaction.java      |  39 ++
 .../x/async/api/AsyncPathAndBytesable.java      |  36 ++
 .../curator/x/async/api/AsyncPathable.java      |  34 +
 .../x/async/api/AsyncReconfigBuilder.java       | 118 ++++
 .../x/async/api/AsyncRemoveWatchesBuilder.java  | 126 ++++
 .../curator/x/async/api/AsyncSetACLBuilder.java |  49 ++
 .../x/async/api/AsyncSetDataBuilder.java        |  54 ++
 .../curator/x/async/api/AsyncSyncBuilder.java   |  29 +
 .../async/api/AsyncTransactionCheckBuilder.java |  35 +
 .../api/AsyncTransactionCreateBuilder.java      |  66 ++
 .../api/AsyncTransactionDeleteBuilder.java      |  35 +
 .../curator/x/async/api/AsyncTransactionOp.java |  54 ++
 .../api/AsyncTransactionSetDataBuilder.java     |  51 ++
 .../curator/x/async/api/CreateOption.java       |  76 +++
 .../curator/x/async/api/DeleteOption.java       |  44 ++
 .../curator/x/async/api/ExistsOption.java       |  35 +
 .../x/async/api/RemoveWatcherOption.java        |  45 ++
 .../api/WatchableAsyncCuratorFramework.java     |  54 ++
 .../x/async/details/AsyncCreateBuilderImpl.java | 164 +++++
 .../details/AsyncCuratorFrameworkImpl.java      | 228 +++++++
 .../x/async/details/AsyncDeleteBuilderImpl.java |  75 +++
 .../x/async/details/AsyncExistsBuilderImpl.java |  69 ++
 .../details/AsyncGetChildrenBuilderImpl.java    |  61 ++
 .../details/AsyncGetConfigBuilderImpl.java      |  60 ++
 .../async/details/AsyncGetDataBuilderImpl.java  |  76 +++
 .../async/details/AsyncReconfigBuilderImpl.java | 125 ++++
 .../details/AsyncRemoveWatchesBuilderImpl.java  | 174 +++++
 .../x/async/details/AsyncResultImpl.java        | 142 +++++
 .../x/async/details/AsyncSetACLBuilderImpl.java |  68 ++
 .../async/details/AsyncSetDataBuilderImpl.java  |  84 +++
 .../x/async/details/AsyncTransactionOpImpl.java | 233 +++++++
 .../curator/x/async/details/BackgroundProc.java |  27 +
 .../x/async/details/BackgroundProcs.java        |  83 +++
 .../curator/x/async/details/BuilderCommon.java  |  41 ++
 .../apache/curator/x/async/details/Filters.java |  53 ++
 .../x/async/details/InternalCallback.java       |  55 ++
 .../x/async/details/InternalWatcher.java        |  96 +++
 .../src/site/confluence/index.confluence        | 224 +++++++
 curator-x-async/src/site/site.xml               |  33 +
 .../curator/framework/imps/TestFramework.java   | 631 +++++++++++++++++++
 .../framework/imps/TestFrameworkBackground.java | 290 +++++++++
 .../curator/x/async/TestBasicOperations.java    | 216 +++++++
 curator-x-discovery-server/pom.xml              |   4 +-
 curator-x-discovery/pom.xml                     |  10 +-
 .../curator/x/discovery/ServiceInstance.java    |  32 +-
 .../x/discovery/ServiceInstanceBuilder.java     |   9 +-
 .../discovery/details/ServiceProviderImpl.java  |   8 +
 .../x/discovery/TestJsonInstanceSerializer.java |  35 +-
 .../discovery/details/TestServiceProvider.java  | 109 ++++
 curator-x-rpc/pom.xml                           |   4 +-
 curator-x-rpc/src/site/site.xml                 |   2 +-
 pom.xml                                         |  63 +-
 src/site/confluence/index.confluence            |   2 +
 src/site/site.xml                               |   1 +
 120 files changed, 6435 insertions(+), 177 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/curator/blob/1826b66d/curator-framework/src/main/java/org/apache/curator/framework/api/CreateBuilder.java
----------------------------------------------------------------------
diff --cc curator-framework/src/main/java/org/apache/curator/framework/api/CreateBuilder.java
index 431a945,564d11b..59b3510
--- a/curator-framework/src/main/java/org/apache/curator/framework/api/CreateBuilder.java
+++ b/curator-framework/src/main/java/org/apache/curator/framework/api/CreateBuilder.java
@@@ -18,9 -18,8 +18,19 @@@
   */
  package org.apache.curator.framework.api;
  
 -public interface CreateBuilder extends
 -    CreateBuilderMain
 +public interface CreateBuilder extends CreateBuilderMain
  {
 -    CreateBuilderMain orSetData();
++    /**
++     * Specify a TTL when mode is {@link org.apache.zookeeper.CreateMode#PERSISTENT_WITH_TTL} or
++     * {@link org.apache.zookeeper.CreateMode#PERSISTENT_SEQUENTIAL_WITH_TTL}. If
++     * the znode has not been modified within the given TTL, it will be deleted once it has no
++     * children. The TTL unit is milliseconds and must be greater than 0 and less than or equal to
++     * EphemeralType.MAX_TTL.
++     *
++     * @param ttl the ttl
++     * @return this for chaining
++     */
 +    CreateBuilderMain withTtl(long ttl);
 +
 +    CreateBuilder2 orSetData();
  }

http://git-wip-us.apache.org/repos/asf/curator/blob/1826b66d/curator-framework/src/main/java/org/apache/curator/framework/api/CreateBuilder2.java
----------------------------------------------------------------------
diff --cc curator-framework/src/main/java/org/apache/curator/framework/api/CreateBuilder2.java
index 7e5c89a,0000000..ddc27c3
mode 100644,000000..100644
--- a/curator-framework/src/main/java/org/apache/curator/framework/api/CreateBuilder2.java
+++ b/curator-framework/src/main/java/org/apache/curator/framework/api/CreateBuilder2.java
@@@ -1,24 -1,0 +1,34 @@@
 +/**
 + * 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.curator.framework.api;
 +
 +public interface CreateBuilder2 extends CreateBuilderMain
 +{
++    /**
++     * Specify a TTL when mode is {@link org.apache.zookeeper.CreateMode#PERSISTENT_WITH_TTL} or
++     * {@link org.apache.zookeeper.CreateMode#PERSISTENT_SEQUENTIAL_WITH_TTL}. If
++     * the znode has not been modified within the given TTL, it will be deleted once it has no
++     * children. The TTL unit is milliseconds and must be greater than 0 and less than or equal to
++     * EphemeralType.MAX_TTL.
++     *
++     * @param ttl the ttl
++     * @return this for chaining
++     */
 +    CreateBuilderMain withTtl(long ttl);
 +}

http://git-wip-us.apache.org/repos/asf/curator/blob/1826b66d/curator-framework/src/main/java/org/apache/curator/framework/imps/CreateBuilderImpl.java
----------------------------------------------------------------------
diff --cc curator-framework/src/main/java/org/apache/curator/framework/imps/CreateBuilderImpl.java
index b3817bd,bbb98ea..b7d68e8
--- a/curator-framework/src/main/java/org/apache/curator/framework/imps/CreateBuilderImpl.java
+++ b/curator-framework/src/main/java/org/apache/curator/framework/imps/CreateBuilderImpl.java
@@@ -41,7 -41,7 +41,7 @@@ import java.util.concurrent.Callable
  import java.util.concurrent.Executor;
  import java.util.concurrent.atomic.AtomicBoolean;
  
- class CreateBuilderImpl implements CreateBuilder, CreateBuilder2, BackgroundOperation<PathAndBytes>, ErrorListenerPathAndBytesable<String>
 -public class CreateBuilderImpl implements CreateBuilder, BackgroundOperation<PathAndBytes>, ErrorListenerPathAndBytesable<String>
++public class CreateBuilderImpl implements CreateBuilder, CreateBuilder2, BackgroundOperation<PathAndBytes>, ErrorListenerPathAndBytesable<String>
  {
      private final CuratorFrameworkImpl client;
      private CreateMode createMode;
@@@ -75,11 -74,25 +75,27 @@@
          setDataIfExists = false;
          protectedId = null;
          storingStat = null;
 +        ttl = -1;
      }
  
 -    public CreateBuilderImpl(CuratorFrameworkImpl client, CreateMode createMode, Backgrounding backgrounding, boolean createParentsIfNeeded, boolean createParentsAsContainers, boolean doProtected, boolean compress, boolean setDataIfExists, List<ACL> aclList, Stat storingStat)
++    public CreateBuilderImpl(CuratorFrameworkImpl client, CreateMode createMode, Backgrounding backgrounding, boolean createParentsIfNeeded, boolean createParentsAsContainers, boolean doProtected, boolean compress, boolean setDataIfExists, List<ACL> aclList, Stat storingStat, long ttl)
+     {
+         this.client = client;
+         this.createMode = createMode;
+         this.backgrounding = backgrounding;
+         this.createParentsIfNeeded = createParentsIfNeeded;
+         this.createParentsAsContainers = createParentsAsContainers;
+         this.doProtected = doProtected;
+         this.compress = compress;
+         this.setDataIfExists = setDataIfExists;
+         protectedId = null;
+         this.acling = new ACLing(client.getAclProvider(), aclList);
+         this.storingStat = storingStat;
++        this.ttl = ttl;
+     }
+ 
      @Override
 -    public CreateBuilderMain orSetData()
 +    public CreateBuilder2 orSetData()
      {
          setDataIfExists = true;
          return this;

http://git-wip-us.apache.org/repos/asf/curator/blob/1826b66d/curator-recipes/src/main/java/org/apache/curator/framework/recipes/nodes/PersistentNode.java
----------------------------------------------------------------------
diff --cc curator-recipes/src/main/java/org/apache/curator/framework/recipes/nodes/PersistentNode.java
index e956266,b88a548..a45d0a8
--- a/curator-recipes/src/main/java/org/apache/curator/framework/recipes/nodes/PersistentNode.java
+++ b/curator-recipes/src/main/java/org/apache/curator/framework/recipes/nodes/PersistentNode.java
@@@ -66,7 -65,6 +66,7 @@@ public class PersistentNode implements 
      private final AtomicReference<String> nodePath = new AtomicReference<String>(null);
      private final String basePath;
      private final CreateMode mode;
++    private final long ttl;
      private final AtomicReference<byte[]> data = new AtomicReference<byte[]>();
      private final AtomicReference<State> state = new AtomicReference<State>(State.LATENT);
      private final AtomicBoolean authFailure = new AtomicBoolean(false);
@@@ -182,6 -173,6 +188,7 @@@
          this.client = Preconditions.checkNotNull(givenClient, "client cannot be null").newWatcherRemoveCuratorFramework();
          this.basePath = PathUtils.validatePath(basePath);
          this.mode = Preconditions.checkNotNull(mode, "mode cannot be null");
++        this.ttl = ttl;
          final byte[] data = Preconditions.checkNotNull(initData, "data cannot be null");
  
          backgroundCallback = new BackgroundCallback()
@@@ -426,7 -415,17 +431,18 @@@
          {
              String existingPath = nodePath.get();
              String createPath = (existingPath != null && !useProtection) ? existingPath : basePath;
-             createMethod.withMode(getCreateMode(existingPath != null)).inBackground(backgroundCallback).forPath(createPath, data.get());
+ 
+             CreateModable<ACLBackgroundPathAndBytesable<String>> localCreateMethod = createMethod.get();
+             if ( localCreateMethod == null )
+             {
 -                CreateModable<ACLBackgroundPathAndBytesable<String>> tempCreateMethod = useProtection ? client.create().creatingParentContainersIfNeeded().withProtection() : client.create().creatingParentContainersIfNeeded();
++                CreateBuilderMain createBuilder = mode.isTTL() ? client.create().withTtl(ttl) : client.create();
++                CreateModable<ACLBackgroundPathAndBytesable<String>> tempCreateMethod = useProtection ? createBuilder.creatingParentContainersIfNeeded().withProtection() : createBuilder.creatingParentContainersIfNeeded();
+                 if ( createMethod.compareAndSet(null, tempCreateMethod) )
+                 {
+                     localCreateMethod = tempCreateMethod;
+                 }
+             }
+             localCreateMethod.withMode(getCreateMode(existingPath != null)).inBackground(backgroundCallback).forPath(createPath, data.get());
          }
          catch ( Exception e )
          {

http://git-wip-us.apache.org/repos/asf/curator/blob/1826b66d/curator-x-async/src/main/java/org/apache/curator/x/async/api/AsyncCreateBuilder.java
----------------------------------------------------------------------
diff --cc curator-x-async/src/main/java/org/apache/curator/x/async/api/AsyncCreateBuilder.java
index 0000000,6f077bb..e5f2d8c
mode 000000,100644..100644
--- a/curator-x-async/src/main/java/org/apache/curator/x/async/api/AsyncCreateBuilder.java
+++ b/curator-x-async/src/main/java/org/apache/curator/x/async/api/AsyncCreateBuilder.java
@@@ -1,0 -1,115 +1,144 @@@
+ /**
+  * 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.curator.x.async.api;
+ 
+ import org.apache.curator.x.async.AsyncStage;
+ import org.apache.zookeeper.CreateMode;
+ import org.apache.zookeeper.data.ACL;
+ import org.apache.zookeeper.data.Stat;
+ import java.util.List;
+ import java.util.Set;
+ 
+ /**
+  * Builder for ZNode creates
+  */
+ public interface AsyncCreateBuilder extends AsyncPathAndBytesable<AsyncStage<String>>
+ {
+     /**
+      * Have the operation fill the provided stat object
+      *
+      * @param stat the stat to have filled in
+      * @return this
+      */
+     AsyncPathAndBytesable<AsyncStage<String>> storingStatIn(Stat stat);
+ 
+     /**
+      * Use the given create mode. The default is {@link org.apache.zookeeper.CreateMode#PERSISTENT}
+      *
+      * @param createMode mode to use
+      * @return this
+      */
+     AsyncPathAndBytesable<AsyncStage<String>> withMode(CreateMode createMode);
+ 
+     /**
+      * Set an ACL list (default is {@link org.apache.zookeeper.ZooDefs.Ids#OPEN_ACL_UNSAFE})
+      *
+      * @param aclList the ACL list to use
+      * @return this
+      */
+     AsyncPathAndBytesable<AsyncStage<String>> withACL(List<ACL> aclList);
+ 
+     /**
++     * Specify a TTL when mode is {@link org.apache.zookeeper.CreateMode#PERSISTENT_WITH_TTL} or
++     * {@link org.apache.zookeeper.CreateMode#PERSISTENT_SEQUENTIAL_WITH_TTL}. If
++     * the znode has not been modified within the given TTL, it will be deleted once it has no
++     * children. The TTL unit is milliseconds and must be greater than 0 and less than or equal to
++     * EphemeralType.MAX_TTL.
++     *
++     * @param ttl the ttl
++     * @return this for chaining
++     */
++    AsyncPathAndBytesable<AsyncStage<String>> withTtl(long ttl);
++
++    /**
+      * Options to change how the ZNode is created
+      *
+      * @param options options
+      * @return this
+      */
+     AsyncPathAndBytesable<AsyncStage<String>> withOptions(Set<CreateOption> options);
+ 
+     /**
+      * set options and ACLs
+      *
+      * @param options options
+      * @param aclList the ACL list to use
+      * @see #withOptions(java.util.Set)
+      * @see #withACL(java.util.List)
+      * @return this
+      */
+     AsyncPathAndBytesable<AsyncStage<String>> withOptions(Set<CreateOption> options, List<ACL> aclList);
+ 
+     /**
+      * set options, mode and ACLs
+      *
+      * @param options options
+      * @param createMode mode to use
+      * @param aclList the ACL list to use
+      * @see #withACL(java.util.List)
+      * @see #withOptions(java.util.Set)
+      * @see #withMode(org.apache.zookeeper.CreateMode)
+      * @see #withACL(java.util.List)
+      * @return this
+      */
+     AsyncPathAndBytesable<AsyncStage<String>> withOptions(Set<CreateOption> options, CreateMode createMode, List<ACL> aclList);
+ 
+     /**
+      * set options and mode
+      *
+      * @param options options
+      * @param createMode mode to use
+      * @see #withOptions(java.util.Set)
+      * @see #withMode(org.apache.zookeeper.CreateMode)
+      * @return this
+      */
+     AsyncPathAndBytesable<AsyncStage<String>> withOptions(Set<CreateOption> options, CreateMode createMode);
+ 
+     /**
+      * set options, mode, ACLs, and stat
+      *
+      * @param options options
+      * @param createMode mode to use
+      * @param aclList the ACL list to use
+      * @param stat the stat to have filled in
+      * @see #withOptions(java.util.Set)
+      * @see #withMode(org.apache.zookeeper.CreateMode)
+      * @see #withACL(java.util.List)
+      * @see #storingStatIn(org.apache.zookeeper.data.Stat)
+      * @return this
+      */
+     AsyncPathAndBytesable<AsyncStage<String>> withOptions(Set<CreateOption> options, CreateMode createMode, List<ACL> aclList, Stat stat);
++
++    /**
++     * set options, mode, ACLs, and stat
++     *
++     * @param options options
++     * @param createMode mode to use
++     * @param aclList the ACL list to use
++     * @param stat the stat to have filled in
++     * @param ttl the ttl or 0
++     * @see #withOptions(java.util.Set)
++     * @see #withMode(org.apache.zookeeper.CreateMode)
++     * @see #withACL(java.util.List)
++     * @see #storingStatIn(org.apache.zookeeper.data.Stat)
++     * @see #withTtl(long)
++     * @return this
++     */
++    AsyncPathAndBytesable<AsyncStage<String>> withOptions(Set<CreateOption> options, CreateMode createMode, List<ACL> aclList, Stat stat, long ttl);
+ }

http://git-wip-us.apache.org/repos/asf/curator/blob/1826b66d/curator-x-async/src/main/java/org/apache/curator/x/async/details/AsyncCreateBuilderImpl.java
----------------------------------------------------------------------
diff --cc curator-x-async/src/main/java/org/apache/curator/x/async/details/AsyncCreateBuilderImpl.java
index 0000000,b2b9000..e8b1d30
mode 000000,100644..100644
--- a/curator-x-async/src/main/java/org/apache/curator/x/async/details/AsyncCreateBuilderImpl.java
+++ b/curator-x-async/src/main/java/org/apache/curator/x/async/details/AsyncCreateBuilderImpl.java
@@@ -1,0 -1,144 +1,164 @@@
+ /**
+  * 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.curator.x.async.details;
+ 
+ import org.apache.curator.framework.imps.CreateBuilderImpl;
+ import org.apache.curator.framework.imps.CuratorFrameworkImpl;
+ import org.apache.curator.x.async.AsyncStage;
+ import org.apache.curator.x.async.api.AsyncCreateBuilder;
+ import org.apache.curator.x.async.api.AsyncPathAndBytesable;
+ import org.apache.curator.x.async.api.CreateOption;
+ import org.apache.zookeeper.CreateMode;
+ import org.apache.zookeeper.data.ACL;
+ import org.apache.zookeeper.data.Stat;
+ import java.util.Collections;
+ import java.util.List;
+ import java.util.Objects;
+ import java.util.Set;
+ 
+ import static org.apache.curator.x.async.details.BackgroundProcs.nameProc;
+ import static org.apache.curator.x.async.details.BackgroundProcs.safeCall;
+ 
+ class AsyncCreateBuilderImpl implements AsyncCreateBuilder
+ {
+     private final CuratorFrameworkImpl client;
+     private final Filters filters;
+     private CreateMode createMode = CreateMode.PERSISTENT;
+     private List<ACL> aclList = null;
+     private Set<CreateOption> options = Collections.emptySet();
+     private Stat stat = null;
++    private long ttl = -1;
+ 
+     AsyncCreateBuilderImpl(CuratorFrameworkImpl client, Filters filters)
+     {
+         this.client = client;
+         this.filters = filters;
+     }
+ 
+     @Override
+     public AsyncPathAndBytesable<AsyncStage<String>> storingStatIn(Stat stat)
+     {
+         this.stat = stat;
+         return this;
+     }
+ 
+     @Override
+     public AsyncPathAndBytesable<AsyncStage<String>> withMode(CreateMode createMode)
+     {
+         this.createMode = Objects.requireNonNull(createMode, "createMode cannot be null");
+         return this;
+     }
+ 
+     @Override
+     public AsyncPathAndBytesable<AsyncStage<String>> withACL(List<ACL> aclList)
+     {
+         this.aclList = aclList;
+         return this;
+     }
+ 
+     @Override
++    public AsyncPathAndBytesable<AsyncStage<String>> withTtl(long ttl)
++    {
++        this.ttl = ttl;
++        return this;
++    }
++
++    @Override
+     public AsyncPathAndBytesable<AsyncStage<String>> withOptions(Set<CreateOption> options)
+     {
+         this.options = Objects.requireNonNull(options, "options cannot be null");
+         return this;
+     }
+ 
+     @Override
+     public AsyncPathAndBytesable<AsyncStage<String>> withOptions(Set<CreateOption> options, List<ACL> aclList)
+     {
+         this.options = Objects.requireNonNull(options, "options cannot be null");
+         this.aclList = aclList;
+         return this;
+     }
+ 
+     @Override
+     public AsyncPathAndBytesable<AsyncStage<String>> withOptions(Set<CreateOption> options, CreateMode createMode, List<ACL> aclList)
+     {
+         this.options = Objects.requireNonNull(options, "options cannot be null");
+         this.aclList = aclList;
+         this.createMode = Objects.requireNonNull(createMode, "createMode cannot be null");
+         return this;
+     }
+ 
+     @Override
+     public AsyncPathAndBytesable<AsyncStage<String>> withOptions(Set<CreateOption> options, CreateMode createMode)
+     {
+         this.options = Objects.requireNonNull(options, "options cannot be null");
+         this.createMode = Objects.requireNonNull(createMode, "createMode cannot be null");
+         return this;
+     }
+ 
+     @Override
+     public AsyncPathAndBytesable<AsyncStage<String>> withOptions(Set<CreateOption> options, CreateMode createMode, List<ACL> aclList, Stat stat)
+     {
+         this.options = Objects.requireNonNull(options, "options cannot be null");
+         this.aclList = aclList;
+         this.createMode = Objects.requireNonNull(createMode, "createMode cannot be null");
+         this.stat = stat;
+         return this;
+     }
+ 
+     @Override
++    public AsyncPathAndBytesable<AsyncStage<String>> withOptions(Set<CreateOption> options, CreateMode createMode, List<ACL> aclList, Stat stat, long ttl)
++    {
++        this.options = Objects.requireNonNull(options, "options cannot be null");
++        this.aclList = aclList;
++        this.createMode = Objects.requireNonNull(createMode, "createMode cannot be null");
++        this.stat = stat;
++        this.ttl = ttl;
++        return this;
++    }
++
++    @Override
+     public AsyncStage<String> forPath(String path)
+     {
+         return internalForPath(path, null, false);
+     }
+ 
+     @Override
+     public AsyncStage<String> forPath(String path, byte[] data)
+     {
+         return internalForPath(path, data, true);
+     }
+ 
+     private AsyncStage<String> internalForPath(String path, byte[] data, boolean useData)
+     {
+         BuilderCommon<String> common = new BuilderCommon<>(filters, nameProc);
+         CreateBuilderImpl builder = new CreateBuilderImpl(client,
+             createMode,
+             common.backgrounding,
+             options.contains(CreateOption.createParentsIfNeeded) || options.contains(CreateOption.createParentsAsContainers),
+             options.contains(CreateOption.createParentsAsContainers),
+             options.contains(CreateOption.doProtected),
+             options.contains(CreateOption.compress),
+             options.contains(CreateOption.setDataIfExists),
+             aclList,
 -            stat
++            stat,
++            ttl
+         );
+         return safeCall(common.internalCallback, () -> useData ? builder.forPath(path, data) : builder.forPath(path));
+     }
+ }

http://git-wip-us.apache.org/repos/asf/curator/blob/1826b66d/pom.xml
----------------------------------------------------------------------
diff --cc pom.xml
index 4027ae7,34e724c..764ef2c
--- a/pom.xml
+++ b/pom.xml
@@@ -59,9 -59,9 +59,9 @@@
          <jdk-version>1.7</jdk-version>
  
          <!-- versions -->
 -        <zookeeper-version>3.5.1-alpha</zookeeper-version>
 +        <zookeeper-version>3.5.3-beta</zookeeper-version>
          <maven-project-info-reports-plugin-version>2.7</maven-project-info-reports-plugin-version>
-         <maven-bundle-plugin-version>2.3.7</maven-bundle-plugin-version>
+         <maven-bundle-plugin-version>3.2.0</maven-bundle-plugin-version>
          <maven-javadoc-plugin-version>2.10.3</maven-javadoc-plugin-version>
          <doxia-module-confluence-version>1.6</doxia-module-confluence-version>
          <maven-license-plugin-version>1.9.0</maven-license-plugin-version>


[42/50] curator git commit: [CURATOR-400] upgrade clirr to fix the check error on java 8

Posted by dr...@apache.org.
[CURATOR-400] upgrade clirr to fix the check error on java 8


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

Branch: refs/heads/master
Commit: fcec4b650d186932d3e7164f09c15b4a6e1e06a4
Parents: b3939ac
Author: Fangmin Lyu <fa...@apache.org>
Authored: Fri Mar 31 23:21:05 2017 -0700
Committer: Fangmin Lyu <fa...@apache.org>
Committed: Wed Apr 12 23:08:07 2017 -0700

----------------------------------------------------------------------
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/curator/blob/fcec4b65/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 34e724c..1f66800 100644
--- a/pom.xml
+++ b/pom.xml
@@ -79,7 +79,7 @@
         <dropwizard-version>0.7.0</dropwizard-version>
         <maven-shade-plugin-version>2.4.3</maven-shade-plugin-version>
         <slf4j-version>1.7.6</slf4j-version>
-        <clirr-maven-plugin-version>2.6.1</clirr-maven-plugin-version>
+        <clirr-maven-plugin-version>2.8</clirr-maven-plugin-version>
 
         <!-- OSGi Properties -->
         <osgi.export.package />


[45/50] curator git commit: Merge branch 'master' into CURATOR-3.0

Posted by dr...@apache.org.
Merge branch 'master' into CURATOR-3.0


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

Branch: refs/heads/master
Commit: 00ffe77951a88ea12c60a506a9beff1ae78de300
Parents: 1939389 302661a
Author: randgalt <ra...@apache.org>
Authored: Mon Apr 17 19:00:10 2017 -0500
Committer: randgalt <ra...@apache.org>
Committed: Mon Apr 17 19:00:10 2017 -0500

----------------------------------------------------------------------
 .../apache/curator/framework/recipes/nodes/PersistentNode.java | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/curator/blob/00ffe779/curator-recipes/src/main/java/org/apache/curator/framework/recipes/nodes/PersistentNode.java
----------------------------------------------------------------------


[11/50] curator git commit: refactoring

Posted by dr...@apache.org.
refactoring


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

Branch: refs/heads/master
Commit: dca47a880f6c68b134cc49c5cfa775ffd3323c0e
Parents: 6c1db4e
Author: randgalt <ra...@apache.org>
Authored: Sun Jan 8 12:33:58 2017 -0500
Committer: randgalt <ra...@apache.org>
Committed: Sun Jan 8 12:33:58 2017 -0500

----------------------------------------------------------------------
 .../curator/x/async/AsyncCuratorFramework.java  | 22 +++++++++++
 .../x/async/api/AsyncCuratorFrameworkDsl.java   |  7 ----
 .../details/AsyncCuratorFrameworkImpl.java      | 39 +++++++++++++-------
 .../src/site/confluence/index.confluence        |  2 +-
 4 files changed, 49 insertions(+), 21 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/curator/blob/dca47a88/curator-x-async/src/main/java/org/apache/curator/x/async/AsyncCuratorFramework.java
----------------------------------------------------------------------
diff --git a/curator-x-async/src/main/java/org/apache/curator/x/async/AsyncCuratorFramework.java b/curator-x-async/src/main/java/org/apache/curator/x/async/AsyncCuratorFramework.java
index 9fc4134..b8de84a 100644
--- a/curator-x-async/src/main/java/org/apache/curator/x/async/AsyncCuratorFramework.java
+++ b/curator-x-async/src/main/java/org/apache/curator/x/async/AsyncCuratorFramework.java
@@ -55,6 +55,14 @@ public interface AsyncCuratorFramework extends AsyncCuratorFrameworkDsl
     CuratorFramework unwrap();
 
     /**
+     * Returns a facade that changes how watchers are set when {@link #watched()} is called
+     *
+     * @param mode watch mode to use for subsequent calls to {@link #watched()}
+     * @return facade
+     */
+    AsyncCuratorFrameworkDsl with(WatchMode mode);
+
+    /**
      * Returns a facade that adds the given UnhandledErrorListener to all background operations
      *
      * @param listener lister to use
@@ -85,4 +93,18 @@ public interface AsyncCuratorFramework extends AsyncCuratorFrameworkDsl
      * @return facade
      */
     AsyncCuratorFrameworkDsl with(UnhandledErrorListener listener, UnaryOperator<CuratorEvent> resultFilter, UnaryOperator<WatchedEvent> watcherFilter);
+
+    /**
+     * Set any combination of listener, filters or watch mode
+     *
+     * @param mode watch mode to use for subsequent calls to {@link #watched()} (cannot be <code>null</code>)
+     * @param listener lister to use or <code>null</code>
+     * @param resultFilter filter to use or <code>null</code>
+     * @param watcherFilter filter to use or <code>null</code>
+     * @see #with(WatchMode)
+     * @see #with(java.util.function.UnaryOperator, java.util.function.UnaryOperator)
+     * @see #with(org.apache.curator.framework.api.UnhandledErrorListener)
+     * @return facade
+     */
+    AsyncCuratorFrameworkDsl with(WatchMode mode, UnhandledErrorListener listener, UnaryOperator<CuratorEvent> resultFilter, UnaryOperator<WatchedEvent> watcherFilter);
 }

http://git-wip-us.apache.org/repos/asf/curator/blob/dca47a88/curator-x-async/src/main/java/org/apache/curator/x/async/api/AsyncCuratorFrameworkDsl.java
----------------------------------------------------------------------
diff --git a/curator-x-async/src/main/java/org/apache/curator/x/async/api/AsyncCuratorFrameworkDsl.java b/curator-x-async/src/main/java/org/apache/curator/x/async/api/AsyncCuratorFrameworkDsl.java
index a8151cd..0807160 100644
--- a/curator-x-async/src/main/java/org/apache/curator/x/async/api/AsyncCuratorFrameworkDsl.java
+++ b/curator-x-async/src/main/java/org/apache/curator/x/async/api/AsyncCuratorFrameworkDsl.java
@@ -43,13 +43,6 @@ public interface AsyncCuratorFrameworkDsl extends WatchableAsyncCuratorFramework
     WatchableAsyncCuratorFramework watched();
 
     /**
-     * Same as {@link #watched()} but allows specifying the watch mode
-     *
-     * @return watcher facade
-     */
-    WatchableAsyncCuratorFramework watched(WatchMode mode);
-
-    /**
      * Start a create builder
      *
      * @return builder object

http://git-wip-us.apache.org/repos/asf/curator/blob/dca47a88/curator-x-async/src/main/java/org/apache/curator/x/async/details/AsyncCuratorFrameworkImpl.java
----------------------------------------------------------------------
diff --git a/curator-x-async/src/main/java/org/apache/curator/x/async/details/AsyncCuratorFrameworkImpl.java b/curator-x-async/src/main/java/org/apache/curator/x/async/details/AsyncCuratorFrameworkImpl.java
index aa82644..167cf50 100644
--- a/curator-x-async/src/main/java/org/apache/curator/x/async/details/AsyncCuratorFrameworkImpl.java
+++ b/curator-x-async/src/main/java/org/apache/curator/x/async/details/AsyncCuratorFrameworkImpl.java
@@ -42,10 +42,11 @@ public class AsyncCuratorFrameworkImpl implements AsyncCuratorFramework
     private final CuratorFrameworkImpl client;
     private final Filters filters;
     private final WatchMode watchMode;
+    private final boolean watched;
 
     public AsyncCuratorFrameworkImpl(CuratorFramework client)
     {
-        this(reveal(client), new Filters(null, null, null), null);
+        this(reveal(client), new Filters(null, null, null), WatchMode.stateChangeAndSuccess, false);
     }
 
     private static CuratorFrameworkImpl reveal(CuratorFramework client)
@@ -60,11 +61,12 @@ public class AsyncCuratorFrameworkImpl implements AsyncCuratorFramework
         }
     }
 
-    public AsyncCuratorFrameworkImpl(CuratorFrameworkImpl client, Filters filters, WatchMode watchMode)
+    public AsyncCuratorFrameworkImpl(CuratorFrameworkImpl client, Filters filters, WatchMode watchMode, boolean watched)
     {
         this.client = Objects.requireNonNull(client, "client cannot be null");
         this.filters = Objects.requireNonNull(filters, "filters cannot be null");
-        this.watchMode = watchMode;
+        this.watchMode = Objects.requireNonNull(watchMode, "watchMode cannot be null");
+        this.watched = watched;
     }
 
     @Override
@@ -156,31 +158,37 @@ public class AsyncCuratorFrameworkImpl implements AsyncCuratorFramework
     @Override
     public WatchableAsyncCuratorFramework watched()
     {
-        return new AsyncCuratorFrameworkImpl(client, filters, WatchMode.stateChangeAndSuccess);
+        return new AsyncCuratorFrameworkImpl(client, filters, watchMode, true);
     }
 
     @Override
-    public WatchableAsyncCuratorFramework watched(WatchMode mode)
+    public AsyncCuratorFrameworkDsl with(WatchMode mode)
     {
-        return new AsyncCuratorFrameworkImpl(client, filters, mode);
+        return new AsyncCuratorFrameworkImpl(client, filters, mode, watched);
+    }
+
+    @Override
+    public AsyncCuratorFrameworkDsl with(WatchMode mode, UnhandledErrorListener listener, UnaryOperator<CuratorEvent> resultFilter, UnaryOperator<WatchedEvent> watcherFilter)
+    {
+        return new AsyncCuratorFrameworkImpl(client, new Filters(listener, filters.getResultFilter(), filters.getWatcherFilter()), mode, watched);
     }
 
     @Override
     public AsyncCuratorFrameworkDsl with(UnhandledErrorListener listener)
     {
-        return new AsyncCuratorFrameworkImpl(client, new Filters(listener, filters.getResultFilter(), filters.getWatcherFilter()), watchMode);
+        return new AsyncCuratorFrameworkImpl(client, new Filters(listener, filters.getResultFilter(), filters.getWatcherFilter()), watchMode, watched);
     }
 
     @Override
     public AsyncCuratorFrameworkDsl with(UnaryOperator<CuratorEvent> resultFilter, UnaryOperator<WatchedEvent> watcherFilter)
     {
-        return new AsyncCuratorFrameworkImpl(client, new Filters(filters.getListener(), resultFilter, watcherFilter), watchMode);
+        return new AsyncCuratorFrameworkImpl(client, new Filters(filters.getListener(), resultFilter, watcherFilter), watchMode, watched);
     }
 
     @Override
     public AsyncCuratorFrameworkDsl with(UnhandledErrorListener listener, UnaryOperator<CuratorEvent> resultFilter, UnaryOperator<WatchedEvent> watcherFilter)
     {
-        return new AsyncCuratorFrameworkImpl(client, new Filters(listener, resultFilter, watcherFilter), watchMode);
+        return new AsyncCuratorFrameworkImpl(client, new Filters(listener, resultFilter, watcherFilter), watchMode, watched);
     }
 
     @Override
@@ -192,24 +200,29 @@ public class AsyncCuratorFrameworkImpl implements AsyncCuratorFramework
     @Override
     public AsyncExistsBuilder checkExists()
     {
-        return new AsyncExistsBuilderImpl(client, filters, watchMode);
+        return new AsyncExistsBuilderImpl(client, filters, getBuilderWatchMode());
     }
 
     @Override
     public AsyncGetDataBuilder getData()
     {
-        return new AsyncGetDataBuilderImpl(client, filters, watchMode);
+        return new AsyncGetDataBuilderImpl(client, filters, getBuilderWatchMode());
     }
 
     @Override
     public AsyncGetChildrenBuilder getChildren()
     {
-        return new AsyncGetChildrenBuilderImpl(client, filters, watchMode);
+        return new AsyncGetChildrenBuilderImpl(client, filters, getBuilderWatchMode());
     }
 
     @Override
     public AsyncGetConfigBuilder getConfig()
     {
-        return new AsyncGetConfigBuilderImpl(client, filters, watchMode);
+        return new AsyncGetConfigBuilderImpl(client, filters, getBuilderWatchMode());
+    }
+
+    private WatchMode getBuilderWatchMode()
+    {
+        return watched ? watchMode : null;
     }
 }

http://git-wip-us.apache.org/repos/asf/curator/blob/dca47a88/curator-x-async/src/site/confluence/index.confluence
----------------------------------------------------------------------
diff --git a/curator-x-async/src/site/confluence/index.confluence b/curator-x-async/src/site/confluence/index.confluence
index c896df7..6ccc048 100644
--- a/curator-x-async/src/site/confluence/index.confluence
+++ b/curator-x-async/src/site/confluence/index.confluence
@@ -72,7 +72,7 @@ problems, you can tell Curator Async to not send them by calling:
 {code}
 // only complete the CompletionStage when the watcher is successfully triggered
 // i.e. don't complete on connection issues
-async.watched(WatchMode.successOnly)...
+async.with(WatchMode.successOnly).watched()...
 {code}
 
 h4. AsyncEventException


[40/50] curator git commit: use local var data

Posted by dr...@apache.org.
use local var data


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

Branch: refs/heads/master
Commit: f89c1ea5336bbde932638a2a28d678b231a2e49b
Parents: 1826b66
Author: randgalt <ra...@apache.org>
Authored: Mon Apr 3 11:31:49 2017 -0500
Committer: randgalt <ra...@apache.org>
Committed: Mon Apr 3 11:31:49 2017 -0500

----------------------------------------------------------------------
 .../java/org/apache/curator/framework/imps/CreateBuilderImpl.java  | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/curator/blob/f89c1ea5/curator-framework/src/main/java/org/apache/curator/framework/imps/CreateBuilderImpl.java
----------------------------------------------------------------------
diff --git a/curator-framework/src/main/java/org/apache/curator/framework/imps/CreateBuilderImpl.java b/curator-framework/src/main/java/org/apache/curator/framework/imps/CreateBuilderImpl.java
index b7d68e8..718dded 100644
--- a/curator-framework/src/main/java/org/apache/curator/framework/imps/CreateBuilderImpl.java
+++ b/curator-framework/src/main/java/org/apache/curator/framework/imps/CreateBuilderImpl.java
@@ -567,7 +567,7 @@ public class CreateBuilderImpl implements CreateBuilder, CreateBuilder2, Backgro
             client.getZooKeeper().create
             (
                 operationAndData.getData().getPath(),
-                operationAndData.getData().getData(),
+                data,
                 acling.getAclList(operationAndData.getData().getPath()),
                 createMode,
                 new AsyncCallback.Create2Callback() {


[17/50] curator git commit: use latest TestNg which fixes retry listener issues

Posted by dr...@apache.org.
use latest TestNg which fixes retry listener issues


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

Branch: refs/heads/master
Commit: f645190739cb8c26a19fba1d469faef8966db418
Parents: acd9097
Author: randgalt <ra...@apache.org>
Authored: Wed Jan 11 19:10:15 2017 -0500
Committer: randgalt <ra...@apache.org>
Committed: Wed Jan 11 19:10:15 2017 -0500

----------------------------------------------------------------------
 .../curator/framework/recipes/leader/TestLeaderSelector.java   | 2 +-
 .../recipes/leader/TestLeaderSelectorParticipants.java         | 2 +-
 .../main/java/org/apache/curator/test/BaseClassForTests.java   | 6 +-----
 pom.xml                                                        | 2 +-
 4 files changed, 4 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/curator/blob/f6451907/curator-recipes/src/test/java/org/apache/curator/framework/recipes/leader/TestLeaderSelector.java
----------------------------------------------------------------------
diff --git a/curator-recipes/src/test/java/org/apache/curator/framework/recipes/leader/TestLeaderSelector.java b/curator-recipes/src/test/java/org/apache/curator/framework/recipes/leader/TestLeaderSelector.java
index e9a7002..c1622ba 100644
--- a/curator-recipes/src/test/java/org/apache/curator/framework/recipes/leader/TestLeaderSelector.java
+++ b/curator-recipes/src/test/java/org/apache/curator/framework/recipes/leader/TestLeaderSelector.java
@@ -21,6 +21,7 @@ package org.apache.curator.framework.recipes.leader;
 
 import com.google.common.collect.Lists;
 import com.google.common.collect.Queues;
+import com.google.common.collect.Sets;
 import org.apache.curator.framework.CuratorFramework;
 import org.apache.curator.framework.CuratorFrameworkFactory;
 import org.apache.curator.framework.state.ConnectionState;
@@ -35,7 +36,6 @@ import org.apache.curator.test.Timing;
 import org.apache.curator.utils.CloseableUtils;
 import org.testng.Assert;
 import org.testng.annotations.Test;
-import org.testng.internal.annotations.Sets;
 import java.util.Arrays;
 import java.util.List;
 import java.util.Set;

http://git-wip-us.apache.org/repos/asf/curator/blob/f6451907/curator-recipes/src/test/java/org/apache/curator/framework/recipes/leader/TestLeaderSelectorParticipants.java
----------------------------------------------------------------------
diff --git a/curator-recipes/src/test/java/org/apache/curator/framework/recipes/leader/TestLeaderSelectorParticipants.java b/curator-recipes/src/test/java/org/apache/curator/framework/recipes/leader/TestLeaderSelectorParticipants.java
index d7329ab..e026f87 100644
--- a/curator-recipes/src/test/java/org/apache/curator/framework/recipes/leader/TestLeaderSelectorParticipants.java
+++ b/curator-recipes/src/test/java/org/apache/curator/framework/recipes/leader/TestLeaderSelectorParticipants.java
@@ -19,6 +19,7 @@
 package org.apache.curator.framework.recipes.leader;
 
 import com.google.common.collect.Lists;
+import com.google.common.collect.Sets;
 import org.apache.curator.test.BaseClassForTests;
 import org.apache.curator.utils.CloseableUtils;
 import org.apache.curator.framework.CuratorFramework;
@@ -27,7 +28,6 @@ import org.apache.curator.framework.state.ConnectionState;
 import org.apache.curator.retry.RetryOneTime;
 import org.testng.Assert;
 import org.testng.annotations.Test;
-import org.testng.internal.annotations.Sets;
 import java.util.Collection;
 import java.util.List;
 import java.util.Set;

http://git-wip-us.apache.org/repos/asf/curator/blob/f6451907/curator-test/src/main/java/org/apache/curator/test/BaseClassForTests.java
----------------------------------------------------------------------
diff --git a/curator-test/src/main/java/org/apache/curator/test/BaseClassForTests.java b/curator-test/src/main/java/org/apache/curator/test/BaseClassForTests.java
index fe4acd2..5114552 100644
--- a/curator-test/src/main/java/org/apache/curator/test/BaseClassForTests.java
+++ b/curator-test/src/main/java/org/apache/curator/test/BaseClassForTests.java
@@ -203,7 +203,6 @@ public class BaseClassForTests
         {
             if ( method.getTestMethod().isBeforeMethodConfiguration() )
             {
-                TestListenerAdapter x = null;
                 RetryContext retryContext = (RetryContext)context.getAttribute(ATTRIBUTE_NAME);
                 if ( retryContext == null )
                 {
@@ -244,12 +243,9 @@ public class BaseClassForTests
                 else
                 {
                     System.clearProperty("curator-use-classic-connection-handling");
-                    if ( testResult.isSuccess() )
+                    if ( testResult.isSuccess() || (testResult.getStatus() == ITestResult.FAILURE) )
                     {
                         retryContext.isRetrying.set(false);
-                    }
-                    if ( testResult.isSuccess() || retryContext.isRetrying.get() )
-                    {
                         if ( retryContext.runVersion.incrementAndGet() > 1 )
                         {
                             context.setAttribute(ATTRIBUTE_NAME, null);

http://git-wip-us.apache.org/repos/asf/curator/blob/f6451907/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index f327806..42b9265 100644
--- a/pom.xml
+++ b/pom.xml
@@ -74,7 +74,7 @@
         <scannotation-version>1.0.2</scannotation-version>
         <resteasy-jaxrs-version>2.3.0.GA</resteasy-jaxrs-version>
         <guava-version>16.0.1</guava-version>
-        <testng-version>6.8.8</testng-version>
+        <testng-version>6.10</testng-version>
         <swift-version>0.12.0</swift-version>
         <dropwizard-version>0.7.0</dropwizard-version>
         <maven-shade-plugin-version>2.3</maven-shade-plugin-version>


[03/50] curator git commit: more doc work

Posted by dr...@apache.org.
more doc work


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

Branch: refs/heads/master
Commit: b813fb3502896a088c6e18a1d442bef127fe9e51
Parents: 88fee0e
Author: randgalt <ra...@apache.org>
Authored: Sat Jan 7 12:27:11 2017 -0500
Committer: randgalt <ra...@apache.org>
Committed: Sat Jan 7 12:27:11 2017 -0500

----------------------------------------------------------------------
 .../src/site/confluence/index.confluence        | 71 +++++++++++++++++++-
 1 file changed, 70 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/curator/blob/b813fb35/curator-x-async/src/site/confluence/index.confluence
----------------------------------------------------------------------
diff --git a/curator-x-async/src/site/confluence/index.confluence b/curator-x-async/src/site/confluence/index.confluence
index 88f649e..9c02e8e 100644
--- a/curator-x-async/src/site/confluence/index.confluence
+++ b/curator-x-async/src/site/confluence/index.confluence
@@ -18,7 +18,7 @@ With this new async DSL you can do asynchronous tasks in a more natural, functio
 {code}
 // let "client" be a CuratorFramework instance
 AsyncCuratorFramework async = AsyncCuratorFramework.wrap(client);
-async.checkExists().forPath(somePath).thenRun(() -> mySuccessOperation());
+async.checkExists().forPath(somePath).thenAccept(stat -> mySuccessOperation(stat));
 {code}
 
 h2. Usage
@@ -95,3 +95,72 @@ stage.event().exceptionally(e -> {
     asyncEx.reset().thenRun(() -> successMethod());
 });
 {code}
+
+h2. Examples
+
+Create a sequential ZNode and, once successfully completed, set a watcher
+on the ZNode. Note: this code does not deal with errors. Should a connection
+problem occur or another exception occur, the completion lambda will never be called.
+
+{code}
+async.create().withMode(PERSISTENT_SEQUENTIAL).forPath(path).thenAccept(actualPath ->
+    async.watched().getData().forPath(actualPath));
+{code}
+
+----
+
+This is the canonical way to deal with AsyncStage. Use the handle() method which provides
+both the success value and the exception. The exception will be non\-null on error.
+
+{code}
+async.create().withOptions(EnumSet.of(doProtected)).forPath(path).handle((actualPath, exception) -> {
+    if ( exception != null )
+    {
+        // handle problem
+    }
+    else
+    {
+        // actualPath is the path created
+    }
+    return null;
+});
+{code}
+
+----
+
+Your completion routines can operate in a separate thread if you provide an executor.
+
+{code}
+async.create().withOptions(EnumSet.of(createParentsIfNeeded)).forPath("/a/b/c")
+    .thenAcceptAsync(path -> handleCreate(path), executor);
+{code}
+
+----
+
+This example shows specifying separate completion handlers for success and exception.
+
+{code}
+AsyncStage<byte[]> stage = async.getData().forPath("/my/path");
+stage.exceptionally(e -> {
+    if ( e instanceof KeeperException.NoNodeException )
+    {
+        // handle no node
+    }
+    else
+    {
+        // handle other
+    }
+    return null;
+});
+stage.thenAccept(data -> processData(data));
+{code}
+
+----
+
+CompletionStage provides a block method as well so that you can block to get the result
+of an operation. i.e. this makes it possible to use the async APIs in a synchronous way.
+
+{code}
+// NOTE: get() specifies a checked exception
+async.create().forPath("/foo").toCompletableFuture().get();
+{code}


[02/50] curator git commit: doc

Posted by dr...@apache.org.
doc


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

Branch: refs/heads/master
Commit: 88fee0eac4a48e9391edf8997a5a20e14c1c18a7
Parents: 908b5c6
Author: randgalt <ra...@apache.org>
Authored: Sat Jan 7 11:33:28 2017 -0500
Committer: randgalt <ra...@apache.org>
Committed: Sat Jan 7 11:33:28 2017 -0500

----------------------------------------------------------------------
 curator-x-async/src/site/confluence/index.confluence | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/curator/blob/88fee0ea/curator-x-async/src/site/confluence/index.confluence
----------------------------------------------------------------------
diff --git a/curator-x-async/src/site/confluence/index.confluence b/curator-x-async/src/site/confluence/index.confluence
index 7e1449b..88f649e 100644
--- a/curator-x-async/src/site/confluence/index.confluence
+++ b/curator-x-async/src/site/confluence/index.confluence
@@ -47,7 +47,7 @@ h4. AsyncStage
 AsyncStage instances extend Java 8's CompletionStage. CompletionStage objects can be "completed" with a success
 value or an exception. The parameterized type of the AsyncStage will
 be whatever the builder used would naturally return as a success value. E.g. the async getData() builder's AsyncStage is
-parameterized with {{byte[]}}. For the exception, Curator Async always uses AsyncEventException (see below).
+parameterized with "byte\[\]".
 
 h4. Watchers
 
@@ -80,7 +80,7 @@ h4. AsyncEventException
 When an async watcher fails the exception set in the CompletionStage will be of type {{AsyncEventException}}.
 This exception allows you to see the KeeperState that caused the trigger and allows you to reset the
 completion stage. Reset is needed because ZooKeeper temporarily triggers watchers when there is a connection
-event. However, the watcher stays set for the original operation. Use {{AsyncEventException#reset()}}
+event. However, the watcher stays set for the original operation. Use {{AsyncEventException#reset}}
 to start a new completion stage that will wait on the next trigger of the watcher.
 
 E.g.
@@ -90,7 +90,7 @@ AsyncStage stage = ...
 stage.event().exceptionally(e -> {
     AsyncEventException asyncEx = (AsyncEventException)e;
 
-    ... noteAConnectionProblem ...
+    ... note a connection problem ...
 
     asyncEx.reset().thenRun(() -> successMethod());
 });


[48/50] curator git commit: added missing doc for executorService

Posted by dr...@apache.org.
added missing doc for executorService


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

Branch: refs/heads/master
Commit: 086c5b4152cdb045e7bb4818d9cef925e88ed313
Parents: b84d351
Author: randgalt <ra...@apache.org>
Authored: Tue Apr 25 09:49:47 2017 -0500
Committer: randgalt <ra...@apache.org>
Committed: Tue Apr 25 09:49:47 2017 -0500

----------------------------------------------------------------------
 .../apache/curator/framework/recipes/nodes/PersistentTtlNode.java   | 1 +
 1 file changed, 1 insertion(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/curator/blob/086c5b41/curator-recipes/src/main/java/org/apache/curator/framework/recipes/nodes/PersistentTtlNode.java
----------------------------------------------------------------------
diff --git a/curator-recipes/src/main/java/org/apache/curator/framework/recipes/nodes/PersistentTtlNode.java b/curator-recipes/src/main/java/org/apache/curator/framework/recipes/nodes/PersistentTtlNode.java
index e1e8bf4..91f5f71 100644
--- a/curator-recipes/src/main/java/org/apache/curator/framework/recipes/nodes/PersistentTtlNode.java
+++ b/curator-recipes/src/main/java/org/apache/curator/framework/recipes/nodes/PersistentTtlNode.java
@@ -81,6 +81,7 @@ public class PersistentTtlNode implements Closeable
 
     /**
      * @param client the client
+     * @param executorService  ExecutorService to use for background thread. This service should be single threaded, otherwise you may see inconsistent results.
      * @param path path for the parent ZNode
      * @param ttlMs max ttl for the node in milliseconds
      * @param initData data for the node


[37/50] curator git commit: Merge branch 'master' into CURATOR-3.0

Posted by dr...@apache.org.
Merge branch 'master' into CURATOR-3.0


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

Branch: refs/heads/master
Commit: b3939acd47b6198930812236678ceae6f6f6a7af
Parents: 6d41d4a 7d089ef
Author: Fangmin Lyu <fa...@apache.org>
Authored: Fri Mar 31 22:33:25 2017 -0700
Committer: Fangmin Lyu <fa...@apache.org>
Committed: Fri Mar 31 22:33:25 2017 -0700

----------------------------------------------------------------------
 pom.xml | 11 +++++++++++
 1 file changed, 11 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/curator/blob/b3939acd/pom.xml
----------------------------------------------------------------------


[25/50] curator git commit: Merge branch 'master' into CURATOR-3.0

Posted by dr...@apache.org.
Merge branch 'master' into CURATOR-3.0


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

Branch: refs/heads/master
Commit: 8363692841ea46caebd25f7fe8e61b5bc8295bab
Parents: 8e7fbac 467513b
Author: randgalt <ra...@apache.org>
Authored: Mon Jan 23 21:07:23 2017 -0500
Committer: randgalt <ra...@apache.org>
Committed: Mon Jan 23 21:07:23 2017 -0500

----------------------------------------------------------------------
 .../curator/x/discovery/ServiceInstance.java    |  32 +++++-
 .../x/discovery/ServiceInstanceBuilder.java     |   9 +-
 .../discovery/details/ServiceProviderImpl.java  |   8 ++
 .../x/discovery/TestJsonInstanceSerializer.java |  35 ++++--
 .../discovery/details/TestServiceProvider.java  | 109 +++++++++++++++++++
 5 files changed, 181 insertions(+), 12 deletions(-)
----------------------------------------------------------------------



[09/50] curator git commit: prevent double reset()

Posted by dr...@apache.org.
prevent double reset()


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

Branch: refs/heads/master
Commit: 6c1db4e33842bdd0aaf505c4f57f0615759ca421
Parents: 8f59209
Author: randgalt <ra...@apache.org>
Authored: Sun Jan 8 09:54:29 2017 -0500
Committer: randgalt <ra...@apache.org>
Committed: Sun Jan 8 09:54:29 2017 -0500

----------------------------------------------------------------------
 .../org/apache/curator/x/async/details/InternalWatcher.java     | 5 +++++
 1 file changed, 5 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/curator/blob/6c1db4e3/curator-x-async/src/main/java/org/apache/curator/x/async/details/InternalWatcher.java
----------------------------------------------------------------------
diff --git a/curator-x-async/src/main/java/org/apache/curator/x/async/details/InternalWatcher.java b/curator-x-async/src/main/java/org/apache/curator/x/async/details/InternalWatcher.java
index 7578083..52b64e5 100644
--- a/curator-x-async/src/main/java/org/apache/curator/x/async/details/InternalWatcher.java
+++ b/curator-x-async/src/main/java/org/apache/curator/x/async/details/InternalWatcher.java
@@ -18,12 +18,14 @@
  */
 package org.apache.curator.x.async.details;
 
+import com.google.common.base.Preconditions;
 import org.apache.curator.x.async.AsyncEventException;
 import org.apache.curator.x.async.WatchMode;
 import org.apache.zookeeper.WatchedEvent;
 import org.apache.zookeeper.Watcher;
 import java.util.concurrent.CompletableFuture;
 import java.util.concurrent.CompletionStage;
+import java.util.concurrent.atomic.AtomicBoolean;
 import java.util.function.UnaryOperator;
 
 class InternalWatcher implements Watcher
@@ -69,6 +71,8 @@ class InternalWatcher implements Watcher
                 {
                     AsyncEventException exception = new AsyncEventException()
                     {
+                        private final AtomicBoolean isReset = new AtomicBoolean(false);
+
                         @Override
                         public Event.KeeperState getKeeperState()
                         {
@@ -78,6 +82,7 @@ class InternalWatcher implements Watcher
                         @Override
                         public CompletionStage<WatchedEvent> reset()
                         {
+                            Preconditions.checkState(isReset.compareAndSet(false, true), "Already reset");
                             future = new CompletableFuture<>();
                             return future;
                         }


[13/50] curator git commit: link to async from Framework page

Posted by dr...@apache.org.
link to async from Framework page


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

Branch: refs/heads/master
Commit: e45466acd8fcdcfd9066d5be04e4a176e8e67b89
Parents: dca47a8
Author: randgalt <ra...@apache.org>
Authored: Mon Jan 9 14:09:48 2017 -0500
Committer: randgalt <ra...@apache.org>
Committed: Mon Jan 9 14:09:48 2017 -0500

----------------------------------------------------------------------
 curator-framework/src/site/confluence/index.confluence | 2 ++
 1 file changed, 2 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/curator/blob/e45466ac/curator-framework/src/site/confluence/index.confluence
----------------------------------------------------------------------
diff --git a/curator-framework/src/site/confluence/index.confluence b/curator-framework/src/site/confluence/index.confluence
index 13df0de..4d1dcb6 100644
--- a/curator-framework/src/site/confluence/index.confluence
+++ b/curator-framework/src/site/confluence/index.confluence
@@ -19,6 +19,8 @@ ZooKeeper and handles the complexity of managing connections to the ZooKeeper cl
 ** Distributed Priority Queue
 ** ...
 
+_NOTE:_ A Java 8 asynchronous version of CuratorFramework is available: [[Curator Async|../curator\-x\-async/index.html]].
+
 h2. Allocating a Curator Framework Instance
 CuratorFrameworks are allocated using the CuratorFrameworkFactory which provides both factory methods and a builder for
 creating instances. IMPORTANT: CuratorFramework instances are fully thread\-safe. You should share one CuratorFramework per


[06/50] curator git commit: fixed doc

Posted by dr...@apache.org.
fixed doc


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

Branch: refs/heads/master
Commit: 21f3ac252fbd31cdf0e0c2069013d6ab7923eec5
Parents: ee4031d
Author: randgalt <ra...@apache.org>
Authored: Sat Jan 7 16:00:39 2017 -0500
Committer: randgalt <ra...@apache.org>
Committed: Sat Jan 7 16:00:39 2017 -0500

----------------------------------------------------------------------
 .../main/java/org/apache/curator/x/async/AsyncCuratorFramework.java | 1 +
 1 file changed, 1 insertion(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/curator/blob/21f3ac25/curator-x-async/src/main/java/org/apache/curator/x/async/AsyncCuratorFramework.java
----------------------------------------------------------------------
diff --git a/curator-x-async/src/main/java/org/apache/curator/x/async/AsyncCuratorFramework.java b/curator-x-async/src/main/java/org/apache/curator/x/async/AsyncCuratorFramework.java
index 183a5eb..9fc4134 100644
--- a/curator-x-async/src/main/java/org/apache/curator/x/async/AsyncCuratorFramework.java
+++ b/curator-x-async/src/main/java/org/apache/curator/x/async/AsyncCuratorFramework.java
@@ -77,6 +77,7 @@ public interface AsyncCuratorFramework extends AsyncCuratorFrameworkDsl
     /**
      * Set any combination of listener or filters
      *
+     * @param listener lister to use or <code>null</code>
      * @param resultFilter filter to use or <code>null</code>
      * @param watcherFilter filter to use or <code>null</code>
      * @see #with(java.util.function.UnaryOperator, java.util.function.UnaryOperator)


[04/50] curator git commit: watched() should be in the Dsl interface

Posted by dr...@apache.org.
watched() should be in the Dsl interface


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

Branch: refs/heads/master
Commit: 3876d3eebe50aaadef71e5d32f425fad622513a0
Parents: b813fb3
Author: randgalt <ra...@apache.org>
Authored: Sat Jan 7 14:50:59 2017 -0500
Committer: randgalt <ra...@apache.org>
Committed: Sat Jan 7 14:50:59 2017 -0500

----------------------------------------------------------------------
 .../curator/x/async/AsyncCuratorFramework.java  | 23 -------------------
 .../x/async/api/AsyncCuratorFrameworkDsl.java   | 24 ++++++++++++++++++++
 .../src/site/confluence/index.confluence        |  2 +-
 3 files changed, 25 insertions(+), 24 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/curator/blob/3876d3ee/curator-x-async/src/main/java/org/apache/curator/x/async/AsyncCuratorFramework.java
----------------------------------------------------------------------
diff --git a/curator-x-async/src/main/java/org/apache/curator/x/async/AsyncCuratorFramework.java b/curator-x-async/src/main/java/org/apache/curator/x/async/AsyncCuratorFramework.java
index 9b29918..91784b0 100644
--- a/curator-x-async/src/main/java/org/apache/curator/x/async/AsyncCuratorFramework.java
+++ b/curator-x-async/src/main/java/org/apache/curator/x/async/AsyncCuratorFramework.java
@@ -53,29 +53,6 @@ public interface AsyncCuratorFramework extends AsyncCuratorFrameworkDsl
     CuratorFramework unwrap();
 
     /**
-     * <p>
-     * Returns a facade that adds watching to any of the subsequently created builders. i.e. all
-     * operations on the WatchableAsyncCuratorFramework facade will have watchers set. Also,
-     * the {@link org.apache.curator.x.async.AsyncStage} returned from these builders will
-     * have a loaded staged watcher that is accessed from {@link org.apache.curator.x.async.AsyncStage#event()}
-     * </p>
-     *
-     * <p>
-     * {@link WatchMode#stateChangeAndSuccess} is used
-     * </p>
-     *
-     * @return watcher facade
-     */
-    WatchableAsyncCuratorFramework watched();
-
-    /**
-     * Same as {@link #watched()} but allows specifying the watch mode
-     *
-     * @return watcher facade
-     */
-    WatchableAsyncCuratorFramework watched(WatchMode mode);
-
-    /**
      * Returns a facade that adds the given UnhandledErrorListener to all background operations
      *
      * @param listener lister to use

http://git-wip-us.apache.org/repos/asf/curator/blob/3876d3ee/curator-x-async/src/main/java/org/apache/curator/x/async/api/AsyncCuratorFrameworkDsl.java
----------------------------------------------------------------------
diff --git a/curator-x-async/src/main/java/org/apache/curator/x/async/api/AsyncCuratorFrameworkDsl.java b/curator-x-async/src/main/java/org/apache/curator/x/async/api/AsyncCuratorFrameworkDsl.java
index 3a15079..a8151cd 100644
--- a/curator-x-async/src/main/java/org/apache/curator/x/async/api/AsyncCuratorFrameworkDsl.java
+++ b/curator-x-async/src/main/java/org/apache/curator/x/async/api/AsyncCuratorFrameworkDsl.java
@@ -19,6 +19,7 @@
 package org.apache.curator.x.async.api;
 
 import org.apache.curator.framework.api.transaction.CuratorOp;
+import org.apache.curator.x.async.WatchMode;
 
 /**
  * Zookeeper framework-style client
@@ -26,6 +27,29 @@ import org.apache.curator.framework.api.transaction.CuratorOp;
 public interface AsyncCuratorFrameworkDsl extends WatchableAsyncCuratorFramework
 {
     /**
+     * <p>
+     * Returns a facade that adds watching to any of the subsequently created builders. i.e. all
+     * operations on the WatchableAsyncCuratorFramework facade will have watchers set. Also,
+     * the {@link org.apache.curator.x.async.AsyncStage} returned from these builders will
+     * have a loaded staged watcher that is accessed from {@link org.apache.curator.x.async.AsyncStage#event()}
+     * </p>
+     *
+     * <p>
+     * {@link org.apache.curator.x.async.WatchMode#stateChangeAndSuccess} is used
+     * </p>
+     *
+     * @return watcher facade
+     */
+    WatchableAsyncCuratorFramework watched();
+
+    /**
+     * Same as {@link #watched()} but allows specifying the watch mode
+     *
+     * @return watcher facade
+     */
+    WatchableAsyncCuratorFramework watched(WatchMode mode);
+
+    /**
      * Start a create builder
      *
      * @return builder object

http://git-wip-us.apache.org/repos/asf/curator/blob/3876d3ee/curator-x-async/src/site/confluence/index.confluence
----------------------------------------------------------------------
diff --git a/curator-x-async/src/site/confluence/index.confluence b/curator-x-async/src/site/confluence/index.confluence
index 9c02e8e..757acc8 100644
--- a/curator-x-async/src/site/confluence/index.confluence
+++ b/curator-x-async/src/site/confluence/index.confluence
@@ -157,7 +157,7 @@ stage.thenAccept(data -> processData(data));
 
 ----
 
-CompletionStage provides a block method as well so that you can block to get the result
+CompletionStage provides a blocking method as well so that you can block to get the result
 of an operation. i.e. this makes it possible to use the async APIs in a synchronous way.
 
 {code}


[16/50] curator git commit: reworked this so that it now properly retries one time while still doing each test twice - once for classic and once for standard

Posted by dr...@apache.org.
reworked this so that it now properly retries one time while still doing each test twice - once for classic and once for standard


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

Branch: refs/heads/master
Commit: acd90971dafd9c3b4373f45734dd9f8f88a165ce
Parents: 90b39dd
Author: randgalt <ra...@apache.org>
Authored: Wed Jan 11 00:28:11 2017 -0500
Committer: randgalt <ra...@apache.org>
Committed: Wed Jan 11 00:28:11 2017 -0500

----------------------------------------------------------------------
 .../apache/curator/test/BaseClassForTests.java  | 152 +++++++++++++++----
 1 file changed, 125 insertions(+), 27 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/curator/blob/acd90971/curator-test/src/main/java/org/apache/curator/test/BaseClassForTests.java
----------------------------------------------------------------------
diff --git a/curator-test/src/main/java/org/apache/curator/test/BaseClassForTests.java b/curator-test/src/main/java/org/apache/curator/test/BaseClassForTests.java
index a5afaf2..fe4acd2 100644
--- a/curator-test/src/main/java/org/apache/curator/test/BaseClassForTests.java
+++ b/curator-test/src/main/java/org/apache/curator/test/BaseClassForTests.java
@@ -22,16 +22,19 @@ package org.apache.curator.test;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.testng.IInvokedMethod;
-import org.testng.IInvokedMethodListener;
+import org.testng.IInvokedMethodListener2;
+import org.testng.IRetryAnalyzer;
 import org.testng.ITestContext;
-import org.testng.ITestNGListener;
 import org.testng.ITestNGMethod;
 import org.testng.ITestResult;
+import org.testng.TestListenerAdapter;
 import org.testng.annotations.AfterMethod;
 import org.testng.annotations.BeforeMethod;
 import org.testng.annotations.BeforeSuite;
 import java.io.IOException;
 import java.net.BindException;
+import java.util.concurrent.atomic.AtomicBoolean;
+import java.util.concurrent.atomic.AtomicInteger;
 
 public class BaseClassForTests
 {
@@ -84,31 +87,7 @@ public class BaseClassForTests
     @BeforeSuite(alwaysRun = true)
     public void beforeSuite(ITestContext context)
     {
-        if ( !enabledSessionExpiredStateAware() )
-        {
-            ITestNGListener listener = new IInvokedMethodListener()
-            {
-                @Override
-                public void beforeInvocation(IInvokedMethod method, ITestResult testResult)
-                {
-                    int invocationCount = method.getTestMethod().getCurrentInvocationCount();
-                    System.setProperty("curator-use-classic-connection-handling", Boolean.toString(invocationCount == 1));
-                    log.info("curator-use-classic-connection-handling: " + Boolean.toString(invocationCount == 1));
-                }
-
-                @Override
-                public void afterInvocation(IInvokedMethod method, ITestResult testResult)
-                {
-                    System.clearProperty("curator-use-classic-connection-handling");
-                }
-            };
-            context.getSuite().addListener(listener);
-        }
-
-        for ( ITestNGMethod method : context.getAllTestMethods() )
-        {
-            method.setInvocationCount(enabledSessionExpiredStateAware() ? 1 : 2);
-        }
+        context.getSuite().addListener(new MethodListener(log, enabledSessionExpiredStateAware()));
     }
 
     @BeforeMethod
@@ -161,4 +140,123 @@ public class BaseClassForTests
     {
         return false;
     }
+
+    private static class RetryContext
+    {
+        final AtomicBoolean isRetrying = new AtomicBoolean(false);
+        final AtomicInteger runVersion = new AtomicInteger(0);
+    }
+
+    private static class RetryAnalyzer implements IRetryAnalyzer
+    {
+        private final Logger log;
+        private final RetryContext retryContext;
+
+        RetryAnalyzer(Logger log, RetryContext retryContext)
+        {
+            this.log = log;
+            this.retryContext = retryContext;
+        }
+
+        @Override
+        public boolean retry(ITestResult result)
+        {
+            if ( result.isSuccess() || retryContext.isRetrying.get() )
+            {
+                retryContext.isRetrying.set(false);
+                return false;
+            }
+
+            log.error("Retrying 1 time");
+            retryContext.isRetrying.set(true);
+            return true;
+        }
+    }
+
+    private static class MethodListener implements IInvokedMethodListener2
+    {
+        private final Logger log;
+        private final boolean sessionExpiredStateAware;
+
+        private static final String ATTRIBUTE_NAME = "__curator";
+
+        MethodListener(Logger log, boolean sessionExpiredStateAware)
+        {
+            this.log = log;
+            this.sessionExpiredStateAware = sessionExpiredStateAware;
+        }
+
+        @Override
+        public void beforeInvocation(IInvokedMethod method, ITestResult testResult)
+        {
+            // NOP
+        }
+
+        @Override
+        public void afterInvocation(IInvokedMethod method, ITestResult testResult)
+        {
+            // NOP
+        }
+
+        @Override
+        public void beforeInvocation(IInvokedMethod method, ITestResult testResult, ITestContext context)
+        {
+            if ( method.getTestMethod().isBeforeMethodConfiguration() )
+            {
+                TestListenerAdapter x = null;
+                RetryContext retryContext = (RetryContext)context.getAttribute(ATTRIBUTE_NAME);
+                if ( retryContext == null )
+                {
+                    retryContext = new RetryContext();
+                    context.setAttribute(ATTRIBUTE_NAME, retryContext);
+                }
+
+                if ( !sessionExpiredStateAware )
+                {
+                    System.setProperty("curator-use-classic-connection-handling", Boolean.toString(retryContext.runVersion.get() > 0));
+                    log.info("curator-use-classic-connection-handling: " + Boolean.toString(retryContext.runVersion.get() > 0));
+                }
+            }
+            else if ( method.isTestMethod() )
+            {
+                method.getTestMethod().setRetryAnalyzer(new RetryAnalyzer(log, (RetryContext)context.getAttribute(ATTRIBUTE_NAME)));
+            }
+        }
+
+        @Override
+        public void afterInvocation(IInvokedMethod method, ITestResult testResult, ITestContext context)
+        {
+            if ( method.getTestMethod().isBeforeSuiteConfiguration() && !sessionExpiredStateAware )
+            {
+                for ( ITestNGMethod testMethod : context.getAllTestMethods() )
+                {
+                    testMethod.setInvocationCount(2);
+                }
+            }
+
+            if ( method.isTestMethod() )
+            {
+                RetryContext retryContext = (RetryContext)context.getAttribute(ATTRIBUTE_NAME);
+                if ( retryContext == null )
+                {
+                    log.error("No retryContext!");
+                }
+                else
+                {
+                    System.clearProperty("curator-use-classic-connection-handling");
+                    if ( testResult.isSuccess() )
+                    {
+                        retryContext.isRetrying.set(false);
+                    }
+                    if ( testResult.isSuccess() || retryContext.isRetrying.get() )
+                    {
+                        if ( retryContext.runVersion.incrementAndGet() > 1 )
+                        {
+                            context.setAttribute(ATTRIBUTE_NAME, null);
+                        }
+                    }
+                }
+            }
+        }
+    }
 }


[31/50] curator git commit: [maven-release-plugin] prepare release apache-curator-3.3.0

Posted by dr...@apache.org.
[maven-release-plugin] prepare release apache-curator-3.3.0


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

Branch: refs/heads/master
Commit: 8b9f7d5ce0369976f766745069be62e2b126ef22
Parents: 753142a
Author: Cam McKenzie <ca...@apache.org>
Authored: Wed Mar 1 15:27:33 2017 +1100
Committer: Cam McKenzie <ca...@apache.org>
Committed: Wed Mar 1 15:27:33 2017 +1100

----------------------------------------------------------------------
 curator-client/pom.xml             | 4 ++--
 curator-examples/pom.xml           | 2 +-
 curator-framework/pom.xml          | 4 ++--
 curator-recipes/pom.xml            | 4 ++--
 curator-test/pom.xml               | 4 ++--
 curator-x-async/pom.xml            | 2 +-
 curator-x-discovery-server/pom.xml | 4 ++--
 curator-x-discovery/pom.xml        | 4 ++--
 curator-x-rpc/pom.xml              | 4 ++--
 pom.xml                            | 4 ++--
 10 files changed, 18 insertions(+), 18 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/curator/blob/8b9f7d5c/curator-client/pom.xml
----------------------------------------------------------------------
diff --git a/curator-client/pom.xml b/curator-client/pom.xml
index 7bf373f..dd7c719 100644
--- a/curator-client/pom.xml
+++ b/curator-client/pom.xml
@@ -23,11 +23,11 @@
     <parent>
         <groupId>org.apache.curator</groupId>
         <artifactId>apache-curator</artifactId>
-        <version>3.2.2-SNAPSHOT</version>
+        <version>3.3.0</version>
     </parent>
 
     <artifactId>curator-client</artifactId>
-    <version>3.2.2-SNAPSHOT</version>
+    <version>3.3.0</version>
     <packaging>bundle</packaging>
 
     <name>Curator Client</name>

http://git-wip-us.apache.org/repos/asf/curator/blob/8b9f7d5c/curator-examples/pom.xml
----------------------------------------------------------------------
diff --git a/curator-examples/pom.xml b/curator-examples/pom.xml
index ffa54af..fbbd271 100644
--- a/curator-examples/pom.xml
+++ b/curator-examples/pom.xml
@@ -24,7 +24,7 @@
     <parent>
         <groupId>org.apache.curator</groupId>
         <artifactId>apache-curator</artifactId>
-        <version>3.2.2-SNAPSHOT</version>
+        <version>3.3.0</version>
     </parent>
 
     <artifactId>curator-examples</artifactId>

http://git-wip-us.apache.org/repos/asf/curator/blob/8b9f7d5c/curator-framework/pom.xml
----------------------------------------------------------------------
diff --git a/curator-framework/pom.xml b/curator-framework/pom.xml
index 8167b0d..5e1507a 100644
--- a/curator-framework/pom.xml
+++ b/curator-framework/pom.xml
@@ -24,11 +24,11 @@
     <parent>
         <groupId>org.apache.curator</groupId>
         <artifactId>apache-curator</artifactId>
-        <version>3.2.2-SNAPSHOT</version>
+        <version>3.3.0</version>
     </parent>
 
     <artifactId>curator-framework</artifactId>
-    <version>3.2.2-SNAPSHOT</version>
+    <version>3.3.0</version>
     <packaging>bundle</packaging>
 
     <name>Curator Framework</name>

http://git-wip-us.apache.org/repos/asf/curator/blob/8b9f7d5c/curator-recipes/pom.xml
----------------------------------------------------------------------
diff --git a/curator-recipes/pom.xml b/curator-recipes/pom.xml
index 0df0e8b..370a468 100644
--- a/curator-recipes/pom.xml
+++ b/curator-recipes/pom.xml
@@ -24,11 +24,11 @@
     <parent>
         <groupId>org.apache.curator</groupId>
         <artifactId>apache-curator</artifactId>
-        <version>3.2.2-SNAPSHOT</version>
+        <version>3.3.0</version>
     </parent>
 
     <artifactId>curator-recipes</artifactId>
-    <version>3.2.2-SNAPSHOT</version>
+    <version>3.3.0</version>
     <packaging>bundle</packaging>
 
     <name>Curator Recipes</name>

http://git-wip-us.apache.org/repos/asf/curator/blob/8b9f7d5c/curator-test/pom.xml
----------------------------------------------------------------------
diff --git a/curator-test/pom.xml b/curator-test/pom.xml
index afc9f36..e62a542 100644
--- a/curator-test/pom.xml
+++ b/curator-test/pom.xml
@@ -24,11 +24,11 @@
     <parent>
         <groupId>org.apache.curator</groupId>
         <artifactId>apache-curator</artifactId>
-        <version>3.2.2-SNAPSHOT</version>
+        <version>3.3.0</version>
     </parent>
 
     <artifactId>curator-test</artifactId>
-    <version>3.2.2-SNAPSHOT</version>
+    <version>3.3.0</version>
 
     <name>Curator Testing</name>
     <description>Unit testing utilities.</description>

http://git-wip-us.apache.org/repos/asf/curator/blob/8b9f7d5c/curator-x-async/pom.xml
----------------------------------------------------------------------
diff --git a/curator-x-async/pom.xml b/curator-x-async/pom.xml
index 8821a47..f7cf81a 100644
--- a/curator-x-async/pom.xml
+++ b/curator-x-async/pom.xml
@@ -3,7 +3,7 @@
     <parent>
         <groupId>org.apache.curator</groupId>
         <artifactId>apache-curator</artifactId>
-        <version>3.2.2-SNAPSHOT</version>
+        <version>3.3.0</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
 

http://git-wip-us.apache.org/repos/asf/curator/blob/8b9f7d5c/curator-x-discovery-server/pom.xml
----------------------------------------------------------------------
diff --git a/curator-x-discovery-server/pom.xml b/curator-x-discovery-server/pom.xml
index 22aacf9..3060651 100644
--- a/curator-x-discovery-server/pom.xml
+++ b/curator-x-discovery-server/pom.xml
@@ -24,11 +24,11 @@
     <parent>
         <groupId>org.apache.curator</groupId>
         <artifactId>apache-curator</artifactId>
-        <version>3.2.2-SNAPSHOT</version>
+        <version>3.3.0</version>
     </parent>
 
     <artifactId>curator-x-discovery-server</artifactId>
-    <version>3.2.2-SNAPSHOT</version>
+    <version>3.3.0</version>
     <packaging>bundle</packaging>
 
     <name>Curator Service Discovery Server</name>

http://git-wip-us.apache.org/repos/asf/curator/blob/8b9f7d5c/curator-x-discovery/pom.xml
----------------------------------------------------------------------
diff --git a/curator-x-discovery/pom.xml b/curator-x-discovery/pom.xml
index 7f978e7..1eea0b9 100644
--- a/curator-x-discovery/pom.xml
+++ b/curator-x-discovery/pom.xml
@@ -24,11 +24,11 @@
     <parent>
         <groupId>org.apache.curator</groupId>
         <artifactId>apache-curator</artifactId>
-        <version>3.2.2-SNAPSHOT</version>
+        <version>3.3.0</version>
     </parent>
 
     <artifactId>curator-x-discovery</artifactId>
-    <version>3.2.2-SNAPSHOT</version>
+    <version>3.3.0</version>
     <packaging>bundle</packaging>
 
     <name>Curator Service Discovery</name>

http://git-wip-us.apache.org/repos/asf/curator/blob/8b9f7d5c/curator-x-rpc/pom.xml
----------------------------------------------------------------------
diff --git a/curator-x-rpc/pom.xml b/curator-x-rpc/pom.xml
index 5c837d4..a88878a 100644
--- a/curator-x-rpc/pom.xml
+++ b/curator-x-rpc/pom.xml
@@ -22,12 +22,12 @@
     <parent>
         <artifactId>apache-curator</artifactId>
         <groupId>org.apache.curator</groupId>
-        <version>3.2.2-SNAPSHOT</version>
+        <version>3.3.0</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
 
     <artifactId>curator-x-rpc</artifactId>
-    <version>3.2.2-SNAPSHOT</version>
+    <version>3.3.0</version>
 
     <name>Curator RPC Proxy</name>
     <description>A proxy that bridges non-java environments with the Curator framework and recipes</description>

http://git-wip-us.apache.org/repos/asf/curator/blob/8b9f7d5c/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 8ad7469..9dbbbbc 100644
--- a/pom.xml
+++ b/pom.xml
@@ -28,7 +28,7 @@
 
     <groupId>org.apache.curator</groupId>
     <artifactId>apache-curator</artifactId>
-    <version>3.2.2-SNAPSHOT</version>
+    <version>3.3.0</version>
     <packaging>pom</packaging>
 
     <name>Apache Curator</name>
@@ -96,7 +96,7 @@
         <connection>scm:git:https://git-wip-us.apache.org/repos/asf/curator.git</connection>
         <developerConnection>scm:git:https://git-wip-us.apache.org/repos/asf/curator.git
         </developerConnection>
-        <tag>apache-curator-3.2.0</tag>
+        <tag>apache-curator-3.3.0</tag>
     </scm>
 
     <issueManagement>


[46/50] curator git commit: Merge branch 'CURATOR-3.0' into CURATOR-351

Posted by dr...@apache.org.
Merge branch 'CURATOR-3.0' into CURATOR-351


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

Branch: refs/heads/master
Commit: da7f18c618eb51e6aaaff7b10f79240cefaf0183
Parents: e3fec5b 00ffe77
Author: randgalt <ra...@apache.org>
Authored: Mon Apr 17 19:08:15 2017 -0500
Committer: randgalt <ra...@apache.org>
Committed: Mon Apr 17 19:08:15 2017 -0500

----------------------------------------------------------------------
 .../apache/curator/framework/recipes/nodes/PersistentNode.java | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/curator/blob/da7f18c6/curator-recipes/src/main/java/org/apache/curator/framework/recipes/nodes/PersistentNode.java
----------------------------------------------------------------------
diff --cc curator-recipes/src/main/java/org/apache/curator/framework/recipes/nodes/PersistentNode.java
index a45d0a8,6c0c22c..0cda2a1
--- a/curator-recipes/src/main/java/org/apache/curator/framework/recipes/nodes/PersistentNode.java
+++ b/curator-recipes/src/main/java/org/apache/curator/framework/recipes/nodes/PersistentNode.java
@@@ -435,12 -419,9 +435,10 @@@ public class PersistentNode implements 
              CreateModable<ACLBackgroundPathAndBytesable<String>> localCreateMethod = createMethod.get();
              if ( localCreateMethod == null )
              {
 -                CreateModable<ACLBackgroundPathAndBytesable<String>> tempCreateMethod = useProtection ? client.create().creatingParentContainersIfNeeded().withProtection() : client.create().creatingParentContainersIfNeeded();
 +                CreateBuilderMain createBuilder = mode.isTTL() ? client.create().withTtl(ttl) : client.create();
 +                CreateModable<ACLBackgroundPathAndBytesable<String>> tempCreateMethod = useProtection ? createBuilder.creatingParentContainersIfNeeded().withProtection() : createBuilder.creatingParentContainersIfNeeded();
-                 if ( createMethod.compareAndSet(null, tempCreateMethod) )
-                 {
-                     localCreateMethod = tempCreateMethod;
-                 }
+                 createMethod.compareAndSet(null, tempCreateMethod);
+                 localCreateMethod = createMethod.get();
              }
              localCreateMethod.withMode(getCreateMode(existingPath != null)).inBackground(backgroundCallback).forPath(createPath, data.get());
          }


[27/50] curator git commit: Merge branch 'CURATOR-3.0' into CURATOR-99

Posted by dr...@apache.org.
Merge branch 'CURATOR-3.0' into CURATOR-99


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

Branch: refs/heads/master
Commit: 24ba3c2745c5fd6e4eaeba2cd2f31f7caeeccf65
Parents: 3a966ea 8363692
Author: randgalt <ra...@apache.org>
Authored: Mon Jan 23 21:56:03 2017 -0500
Committer: randgalt <ra...@apache.org>
Committed: Mon Jan 23 21:56:03 2017 -0500

----------------------------------------------------------------------
 curator-client/pom.xml                          |  40 ++++-
 .../org/apache/curator/utils/DebugUtils.java    |   1 +
 curator-recipes/pom.xml                         |   6 +
 .../framework/recipes/cache/TreeCache.java      |  67 +++++----
 .../recipes/locks/InterProcessSemaphore.java    |   6 +
 .../locks/InterProcessSemaphoreMutex.java       |  13 +-
 .../recipes/locks/InterProcessSemaphoreV2.java  |   5 +
 .../curator/framework/recipes/locks/Lease.java  |   8 +
 .../framework/recipes/nodes/PersistentNode.java |  15 +-
 .../recipes/leader/TestLeaderSelector.java      |   2 +-
 .../leader/TestLeaderSelectorParticipants.java  |   2 +-
 .../locks/TestInterProcessSemaphore.java        |  11 +-
 .../recipes/nodes/TestGroupMember.java          |  28 +++-
 curator-test/pom.xml                            |  47 +++++-
 .../apache/curator/test/BaseClassForTests.java  | 148 +++++++++++++++----
 curator-x-discovery/pom.xml                     |   6 +
 .../curator/x/discovery/ServiceInstance.java    |  32 +++-
 .../x/discovery/ServiceInstanceBuilder.java     |   9 +-
 .../discovery/details/ServiceProviderImpl.java  |   8 +
 .../x/discovery/TestJsonInstanceSerializer.java |  35 +++--
 .../discovery/details/TestServiceProvider.java  | 109 ++++++++++++++
 pom.xml                                         |  45 +++++-
 22 files changed, 545 insertions(+), 98 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/curator/blob/24ba3c27/pom.xml
----------------------------------------------------------------------


[14/50] curator git commit: Merge branch 'master' into CURATOR-3.0

Posted by dr...@apache.org.
Merge branch 'master' into CURATOR-3.0


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

Branch: refs/heads/master
Commit: 90b39dd87ce8e96dc4d25633960ec7583d33b3d6
Parents: 770aa41 0ad09eb
Author: randgalt <ra...@apache.org>
Authored: Mon Jan 9 14:23:49 2017 -0500
Committer: randgalt <ra...@apache.org>
Committed: Mon Jan 9 14:23:49 2017 -0500

----------------------------------------------------------------------
 .../framework/recipes/nodes/PersistentNode.java       | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/curator/blob/90b39dd8/curator-recipes/src/main/java/org/apache/curator/framework/recipes/nodes/PersistentNode.java
----------------------------------------------------------------------


[07/50] curator git commit: Merge branch 'master' into CURATOR-3.0

Posted by dr...@apache.org.
Merge branch 'master' into CURATOR-3.0


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

Branch: refs/heads/master
Commit: da48ef388f6153e66d251121854bb0faae77a3ec
Parents: e683264 d3bccce
Author: randgalt <ra...@apache.org>
Authored: Sun Jan 8 00:43:32 2017 -0500
Committer: randgalt <ra...@apache.org>
Committed: Sun Jan 8 00:43:32 2017 -0500

----------------------------------------------------------------------
 .../framework/recipes/cache/TreeCache.java      | 67 ++++++++++++--------
 .../locks/InterProcessSemaphoreMutex.java       | 13 ++--
 2 files changed, 43 insertions(+), 37 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/curator/blob/da48ef38/curator-recipes/src/main/java/org/apache/curator/framework/recipes/cache/TreeCache.java
----------------------------------------------------------------------
diff --cc curator-recipes/src/main/java/org/apache/curator/framework/recipes/cache/TreeCache.java
index ed32223,3ffb58f..9bf2789
--- a/curator-recipes/src/main/java/org/apache/curator/framework/recipes/cache/TreeCache.java
+++ b/curator-recipes/src/main/java/org/apache/curator/framework/recipes/cache/TreeCache.java
@@@ -286,8 -290,9 +297,8 @@@ public class TreeCache implements Close
  
          void wasDeleted() throws Exception
          {
-             ChildData oldChildData = childData.getAndSet(null);
-             ConcurrentMap<String, TreeNode> childMap = children.getAndSet(null);
+             ChildData oldChildData = childDataUpdater.getAndSet(this, null);
 -            client.clearWatcherReferences(this);
+             ConcurrentMap<String, TreeNode> childMap = childrenUpdater.getAndSet(this,null);
              if ( childMap != null )
              {
                  ArrayList<TreeNode> childCopy = new ArrayList<TreeNode>(childMap.values());

http://git-wip-us.apache.org/repos/asf/curator/blob/da48ef38/curator-recipes/src/main/java/org/apache/curator/framework/recipes/locks/InterProcessSemaphoreMutex.java
----------------------------------------------------------------------
diff --cc curator-recipes/src/main/java/org/apache/curator/framework/recipes/locks/InterProcessSemaphoreMutex.java
index 444b10d,ba3b649..57e2c80
--- a/curator-recipes/src/main/java/org/apache/curator/framework/recipes/locks/InterProcessSemaphoreMutex.java
+++ b/curator-recipes/src/main/java/org/apache/curator/framework/recipes/locks/InterProcessSemaphoreMutex.java
@@@ -64,17 -61,10 +64,12 @@@ public class InterProcessSemaphoreMute
      @Override
      public void release() throws Exception
      {
+         Lease lease = this.lease;
          Preconditions.checkState(lease != null, "Not acquired");
 +
-         try
-         {
-             lease.close();
-             watcherRemoveClient.removeWatchers();
-         }
-         finally
-         {
-             lease = null;
-         }
+         this.lease = null;
+         lease.close();
++        watcherRemoveClient.removeWatchers();
      }
  
      @Override


[23/50] curator git commit: Added doc

Posted by dr...@apache.org.
Added doc


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

Branch: refs/heads/master
Commit: 42d2f4577f2103ab3f522634c66941ea4521c25a
Parents: 649c441
Author: randgalt <ra...@apache.org>
Authored: Sat Jan 21 17:57:04 2017 -0500
Committer: randgalt <ra...@apache.org>
Committed: Sat Jan 21 17:57:04 2017 -0500

----------------------------------------------------------------------
 .../org/apache/curator/x/async/AsyncResult.java |  2 +-
 .../src/site/confluence/index.confluence        | 48 ++++++++++++++++++++
 2 files changed, 49 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/curator/blob/42d2f457/curator-x-async/src/main/java/org/apache/curator/x/async/AsyncResult.java
----------------------------------------------------------------------
diff --git a/curator-x-async/src/main/java/org/apache/curator/x/async/AsyncResult.java b/curator-x-async/src/main/java/org/apache/curator/x/async/AsyncResult.java
index 5c99480..c264269 100644
--- a/curator-x-async/src/main/java/org/apache/curator/x/async/AsyncResult.java
+++ b/curator-x-async/src/main/java/org/apache/curator/x/async/AsyncResult.java
@@ -27,7 +27,7 @@ import java.util.concurrent.CompletionStage;
  * <p>
  *     Utility that combines the value, the ZooKeeper result code and the exception in one object
  *     allowing you to not worry about exceptional completions. i.e. the {@link java.util.concurrent.CompletionStage}
- *     retured by {@link org.apache.curator.x.async.AsyncResult#of(AsyncStage)} always completes successfully with an
+ *     returned by {@link org.apache.curator.x.async.AsyncResult#of(AsyncStage)} always completes successfully with an
  *     {@link org.apache.curator.x.async.AsyncResult} object.
  * </p>
  *

http://git-wip-us.apache.org/repos/asf/curator/blob/42d2f457/curator-x-async/src/site/confluence/index.confluence
----------------------------------------------------------------------
diff --git a/curator-x-async/src/site/confluence/index.confluence b/curator-x-async/src/site/confluence/index.confluence
index ca3c07e..c946805 100644
--- a/curator-x-async/src/site/confluence/index.confluence
+++ b/curator-x-async/src/site/confluence/index.confluence
@@ -96,6 +96,37 @@ stage.event().exceptionally(e -> {
 });
 {code}
 
+h4. AsyncResult
+
+As a convenience, you can use {{AsyncResult}} to combine ZooKeeper method value, the ZooKeeper result
+code and any exception in one object allowing you to not worry about exceptional completions. i.e. the {{CompletionStage}}
+retured by {{AsyncResult.of()}} always completes successfully with an AsyncResult object.
+
+AsyncResult has methods to get either the method result (a path, Stat, etc.), a KeeperException code
+or a general exception:
+
+{code}
+Optional<T> getValue();
+
+KeeperException.Code getCode();
+
+Optional<Throwable> getException();
+{code}
+
+Use AsyncResult by wrapping an {{AsyncStage}} value. i.e.
+
+{code}
+CompletionStage<AsyncResult<Stat>> resultStage = AsyncResult.of(async.checkExists().forPath(path));
+resultStage.thenAccept(result -> {
+    if ( result.getValue().isPresent() ) {
+        // ...
+    } else if ( result.getCode() == KeeperException.Code.NOAUTH ) {
+        // ...
+    }
+    // etc.
+});
+{code}
+
 h2. Examples
 
 h4. Create a sequential ZNode
@@ -132,6 +163,23 @@ async.create().withOptions(EnumSet.of(doProtected)).forPath(path).handle((actual
 
 ----
 
+h4. Simplied usage via AsyncResult
+
+{code}
+AsyncResult.of(async.create().withOptions(EnumSet.of(doProtected)).forPath(path)).thenAccept(result -> {
+    if ( result.getRawValue() != null )
+    {
+        // result.getRawValue() is the path created
+    }
+    else
+    {
+        // ...
+    }
+});
+{code}
+
+----
+
 h4. Using executors
 
 Your completion routines can operate in a separate thread if you provide an executor.


[29/50] curator git commit: Merge branch 'master' into CURATOR-3.0

Posted by dr...@apache.org.
Merge branch 'master' into CURATOR-3.0


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

Branch: refs/heads/master
Commit: d7a65ad5e90c26cb487fe864146b01277dd8cc1a
Parents: 62f428c e2aef81
Author: randgalt <ra...@apache.org>
Authored: Tue Feb 28 19:55:52 2017 -0300
Committer: randgalt <ra...@apache.org>
Committed: Tue Feb 28 19:55:52 2017 -0300

----------------------------------------------------------------------
 .../apache/curator/ConnectionStateAccessor.java | 45 ++++++++++++++++++++
 1 file changed, 45 insertions(+)
----------------------------------------------------------------------



[36/50] curator git commit: Merge branch 'master' into CURATOR-3.0

Posted by dr...@apache.org.
Merge branch 'master' into CURATOR-3.0


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

Branch: refs/heads/master
Commit: 6d41d4a8025a8c982fc8fbd1c92b5cd9a3e3dacc
Parents: 850b6e4 2672049
Author: randgalt <ra...@apache.org>
Authored: Mon Mar 20 09:10:45 2017 -0500
Committer: randgalt <ra...@apache.org>
Committed: Mon Mar 20 09:10:45 2017 -0500

----------------------------------------------------------------------
 .../recipes/cache/PathChildrenCache.java        |  2 +-
 .../cache/TestPathChildrenCacheInCluster.java   | 60 ++++++++++++++++++++
 2 files changed, 61 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/curator/blob/6d41d4a8/curator-recipes/src/main/java/org/apache/curator/framework/recipes/cache/PathChildrenCache.java
----------------------------------------------------------------------


[50/50] curator git commit: CURATOR-3.0 becomes the master branch.

Posted by dr...@apache.org.
CURATOR-3.0 becomes the master branch.


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

Branch: refs/heads/master
Commit: ed3082ecfebc332ba96da7a5bda4508a1985db6e
Parents: 35f5d27 abaabb5
Author: Scott Blum <dr...@apache.org>
Authored: Tue May 2 15:31:17 2017 -0400
Committer: Scott Blum <dr...@apache.org>
Committed: Tue May 2 15:31:17 2017 -0400

----------------------------------------------------------------------
 .../recipes/locks/InterProcessMutex.java        |  7 +++-
 .../framework/recipes/nodes/PersistentNode.java | 42 +++++++++++++++++++-
 .../recipes/nodes/PersistentNodeListener.java   | 33 +++++++++++++++
 3 files changed, 79 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/curator/blob/ed3082ec/curator-recipes/src/main/java/org/apache/curator/framework/recipes/nodes/PersistentNode.java
----------------------------------------------------------------------


[49/50] curator git commit: intermediate AsyncTransactionCreateBuilder DSL methods should return AsyncPathAndBytesable not AsynccPathable

Posted by dr...@apache.org.
intermediate AsyncTransactionCreateBuilder DSL methods should return AsyncPathAndBytesable not AsynccPathable


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

Branch: refs/heads/master
Commit: 35f5d274e572b91332ab04f3d03f79938cd216f3
Parents: 086c5b4
Author: randgalt <ra...@apache.org>
Authored: Sat Apr 29 14:10:25 2017 -0500
Committer: randgalt <ra...@apache.org>
Committed: Sat Apr 29 14:10:25 2017 -0500

----------------------------------------------------------------------
 .../curator/x/async/api/AsyncTransactionCreateBuilder.java   | 8 ++++----
 .../curator/x/async/details/AsyncTransactionOpImpl.java      | 8 ++++----
 2 files changed, 8 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/curator/blob/35f5d274/curator-x-async/src/main/java/org/apache/curator/x/async/api/AsyncTransactionCreateBuilder.java
----------------------------------------------------------------------
diff --git a/curator-x-async/src/main/java/org/apache/curator/x/async/api/AsyncTransactionCreateBuilder.java b/curator-x-async/src/main/java/org/apache/curator/x/async/api/AsyncTransactionCreateBuilder.java
index 439db81..81da5c0 100644
--- a/curator-x-async/src/main/java/org/apache/curator/x/async/api/AsyncTransactionCreateBuilder.java
+++ b/curator-x-async/src/main/java/org/apache/curator/x/async/api/AsyncTransactionCreateBuilder.java
@@ -34,7 +34,7 @@ public interface AsyncTransactionCreateBuilder extends AsyncPathAndBytesable<Cur
      * @param createMode mode
      * @return this
      */
-    AsyncPathable<CuratorOp> withMode(CreateMode createMode);
+    AsyncPathAndBytesable<CuratorOp> withMode(CreateMode createMode);
 
     /**
      * Set an ACL list (default is {@link org.apache.zookeeper.ZooDefs.Ids#OPEN_ACL_UNSAFE})
@@ -42,14 +42,14 @@ public interface AsyncTransactionCreateBuilder extends AsyncPathAndBytesable<Cur
      * @param aclList the ACL list to use
      * @return this
      */
-    AsyncPathable<CuratorOp> withACL(List<ACL> aclList);
+    AsyncPathAndBytesable<CuratorOp> withACL(List<ACL> aclList);
 
     /**
      * Cause the data to be compressed using the configured compression provider
      *
      * @return this
      */
-    AsyncPathable<CuratorOp> compressed();
+    AsyncPathAndBytesable<CuratorOp> compressed();
 
     /**
      * Specify mode, acl list and compression
@@ -62,5 +62,5 @@ public interface AsyncTransactionCreateBuilder extends AsyncPathAndBytesable<Cur
      * @see #compressed()
      * @return this
      */
-    AsyncPathable<CuratorOp> withOptions(CreateMode createMode, List<ACL> aclList, boolean compressed);
+    AsyncPathAndBytesable<CuratorOp> withOptions(CreateMode createMode, List<ACL> aclList, boolean compressed);
 }

http://git-wip-us.apache.org/repos/asf/curator/blob/35f5d274/curator-x-async/src/main/java/org/apache/curator/x/async/details/AsyncTransactionOpImpl.java
----------------------------------------------------------------------
diff --git a/curator-x-async/src/main/java/org/apache/curator/x/async/details/AsyncTransactionOpImpl.java b/curator-x-async/src/main/java/org/apache/curator/x/async/details/AsyncTransactionOpImpl.java
index 89f0a22..0be720f 100644
--- a/curator-x-async/src/main/java/org/apache/curator/x/async/details/AsyncTransactionOpImpl.java
+++ b/curator-x-async/src/main/java/org/apache/curator/x/async/details/AsyncTransactionOpImpl.java
@@ -56,28 +56,28 @@ class AsyncTransactionOpImpl implements AsyncTransactionOp
             private boolean compressed = false;
 
             @Override
-            public AsyncPathable<CuratorOp> withMode(CreateMode createMode)
+            public AsyncPathAndBytesable<CuratorOp> withMode(CreateMode createMode)
             {
                 this.createMode = Objects.requireNonNull(createMode, "createMode cannot be null");
                 return this;
             }
 
             @Override
-            public AsyncPathable<CuratorOp> withACL(List<ACL> aclList)
+            public AsyncPathAndBytesable<CuratorOp> withACL(List<ACL> aclList)
             {
                 this.aclList = aclList;
                 return this;
             }
 
             @Override
-            public AsyncPathable<CuratorOp> compressed()
+            public AsyncPathAndBytesable<CuratorOp> compressed()
             {
                 compressed = true;
                 return this;
             }
 
             @Override
-            public AsyncPathable<CuratorOp> withOptions(CreateMode createMode, List<ACL> aclList, boolean compressed)
+            public AsyncPathAndBytesable<CuratorOp> withOptions(CreateMode createMode, List<ACL> aclList, boolean compressed)
             {
                 this.createMode = Objects.requireNonNull(createMode, "createMode cannot be null");
                 this.aclList = aclList;


[41/50] curator git commit: Merge branch 'master' into CURATOR-3.0

Posted by dr...@apache.org.
Merge branch 'master' into CURATOR-3.0


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

Branch: refs/heads/master
Commit: 191aca247dc17d7657a3aaf2c678d29036e992cb
Parents: b3939ac 649e490
Author: randgalt <ra...@apache.org>
Authored: Mon Apr 3 11:50:37 2017 -0500
Committer: randgalt <ra...@apache.org>
Committed: Mon Apr 3 11:50:37 2017 -0500

----------------------------------------------------------------------
 doap.rdf | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------



[24/50] curator git commit: fixed some misspellings in the doc

Posted by dr...@apache.org.
fixed some misspellings in the doc


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

Branch: refs/heads/master
Commit: 600a2f94bd968ae8e94f237be8a0962f7af3d538
Parents: 42d2f45
Author: randgalt <ra...@apache.org>
Authored: Sun Jan 22 15:31:21 2017 -0500
Committer: randgalt <ra...@apache.org>
Committed: Sun Jan 22 15:31:21 2017 -0500

----------------------------------------------------------------------
 curator-x-async/src/site/confluence/index.confluence | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/curator/blob/600a2f94/curator-x-async/src/site/confluence/index.confluence
----------------------------------------------------------------------
diff --git a/curator-x-async/src/site/confluence/index.confluence b/curator-x-async/src/site/confluence/index.confluence
index c946805..dedcef7 100644
--- a/curator-x-async/src/site/confluence/index.confluence
+++ b/curator-x-async/src/site/confluence/index.confluence
@@ -100,7 +100,7 @@ h4. AsyncResult
 
 As a convenience, you can use {{AsyncResult}} to combine ZooKeeper method value, the ZooKeeper result
 code and any exception in one object allowing you to not worry about exceptional completions. i.e. the {{CompletionStage}}
-retured by {{AsyncResult.of()}} always completes successfully with an AsyncResult object.
+returned by {{AsyncResult.of()}} always completes successfully with an AsyncResult object.
 
 AsyncResult has methods to get either the method result (a path, Stat, etc.), a KeeperException code
 or a general exception:
@@ -163,7 +163,7 @@ async.create().withOptions(EnumSet.of(doProtected)).forPath(path).handle((actual
 
 ----
 
-h4. Simplied usage via AsyncResult
+h4. Simplified usage via AsyncResult
 
 {code}
 AsyncResult.of(async.create().withOptions(EnumSet.of(doProtected)).forPath(path)).thenAccept(result -> {


[32/50] curator git commit: [maven-release-plugin] prepare for next development iteration

Posted by dr...@apache.org.
[maven-release-plugin] prepare for next development iteration


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

Branch: refs/heads/master
Commit: 87a145ca3346cd1bab8a4fbdc3b1d3d9fe237dc7
Parents: 8b9f7d5
Author: Cam McKenzie <ca...@apache.org>
Authored: Wed Mar 1 15:27:44 2017 +1100
Committer: Cam McKenzie <ca...@apache.org>
Committed: Wed Mar 1 15:27:44 2017 +1100

----------------------------------------------------------------------
 curator-client/pom.xml             | 4 ++--
 curator-examples/pom.xml           | 2 +-
 curator-framework/pom.xml          | 4 ++--
 curator-recipes/pom.xml            | 4 ++--
 curator-test/pom.xml               | 4 ++--
 curator-x-async/pom.xml            | 2 +-
 curator-x-discovery-server/pom.xml | 4 ++--
 curator-x-discovery/pom.xml        | 4 ++--
 curator-x-rpc/pom.xml              | 4 ++--
 pom.xml                            | 4 ++--
 10 files changed, 18 insertions(+), 18 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/curator/blob/87a145ca/curator-client/pom.xml
----------------------------------------------------------------------
diff --git a/curator-client/pom.xml b/curator-client/pom.xml
index dd7c719..13c1551 100644
--- a/curator-client/pom.xml
+++ b/curator-client/pom.xml
@@ -23,11 +23,11 @@
     <parent>
         <groupId>org.apache.curator</groupId>
         <artifactId>apache-curator</artifactId>
-        <version>3.3.0</version>
+        <version>3.3.1-SNAPSHOT</version>
     </parent>
 
     <artifactId>curator-client</artifactId>
-    <version>3.3.0</version>
+    <version>3.3.1-SNAPSHOT</version>
     <packaging>bundle</packaging>
 
     <name>Curator Client</name>

http://git-wip-us.apache.org/repos/asf/curator/blob/87a145ca/curator-examples/pom.xml
----------------------------------------------------------------------
diff --git a/curator-examples/pom.xml b/curator-examples/pom.xml
index fbbd271..f612cc2 100644
--- a/curator-examples/pom.xml
+++ b/curator-examples/pom.xml
@@ -24,7 +24,7 @@
     <parent>
         <groupId>org.apache.curator</groupId>
         <artifactId>apache-curator</artifactId>
-        <version>3.3.0</version>
+        <version>3.3.1-SNAPSHOT</version>
     </parent>
 
     <artifactId>curator-examples</artifactId>

http://git-wip-us.apache.org/repos/asf/curator/blob/87a145ca/curator-framework/pom.xml
----------------------------------------------------------------------
diff --git a/curator-framework/pom.xml b/curator-framework/pom.xml
index 5e1507a..2f36e73 100644
--- a/curator-framework/pom.xml
+++ b/curator-framework/pom.xml
@@ -24,11 +24,11 @@
     <parent>
         <groupId>org.apache.curator</groupId>
         <artifactId>apache-curator</artifactId>
-        <version>3.3.0</version>
+        <version>3.3.1-SNAPSHOT</version>
     </parent>
 
     <artifactId>curator-framework</artifactId>
-    <version>3.3.0</version>
+    <version>3.3.1-SNAPSHOT</version>
     <packaging>bundle</packaging>
 
     <name>Curator Framework</name>

http://git-wip-us.apache.org/repos/asf/curator/blob/87a145ca/curator-recipes/pom.xml
----------------------------------------------------------------------
diff --git a/curator-recipes/pom.xml b/curator-recipes/pom.xml
index 370a468..77f2a51 100644
--- a/curator-recipes/pom.xml
+++ b/curator-recipes/pom.xml
@@ -24,11 +24,11 @@
     <parent>
         <groupId>org.apache.curator</groupId>
         <artifactId>apache-curator</artifactId>
-        <version>3.3.0</version>
+        <version>3.3.1-SNAPSHOT</version>
     </parent>
 
     <artifactId>curator-recipes</artifactId>
-    <version>3.3.0</version>
+    <version>3.3.1-SNAPSHOT</version>
     <packaging>bundle</packaging>
 
     <name>Curator Recipes</name>

http://git-wip-us.apache.org/repos/asf/curator/blob/87a145ca/curator-test/pom.xml
----------------------------------------------------------------------
diff --git a/curator-test/pom.xml b/curator-test/pom.xml
index e62a542..fb28d53 100644
--- a/curator-test/pom.xml
+++ b/curator-test/pom.xml
@@ -24,11 +24,11 @@
     <parent>
         <groupId>org.apache.curator</groupId>
         <artifactId>apache-curator</artifactId>
-        <version>3.3.0</version>
+        <version>3.3.1-SNAPSHOT</version>
     </parent>
 
     <artifactId>curator-test</artifactId>
-    <version>3.3.0</version>
+    <version>3.3.1-SNAPSHOT</version>
 
     <name>Curator Testing</name>
     <description>Unit testing utilities.</description>

http://git-wip-us.apache.org/repos/asf/curator/blob/87a145ca/curator-x-async/pom.xml
----------------------------------------------------------------------
diff --git a/curator-x-async/pom.xml b/curator-x-async/pom.xml
index f7cf81a..a7fdcd5 100644
--- a/curator-x-async/pom.xml
+++ b/curator-x-async/pom.xml
@@ -3,7 +3,7 @@
     <parent>
         <groupId>org.apache.curator</groupId>
         <artifactId>apache-curator</artifactId>
-        <version>3.3.0</version>
+        <version>3.3.1-SNAPSHOT</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
 

http://git-wip-us.apache.org/repos/asf/curator/blob/87a145ca/curator-x-discovery-server/pom.xml
----------------------------------------------------------------------
diff --git a/curator-x-discovery-server/pom.xml b/curator-x-discovery-server/pom.xml
index 3060651..b23e2cf 100644
--- a/curator-x-discovery-server/pom.xml
+++ b/curator-x-discovery-server/pom.xml
@@ -24,11 +24,11 @@
     <parent>
         <groupId>org.apache.curator</groupId>
         <artifactId>apache-curator</artifactId>
-        <version>3.3.0</version>
+        <version>3.3.1-SNAPSHOT</version>
     </parent>
 
     <artifactId>curator-x-discovery-server</artifactId>
-    <version>3.3.0</version>
+    <version>3.3.1-SNAPSHOT</version>
     <packaging>bundle</packaging>
 
     <name>Curator Service Discovery Server</name>

http://git-wip-us.apache.org/repos/asf/curator/blob/87a145ca/curator-x-discovery/pom.xml
----------------------------------------------------------------------
diff --git a/curator-x-discovery/pom.xml b/curator-x-discovery/pom.xml
index 1eea0b9..be49f20 100644
--- a/curator-x-discovery/pom.xml
+++ b/curator-x-discovery/pom.xml
@@ -24,11 +24,11 @@
     <parent>
         <groupId>org.apache.curator</groupId>
         <artifactId>apache-curator</artifactId>
-        <version>3.3.0</version>
+        <version>3.3.1-SNAPSHOT</version>
     </parent>
 
     <artifactId>curator-x-discovery</artifactId>
-    <version>3.3.0</version>
+    <version>3.3.1-SNAPSHOT</version>
     <packaging>bundle</packaging>
 
     <name>Curator Service Discovery</name>

http://git-wip-us.apache.org/repos/asf/curator/blob/87a145ca/curator-x-rpc/pom.xml
----------------------------------------------------------------------
diff --git a/curator-x-rpc/pom.xml b/curator-x-rpc/pom.xml
index a88878a..e831e1f 100644
--- a/curator-x-rpc/pom.xml
+++ b/curator-x-rpc/pom.xml
@@ -22,12 +22,12 @@
     <parent>
         <artifactId>apache-curator</artifactId>
         <groupId>org.apache.curator</groupId>
-        <version>3.3.0</version>
+        <version>3.3.1-SNAPSHOT</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
 
     <artifactId>curator-x-rpc</artifactId>
-    <version>3.3.0</version>
+    <version>3.3.1-SNAPSHOT</version>
 
     <name>Curator RPC Proxy</name>
     <description>A proxy that bridges non-java environments with the Curator framework and recipes</description>

http://git-wip-us.apache.org/repos/asf/curator/blob/87a145ca/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 9dbbbbc..7909428 100644
--- a/pom.xml
+++ b/pom.xml
@@ -28,7 +28,7 @@
 
     <groupId>org.apache.curator</groupId>
     <artifactId>apache-curator</artifactId>
-    <version>3.3.0</version>
+    <version>3.3.1-SNAPSHOT</version>
     <packaging>pom</packaging>
 
     <name>Apache Curator</name>
@@ -96,7 +96,7 @@
         <connection>scm:git:https://git-wip-us.apache.org/repos/asf/curator.git</connection>
         <developerConnection>scm:git:https://git-wip-us.apache.org/repos/asf/curator.git
         </developerConnection>
-        <tag>apache-curator-3.3.0</tag>
+        <tag>apache-curator-3.2.0</tag>
     </scm>
 
     <issueManagement>


[05/50] curator git commit: Added a filtering feature plus some refactoring

Posted by dr...@apache.org.
Added a filtering feature plus some refactoring


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

Branch: refs/heads/master
Commit: ee4031de78ab06494013e47911896e4e689ba131
Parents: 3876d3e
Author: randgalt <ra...@apache.org>
Authored: Sat Jan 7 15:25:54 2017 -0500
Committer: randgalt <ra...@apache.org>
Committed: Sat Jan 7 15:25:54 2017 -0500

----------------------------------------------------------------------
 .../curator/x/async/AsyncCuratorFramework.java  | 29 +++++++++-
 .../x/async/details/AsyncCreateBuilderImpl.java | 11 ++--
 .../details/AsyncCuratorFrameworkImpl.java      | 59 ++++++++++++--------
 .../x/async/details/AsyncDeleteBuilderImpl.java | 11 ++--
 .../x/async/details/AsyncExistsBuilderImpl.java | 11 ++--
 .../details/AsyncGetChildrenBuilderImpl.java    | 11 ++--
 .../details/AsyncGetConfigBuilderImpl.java      | 11 ++--
 .../async/details/AsyncGetDataBuilderImpl.java  | 11 ++--
 .../async/details/AsyncReconfigBuilderImpl.java | 11 ++--
 .../details/AsyncRemoveWatchesBuilderImpl.java  | 11 ++--
 .../x/async/details/AsyncSetACLBuilderImpl.java | 11 ++--
 .../async/details/AsyncSetDataBuilderImpl.java  | 11 ++--
 .../curator/x/async/details/BuilderCommon.java  | 13 ++---
 .../apache/curator/x/async/details/Filters.java | 53 ++++++++++++++++++
 .../x/async/details/InternalCallback.java       |  6 +-
 .../x/async/details/InternalWatcher.java        | 16 ++++--
 .../framework/imps/TestFrameworkBackground.java |  2 +-
 17 files changed, 189 insertions(+), 99 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/curator/blob/ee4031de/curator-x-async/src/main/java/org/apache/curator/x/async/AsyncCuratorFramework.java
----------------------------------------------------------------------
diff --git a/curator-x-async/src/main/java/org/apache/curator/x/async/AsyncCuratorFramework.java b/curator-x-async/src/main/java/org/apache/curator/x/async/AsyncCuratorFramework.java
index 91784b0..183a5eb 100644
--- a/curator-x-async/src/main/java/org/apache/curator/x/async/AsyncCuratorFramework.java
+++ b/curator-x-async/src/main/java/org/apache/curator/x/async/AsyncCuratorFramework.java
@@ -19,10 +19,12 @@
 package org.apache.curator.x.async;
 
 import org.apache.curator.framework.CuratorFramework;
+import org.apache.curator.framework.api.CuratorEvent;
 import org.apache.curator.framework.api.UnhandledErrorListener;
 import org.apache.curator.x.async.api.AsyncCuratorFrameworkDsl;
-import org.apache.curator.x.async.api.WatchableAsyncCuratorFramework;
 import org.apache.curator.x.async.details.AsyncCuratorFrameworkImpl;
+import org.apache.zookeeper.WatchedEvent;
+import java.util.function.UnaryOperator;
 
 /**
  * Zookeeper framework-style client that returns composable async operations
@@ -58,5 +60,28 @@ public interface AsyncCuratorFramework extends AsyncCuratorFrameworkDsl
      * @param listener lister to use
      * @return facade
      */
-    AsyncCuratorFrameworkDsl withUnhandledErrorListener(UnhandledErrorListener listener);
+    AsyncCuratorFrameworkDsl with(UnhandledErrorListener listener);
+
+    /**
+     * Returns a facade that adds the the given filters to all background operations and watchers.
+     * <code>resultFilter</code> will get called for every background callback. <code>watcherFilter</code>
+     * will get called for every watcher. The filters can return new versions or unchanged versions
+     * of the arguments.
+     *
+     * @param resultFilter filter to use or <code>null</code>
+     * @param watcherFilter filter to use or <code>null</code>
+     * @return facade
+     */
+    AsyncCuratorFrameworkDsl with(UnaryOperator<CuratorEvent> resultFilter, UnaryOperator<WatchedEvent> watcherFilter);
+
+    /**
+     * Set any combination of listener or filters
+     *
+     * @param resultFilter filter to use or <code>null</code>
+     * @param watcherFilter filter to use or <code>null</code>
+     * @see #with(java.util.function.UnaryOperator, java.util.function.UnaryOperator)
+     * @see #with(org.apache.curator.framework.api.UnhandledErrorListener)
+     * @return facade
+     */
+    AsyncCuratorFrameworkDsl with(UnhandledErrorListener listener, UnaryOperator<CuratorEvent> resultFilter, UnaryOperator<WatchedEvent> watcherFilter);
 }

http://git-wip-us.apache.org/repos/asf/curator/blob/ee4031de/curator-x-async/src/main/java/org/apache/curator/x/async/details/AsyncCreateBuilderImpl.java
----------------------------------------------------------------------
diff --git a/curator-x-async/src/main/java/org/apache/curator/x/async/details/AsyncCreateBuilderImpl.java b/curator-x-async/src/main/java/org/apache/curator/x/async/details/AsyncCreateBuilderImpl.java
index b3c91b3..b2b9000 100644
--- a/curator-x-async/src/main/java/org/apache/curator/x/async/details/AsyncCreateBuilderImpl.java
+++ b/curator-x-async/src/main/java/org/apache/curator/x/async/details/AsyncCreateBuilderImpl.java
@@ -18,12 +18,11 @@
  */
 package org.apache.curator.x.async.details;
 
-import org.apache.curator.framework.api.UnhandledErrorListener;
 import org.apache.curator.framework.imps.CreateBuilderImpl;
 import org.apache.curator.framework.imps.CuratorFrameworkImpl;
+import org.apache.curator.x.async.AsyncStage;
 import org.apache.curator.x.async.api.AsyncCreateBuilder;
 import org.apache.curator.x.async.api.AsyncPathAndBytesable;
-import org.apache.curator.x.async.AsyncStage;
 import org.apache.curator.x.async.api.CreateOption;
 import org.apache.zookeeper.CreateMode;
 import org.apache.zookeeper.data.ACL;
@@ -39,16 +38,16 @@ import static org.apache.curator.x.async.details.BackgroundProcs.safeCall;
 class AsyncCreateBuilderImpl implements AsyncCreateBuilder
 {
     private final CuratorFrameworkImpl client;
-    private final UnhandledErrorListener unhandledErrorListener;
+    private final Filters filters;
     private CreateMode createMode = CreateMode.PERSISTENT;
     private List<ACL> aclList = null;
     private Set<CreateOption> options = Collections.emptySet();
     private Stat stat = null;
 
-    AsyncCreateBuilderImpl(CuratorFrameworkImpl client, UnhandledErrorListener unhandledErrorListener)
+    AsyncCreateBuilderImpl(CuratorFrameworkImpl client, Filters filters)
     {
         this.client = client;
-        this.unhandledErrorListener = unhandledErrorListener;
+        this.filters = filters;
     }
 
     @Override
@@ -128,7 +127,7 @@ class AsyncCreateBuilderImpl implements AsyncCreateBuilder
 
     private AsyncStage<String> internalForPath(String path, byte[] data, boolean useData)
     {
-        BuilderCommon<String> common = new BuilderCommon<>(unhandledErrorListener, nameProc);
+        BuilderCommon<String> common = new BuilderCommon<>(filters, nameProc);
         CreateBuilderImpl builder = new CreateBuilderImpl(client,
             createMode,
             common.backgrounding,

http://git-wip-us.apache.org/repos/asf/curator/blob/ee4031de/curator-x-async/src/main/java/org/apache/curator/x/async/details/AsyncCuratorFrameworkImpl.java
----------------------------------------------------------------------
diff --git a/curator-x-async/src/main/java/org/apache/curator/x/async/details/AsyncCuratorFrameworkImpl.java b/curator-x-async/src/main/java/org/apache/curator/x/async/details/AsyncCuratorFrameworkImpl.java
index a6101f2..aa82644 100644
--- a/curator-x-async/src/main/java/org/apache/curator/x/async/details/AsyncCuratorFrameworkImpl.java
+++ b/curator-x-async/src/main/java/org/apache/curator/x/async/details/AsyncCuratorFrameworkImpl.java
@@ -19,6 +19,7 @@
 package org.apache.curator.x.async.details;
 
 import org.apache.curator.framework.CuratorFramework;
+import org.apache.curator.framework.api.CuratorEvent;
 import org.apache.curator.framework.api.UnhandledErrorListener;
 import org.apache.curator.framework.api.transaction.CuratorTransactionResult;
 import org.apache.curator.framework.imps.CuratorFrameworkImpl;
@@ -27,22 +28,24 @@ import org.apache.curator.framework.imps.GetACLBuilderImpl;
 import org.apache.curator.framework.imps.SyncBuilderImpl;
 import org.apache.curator.x.async.*;
 import org.apache.curator.x.async.api.*;
+import org.apache.zookeeper.WatchedEvent;
 import org.apache.zookeeper.data.ACL;
 import org.apache.zookeeper.data.Stat;
 import java.util.List;
 import java.util.Objects;
+import java.util.function.UnaryOperator;
 
 import static org.apache.curator.x.async.details.BackgroundProcs.*;
 
 public class AsyncCuratorFrameworkImpl implements AsyncCuratorFramework
 {
     private final CuratorFrameworkImpl client;
-    private final UnhandledErrorListener unhandledErrorListener;
+    private final Filters filters;
     private final WatchMode watchMode;
 
     public AsyncCuratorFrameworkImpl(CuratorFramework client)
     {
-        this(reveal(client), null, null);
+        this(reveal(client), new Filters(null, null, null), null);
     }
 
     private static CuratorFrameworkImpl reveal(CuratorFramework client)
@@ -57,29 +60,29 @@ public class AsyncCuratorFrameworkImpl implements AsyncCuratorFramework
         }
     }
 
-    public AsyncCuratorFrameworkImpl(CuratorFrameworkImpl client, UnhandledErrorListener unhandledErrorListener, WatchMode watchMode)
+    public AsyncCuratorFrameworkImpl(CuratorFrameworkImpl client, Filters filters, WatchMode watchMode)
     {
-        this.client = client;
-        this.unhandledErrorListener = unhandledErrorListener;
+        this.client = Objects.requireNonNull(client, "client cannot be null");
+        this.filters = Objects.requireNonNull(filters, "filters cannot be null");
         this.watchMode = watchMode;
     }
 
     @Override
     public AsyncCreateBuilder create()
     {
-        return new AsyncCreateBuilderImpl(client, unhandledErrorListener);
+        return new AsyncCreateBuilderImpl(client, filters);
     }
 
     @Override
     public AsyncDeleteBuilder delete()
     {
-        return new AsyncDeleteBuilderImpl(client, unhandledErrorListener);
+        return new AsyncDeleteBuilderImpl(client, filters);
     }
 
     @Override
     public AsyncSetDataBuilder setData()
     {
-        return new AsyncSetDataBuilderImpl(client, unhandledErrorListener);
+        return new AsyncSetDataBuilderImpl(client, filters);
     }
 
     @Override
@@ -99,7 +102,7 @@ public class AsyncCuratorFrameworkImpl implements AsyncCuratorFramework
             @Override
             public AsyncStage<List<ACL>> forPath(String path)
             {
-                BuilderCommon<List<ACL>> common = new BuilderCommon<>(unhandledErrorListener, aclProc);
+                BuilderCommon<List<ACL>> common = new BuilderCommon<>(filters, aclProc);
                 GetACLBuilderImpl builder = new GetACLBuilderImpl(client, common.backgrounding, stat);
                 return safeCall(common.internalCallback, () -> builder.forPath(path));
             }
@@ -109,20 +112,20 @@ public class AsyncCuratorFrameworkImpl implements AsyncCuratorFramework
     @Override
     public AsyncSetACLBuilder setACL()
     {
-        return new AsyncSetACLBuilderImpl(client, unhandledErrorListener);
+        return new AsyncSetACLBuilderImpl(client, filters);
     }
 
     @Override
     public AsyncReconfigBuilder reconfig()
     {
-        return new AsyncReconfigBuilderImpl(client, unhandledErrorListener);
+        return new AsyncReconfigBuilderImpl(client, filters);
     }
 
     @Override
     public AsyncMultiTransaction transaction()
     {
         return operations -> {
-            BuilderCommon<List<CuratorTransactionResult>> common = new BuilderCommon<>(unhandledErrorListener, opResultsProc);
+            BuilderCommon<List<CuratorTransactionResult>> common = new BuilderCommon<>(filters, opResultsProc);
             CuratorMultiTransactionImpl builder = new CuratorMultiTransactionImpl(client, common.backgrounding);
             return safeCall(common.internalCallback, () -> builder.forOperations(operations));
         };
@@ -132,7 +135,7 @@ public class AsyncCuratorFrameworkImpl implements AsyncCuratorFramework
     public AsyncSyncBuilder sync()
     {
         return path -> {
-            BuilderCommon<Void> common = new BuilderCommon<>(unhandledErrorListener, ignoredProc);
+            BuilderCommon<Void> common = new BuilderCommon<>(filters, ignoredProc);
             SyncBuilderImpl builder = new SyncBuilderImpl(client, common.backgrounding);
             return safeCall(common.internalCallback, () -> builder.forPath(path));
         };
@@ -141,7 +144,7 @@ public class AsyncCuratorFrameworkImpl implements AsyncCuratorFramework
     @Override
     public AsyncRemoveWatchesBuilder removeWatches()
     {
-        return new AsyncRemoveWatchesBuilderImpl(client, unhandledErrorListener);
+        return new AsyncRemoveWatchesBuilderImpl(client, filters);
     }
 
     @Override
@@ -153,19 +156,31 @@ public class AsyncCuratorFrameworkImpl implements AsyncCuratorFramework
     @Override
     public WatchableAsyncCuratorFramework watched()
     {
-        return new AsyncCuratorFrameworkImpl(client, unhandledErrorListener, WatchMode.stateChangeAndSuccess);
+        return new AsyncCuratorFrameworkImpl(client, filters, WatchMode.stateChangeAndSuccess);
     }
 
     @Override
     public WatchableAsyncCuratorFramework watched(WatchMode mode)
     {
-        return new AsyncCuratorFrameworkImpl(client, unhandledErrorListener, mode);
+        return new AsyncCuratorFrameworkImpl(client, filters, mode);
     }
 
     @Override
-    public AsyncCuratorFrameworkDsl withUnhandledErrorListener(UnhandledErrorListener listener)
+    public AsyncCuratorFrameworkDsl with(UnhandledErrorListener listener)
     {
-        return new AsyncCuratorFrameworkImpl(client, listener, watchMode);
+        return new AsyncCuratorFrameworkImpl(client, new Filters(listener, filters.getResultFilter(), filters.getWatcherFilter()), watchMode);
+    }
+
+    @Override
+    public AsyncCuratorFrameworkDsl with(UnaryOperator<CuratorEvent> resultFilter, UnaryOperator<WatchedEvent> watcherFilter)
+    {
+        return new AsyncCuratorFrameworkImpl(client, new Filters(filters.getListener(), resultFilter, watcherFilter), watchMode);
+    }
+
+    @Override
+    public AsyncCuratorFrameworkDsl with(UnhandledErrorListener listener, UnaryOperator<CuratorEvent> resultFilter, UnaryOperator<WatchedEvent> watcherFilter)
+    {
+        return new AsyncCuratorFrameworkImpl(client, new Filters(listener, resultFilter, watcherFilter), watchMode);
     }
 
     @Override
@@ -177,24 +192,24 @@ public class AsyncCuratorFrameworkImpl implements AsyncCuratorFramework
     @Override
     public AsyncExistsBuilder checkExists()
     {
-        return new AsyncExistsBuilderImpl(client, unhandledErrorListener, watchMode);
+        return new AsyncExistsBuilderImpl(client, filters, watchMode);
     }
 
     @Override
     public AsyncGetDataBuilder getData()
     {
-        return new AsyncGetDataBuilderImpl(client, unhandledErrorListener, watchMode);
+        return new AsyncGetDataBuilderImpl(client, filters, watchMode);
     }
 
     @Override
     public AsyncGetChildrenBuilder getChildren()
     {
-        return new AsyncGetChildrenBuilderImpl(client, unhandledErrorListener, watchMode);
+        return new AsyncGetChildrenBuilderImpl(client, filters, watchMode);
     }
 
     @Override
     public AsyncGetConfigBuilder getConfig()
     {
-        return new AsyncGetConfigBuilderImpl(client, unhandledErrorListener, watchMode);
+        return new AsyncGetConfigBuilderImpl(client, filters, watchMode);
     }
 }

http://git-wip-us.apache.org/repos/asf/curator/blob/ee4031de/curator-x-async/src/main/java/org/apache/curator/x/async/details/AsyncDeleteBuilderImpl.java
----------------------------------------------------------------------
diff --git a/curator-x-async/src/main/java/org/apache/curator/x/async/details/AsyncDeleteBuilderImpl.java b/curator-x-async/src/main/java/org/apache/curator/x/async/details/AsyncDeleteBuilderImpl.java
index 243ea44..e9efb90 100644
--- a/curator-x-async/src/main/java/org/apache/curator/x/async/details/AsyncDeleteBuilderImpl.java
+++ b/curator-x-async/src/main/java/org/apache/curator/x/async/details/AsyncDeleteBuilderImpl.java
@@ -18,12 +18,11 @@
  */
 package org.apache.curator.x.async.details;
 
-import org.apache.curator.framework.api.UnhandledErrorListener;
 import org.apache.curator.framework.imps.CuratorFrameworkImpl;
 import org.apache.curator.framework.imps.DeleteBuilderImpl;
+import org.apache.curator.x.async.AsyncStage;
 import org.apache.curator.x.async.api.AsyncDeleteBuilder;
 import org.apache.curator.x.async.api.AsyncPathable;
-import org.apache.curator.x.async.AsyncStage;
 import org.apache.curator.x.async.api.DeleteOption;
 import java.util.Collections;
 import java.util.Objects;
@@ -35,14 +34,14 @@ import static org.apache.curator.x.async.details.BackgroundProcs.safeCall;
 class AsyncDeleteBuilderImpl implements AsyncDeleteBuilder
 {
     private final CuratorFrameworkImpl client;
-    private final UnhandledErrorListener unhandledErrorListener;
+    private final Filters filters;
     private Set<DeleteOption> options = Collections.emptySet();
     private int version = -1;
 
-    AsyncDeleteBuilderImpl(CuratorFrameworkImpl client, UnhandledErrorListener unhandledErrorListener)
+    AsyncDeleteBuilderImpl(CuratorFrameworkImpl client, Filters filters)
     {
         this.client = client;
-        this.unhandledErrorListener = unhandledErrorListener;
+        this.filters = filters;
     }
 
     @Override
@@ -69,7 +68,7 @@ class AsyncDeleteBuilderImpl implements AsyncDeleteBuilder
     @Override
     public AsyncStage<Void> forPath(String path)
     {
-        BuilderCommon<Void> common = new BuilderCommon<>(unhandledErrorListener, ignoredProc);
+        BuilderCommon<Void> common = new BuilderCommon<>(filters, ignoredProc);
         DeleteBuilderImpl builder = new DeleteBuilderImpl(client, version, common.backgrounding, options.contains(DeleteOption.deletingChildrenIfNeeded), options.contains(DeleteOption.guaranteed), options.contains(DeleteOption.quietly));
         return safeCall(common.internalCallback, () -> builder.forPath(path));
     }

http://git-wip-us.apache.org/repos/asf/curator/blob/ee4031de/curator-x-async/src/main/java/org/apache/curator/x/async/details/AsyncExistsBuilderImpl.java
----------------------------------------------------------------------
diff --git a/curator-x-async/src/main/java/org/apache/curator/x/async/details/AsyncExistsBuilderImpl.java b/curator-x-async/src/main/java/org/apache/curator/x/async/details/AsyncExistsBuilderImpl.java
index d3bb8ed..7a3385b 100644
--- a/curator-x-async/src/main/java/org/apache/curator/x/async/details/AsyncExistsBuilderImpl.java
+++ b/curator-x-async/src/main/java/org/apache/curator/x/async/details/AsyncExistsBuilderImpl.java
@@ -18,13 +18,12 @@
  */
 package org.apache.curator.x.async.details;
 
-import org.apache.curator.framework.api.UnhandledErrorListener;
 import org.apache.curator.framework.imps.CuratorFrameworkImpl;
 import org.apache.curator.framework.imps.ExistsBuilderImpl;
+import org.apache.curator.x.async.AsyncStage;
 import org.apache.curator.x.async.WatchMode;
 import org.apache.curator.x.async.api.AsyncExistsBuilder;
 import org.apache.curator.x.async.api.AsyncPathable;
-import org.apache.curator.x.async.AsyncStage;
 import org.apache.curator.x.async.api.ExistsOption;
 import org.apache.zookeeper.data.Stat;
 import java.util.Collections;
@@ -37,14 +36,14 @@ import static org.apache.curator.x.async.details.BackgroundProcs.safeStatProc;
 class AsyncExistsBuilderImpl implements AsyncExistsBuilder
 {
     private final CuratorFrameworkImpl client;
-    private final UnhandledErrorListener unhandledErrorListener;
+    private final Filters filters;
     private final WatchMode watchMode;
     private Set<ExistsOption> options = Collections.emptySet();
 
-    AsyncExistsBuilderImpl(CuratorFrameworkImpl client, UnhandledErrorListener unhandledErrorListener, WatchMode watchMode)
+    AsyncExistsBuilderImpl(CuratorFrameworkImpl client, Filters filters, WatchMode watchMode)
     {
         this.client = client;
-        this.unhandledErrorListener = unhandledErrorListener;
+        this.filters = filters;
         this.watchMode = watchMode;
     }
 
@@ -58,7 +57,7 @@ class AsyncExistsBuilderImpl implements AsyncExistsBuilder
     @Override
     public AsyncStage<Stat> forPath(String path)
     {
-        BuilderCommon<Stat> common = new BuilderCommon<>(unhandledErrorListener, watchMode, safeStatProc);
+        BuilderCommon<Stat> common = new BuilderCommon<>(filters, watchMode, safeStatProc);
         ExistsBuilderImpl builder = new ExistsBuilderImpl(client,
             common.backgrounding,
             common.watcher,

http://git-wip-us.apache.org/repos/asf/curator/blob/ee4031de/curator-x-async/src/main/java/org/apache/curator/x/async/details/AsyncGetChildrenBuilderImpl.java
----------------------------------------------------------------------
diff --git a/curator-x-async/src/main/java/org/apache/curator/x/async/details/AsyncGetChildrenBuilderImpl.java b/curator-x-async/src/main/java/org/apache/curator/x/async/details/AsyncGetChildrenBuilderImpl.java
index 7258c6c..b98323f 100644
--- a/curator-x-async/src/main/java/org/apache/curator/x/async/details/AsyncGetChildrenBuilderImpl.java
+++ b/curator-x-async/src/main/java/org/apache/curator/x/async/details/AsyncGetChildrenBuilderImpl.java
@@ -18,13 +18,12 @@
  */
 package org.apache.curator.x.async.details;
 
-import org.apache.curator.framework.api.UnhandledErrorListener;
 import org.apache.curator.framework.imps.CuratorFrameworkImpl;
 import org.apache.curator.framework.imps.GetChildrenBuilderImpl;
+import org.apache.curator.x.async.AsyncStage;
 import org.apache.curator.x.async.WatchMode;
 import org.apache.curator.x.async.api.AsyncGetChildrenBuilder;
 import org.apache.curator.x.async.api.AsyncPathable;
-import org.apache.curator.x.async.AsyncStage;
 import org.apache.zookeeper.data.Stat;
 import java.util.List;
 
@@ -34,21 +33,21 @@ import static org.apache.curator.x.async.details.BackgroundProcs.safeCall;
 class AsyncGetChildrenBuilderImpl implements AsyncGetChildrenBuilder
 {
     private final CuratorFrameworkImpl client;
-    private final UnhandledErrorListener unhandledErrorListener;
+    private final Filters filters;
     private final WatchMode watchMode;
     private Stat stat = null;
 
-    AsyncGetChildrenBuilderImpl(CuratorFrameworkImpl client, UnhandledErrorListener unhandledErrorListener, WatchMode watchMode)
+    AsyncGetChildrenBuilderImpl(CuratorFrameworkImpl client, Filters filters, WatchMode watchMode)
     {
         this.client = client;
-        this.unhandledErrorListener = unhandledErrorListener;
+        this.filters = filters;
         this.watchMode = watchMode;
     }
 
     @Override
     public AsyncStage<List<String>> forPath(String path)
     {
-        BuilderCommon<List<String>> common = new BuilderCommon<>(unhandledErrorListener, watchMode, childrenProc);
+        BuilderCommon<List<String>> common = new BuilderCommon<>(filters, watchMode, childrenProc);
         GetChildrenBuilderImpl builder = new GetChildrenBuilderImpl(client, common.watcher, common.backgrounding, stat);
         return safeCall(common.internalCallback, () -> builder.forPath(path));
     }

http://git-wip-us.apache.org/repos/asf/curator/blob/ee4031de/curator-x-async/src/main/java/org/apache/curator/x/async/details/AsyncGetConfigBuilderImpl.java
----------------------------------------------------------------------
diff --git a/curator-x-async/src/main/java/org/apache/curator/x/async/details/AsyncGetConfigBuilderImpl.java b/curator-x-async/src/main/java/org/apache/curator/x/async/details/AsyncGetConfigBuilderImpl.java
index 273fba2..62272a7 100644
--- a/curator-x-async/src/main/java/org/apache/curator/x/async/details/AsyncGetConfigBuilderImpl.java
+++ b/curator-x-async/src/main/java/org/apache/curator/x/async/details/AsyncGetConfigBuilderImpl.java
@@ -18,13 +18,12 @@
  */
 package org.apache.curator.x.async.details;
 
-import org.apache.curator.framework.api.UnhandledErrorListener;
 import org.apache.curator.framework.imps.CuratorFrameworkImpl;
 import org.apache.curator.framework.imps.GetConfigBuilderImpl;
+import org.apache.curator.x.async.AsyncStage;
 import org.apache.curator.x.async.WatchMode;
 import org.apache.curator.x.async.api.AsyncEnsemblable;
 import org.apache.curator.x.async.api.AsyncGetConfigBuilder;
-import org.apache.curator.x.async.AsyncStage;
 import org.apache.zookeeper.data.Stat;
 
 import static org.apache.curator.x.async.details.BackgroundProcs.dataProc;
@@ -33,14 +32,14 @@ import static org.apache.curator.x.async.details.BackgroundProcs.safeCall;
 class AsyncGetConfigBuilderImpl implements AsyncGetConfigBuilder
 {
     private final CuratorFrameworkImpl client;
-    private final UnhandledErrorListener unhandledErrorListener;
+    private final Filters filters;
     private final WatchMode watchMode;
     private Stat stat = null;
 
-    AsyncGetConfigBuilderImpl(CuratorFrameworkImpl client, UnhandledErrorListener unhandledErrorListener, WatchMode watchMode)
+    AsyncGetConfigBuilderImpl(CuratorFrameworkImpl client, Filters filters, WatchMode watchMode)
     {
         this.client = client;
-        this.unhandledErrorListener = unhandledErrorListener;
+        this.filters = filters;
         this.watchMode = watchMode;
     }
 
@@ -54,7 +53,7 @@ class AsyncGetConfigBuilderImpl implements AsyncGetConfigBuilder
     @Override
     public AsyncStage<byte[]> forEnsemble()
     {
-        BuilderCommon<byte[]> common = new BuilderCommon<>(unhandledErrorListener, watchMode, dataProc);
+        BuilderCommon<byte[]> common = new BuilderCommon<>(filters, watchMode, dataProc);
         GetConfigBuilderImpl builder = new GetConfigBuilderImpl(client, common.backgrounding, common.watcher, stat);
         return safeCall(common.internalCallback, builder::forEnsemble);
     }

http://git-wip-us.apache.org/repos/asf/curator/blob/ee4031de/curator-x-async/src/main/java/org/apache/curator/x/async/details/AsyncGetDataBuilderImpl.java
----------------------------------------------------------------------
diff --git a/curator-x-async/src/main/java/org/apache/curator/x/async/details/AsyncGetDataBuilderImpl.java b/curator-x-async/src/main/java/org/apache/curator/x/async/details/AsyncGetDataBuilderImpl.java
index ac9df4c..deca49a 100644
--- a/curator-x-async/src/main/java/org/apache/curator/x/async/details/AsyncGetDataBuilderImpl.java
+++ b/curator-x-async/src/main/java/org/apache/curator/x/async/details/AsyncGetDataBuilderImpl.java
@@ -18,13 +18,12 @@
  */
 package org.apache.curator.x.async.details;
 
-import org.apache.curator.framework.api.UnhandledErrorListener;
 import org.apache.curator.framework.imps.CuratorFrameworkImpl;
 import org.apache.curator.framework.imps.GetDataBuilderImpl;
+import org.apache.curator.x.async.AsyncStage;
 import org.apache.curator.x.async.WatchMode;
 import org.apache.curator.x.async.api.AsyncGetDataBuilder;
 import org.apache.curator.x.async.api.AsyncPathable;
-import org.apache.curator.x.async.AsyncStage;
 import org.apache.zookeeper.data.Stat;
 
 import static org.apache.curator.x.async.details.BackgroundProcs.dataProc;
@@ -33,15 +32,15 @@ import static org.apache.curator.x.async.details.BackgroundProcs.safeCall;
 class AsyncGetDataBuilderImpl implements AsyncGetDataBuilder
 {
     private final CuratorFrameworkImpl client;
-    private final UnhandledErrorListener unhandledErrorListener;
+    private final Filters filters;
     private final WatchMode watchMode;
     private boolean decompressed = false;
     private Stat stat = null;
 
-    AsyncGetDataBuilderImpl(CuratorFrameworkImpl client, UnhandledErrorListener unhandledErrorListener, WatchMode watchMode)
+    AsyncGetDataBuilderImpl(CuratorFrameworkImpl client, Filters filters, WatchMode watchMode)
     {
         this.client = client;
-        this.unhandledErrorListener = unhandledErrorListener;
+        this.filters = filters;
         this.watchMode = watchMode;
     }
 
@@ -70,7 +69,7 @@ class AsyncGetDataBuilderImpl implements AsyncGetDataBuilder
     @Override
     public AsyncStage<byte[]> forPath(String path)
     {
-        BuilderCommon<byte[]> common = new BuilderCommon<>(unhandledErrorListener, watchMode, dataProc);
+        BuilderCommon<byte[]> common = new BuilderCommon<>(filters, watchMode, dataProc);
         GetDataBuilderImpl builder = new GetDataBuilderImpl(client, stat, common.watcher, common.backgrounding, decompressed);
         return safeCall(common.internalCallback, () -> builder.forPath(path));
     }

http://git-wip-us.apache.org/repos/asf/curator/blob/ee4031de/curator-x-async/src/main/java/org/apache/curator/x/async/details/AsyncReconfigBuilderImpl.java
----------------------------------------------------------------------
diff --git a/curator-x-async/src/main/java/org/apache/curator/x/async/details/AsyncReconfigBuilderImpl.java b/curator-x-async/src/main/java/org/apache/curator/x/async/details/AsyncReconfigBuilderImpl.java
index 32b9eb5..6114159 100644
--- a/curator-x-async/src/main/java/org/apache/curator/x/async/details/AsyncReconfigBuilderImpl.java
+++ b/curator-x-async/src/main/java/org/apache/curator/x/async/details/AsyncReconfigBuilderImpl.java
@@ -18,12 +18,11 @@
  */
 package org.apache.curator.x.async.details;
 
-import org.apache.curator.framework.api.UnhandledErrorListener;
 import org.apache.curator.framework.imps.CuratorFrameworkImpl;
 import org.apache.curator.framework.imps.ReconfigBuilderImpl;
+import org.apache.curator.x.async.AsyncStage;
 import org.apache.curator.x.async.api.AsyncEnsemblable;
 import org.apache.curator.x.async.api.AsyncReconfigBuilder;
-import org.apache.curator.x.async.AsyncStage;
 import org.apache.zookeeper.data.Stat;
 import java.util.List;
 
@@ -33,17 +32,17 @@ import static org.apache.curator.x.async.details.BackgroundProcs.safeCall;
 class AsyncReconfigBuilderImpl implements AsyncReconfigBuilder, AsyncEnsemblable<AsyncStage<Void>>
 {
     private final CuratorFrameworkImpl client;
-    private final UnhandledErrorListener unhandledErrorListener;
+    private final Filters filters;
     private Stat stat = null;
     private long fromConfig = -1;
     private List<String> newMembers = null;
     private List<String> joining = null;
     private List<String> leaving = null;
 
-    AsyncReconfigBuilderImpl(CuratorFrameworkImpl client, UnhandledErrorListener unhandledErrorListener)
+    AsyncReconfigBuilderImpl(CuratorFrameworkImpl client, Filters filters)
     {
         this.client = client;
-        this.unhandledErrorListener = unhandledErrorListener;
+        this.filters = filters;
     }
 
     @Override
@@ -116,7 +115,7 @@ class AsyncReconfigBuilderImpl implements AsyncReconfigBuilder, AsyncEnsemblable
     @Override
     public AsyncStage<Void> forEnsemble()
     {
-        BuilderCommon<Void> common = new BuilderCommon<>(unhandledErrorListener, ignoredProc);
+        BuilderCommon<Void> common = new BuilderCommon<>(filters, ignoredProc);
         ReconfigBuilderImpl builder = new ReconfigBuilderImpl(client, common.backgrounding, stat, fromConfig, newMembers, joining, leaving);
         return safeCall(common.internalCallback, () -> {
             builder.forEnsemble();

http://git-wip-us.apache.org/repos/asf/curator/blob/ee4031de/curator-x-async/src/main/java/org/apache/curator/x/async/details/AsyncRemoveWatchesBuilderImpl.java
----------------------------------------------------------------------
diff --git a/curator-x-async/src/main/java/org/apache/curator/x/async/details/AsyncRemoveWatchesBuilderImpl.java b/curator-x-async/src/main/java/org/apache/curator/x/async/details/AsyncRemoveWatchesBuilderImpl.java
index 98a8bbb..1f3ad79 100644
--- a/curator-x-async/src/main/java/org/apache/curator/x/async/details/AsyncRemoveWatchesBuilderImpl.java
+++ b/curator-x-async/src/main/java/org/apache/curator/x/async/details/AsyncRemoveWatchesBuilderImpl.java
@@ -19,12 +19,11 @@
 package org.apache.curator.x.async.details;
 
 import org.apache.curator.framework.api.CuratorWatcher;
-import org.apache.curator.framework.api.UnhandledErrorListener;
 import org.apache.curator.framework.imps.CuratorFrameworkImpl;
 import org.apache.curator.framework.imps.RemoveWatchesBuilderImpl;
+import org.apache.curator.x.async.AsyncStage;
 import org.apache.curator.x.async.api.AsyncPathable;
 import org.apache.curator.x.async.api.AsyncRemoveWatchesBuilder;
-import org.apache.curator.x.async.AsyncStage;
 import org.apache.curator.x.async.api.RemoveWatcherOption;
 import org.apache.zookeeper.Watcher;
 import java.util.Collections;
@@ -37,16 +36,16 @@ import static org.apache.curator.x.async.details.BackgroundProcs.safeCall;
 class AsyncRemoveWatchesBuilderImpl implements AsyncRemoveWatchesBuilder, AsyncPathable<AsyncStage<Void>>
 {
     private final CuratorFrameworkImpl client;
-    private final UnhandledErrorListener unhandledErrorListener;
+    private final Filters filters;
     private Watcher.WatcherType watcherType = Watcher.WatcherType.Any;
     private Set<RemoveWatcherOption> options = Collections.emptySet();
     private Watcher watcher = null;
     private CuratorWatcher curatorWatcher = null;
 
-    AsyncRemoveWatchesBuilderImpl(CuratorFrameworkImpl client, UnhandledErrorListener unhandledErrorListener)
+    AsyncRemoveWatchesBuilderImpl(CuratorFrameworkImpl client, Filters filters)
     {
         this.client = client;
-        this.unhandledErrorListener = unhandledErrorListener;
+        this.filters = filters;
     }
 
     @Override
@@ -160,7 +159,7 @@ class AsyncRemoveWatchesBuilderImpl implements AsyncRemoveWatchesBuilder, AsyncP
     @Override
     public AsyncStage<Void> forPath(String path)
     {
-        BuilderCommon<Void> common = new BuilderCommon<>(unhandledErrorListener, ignoredProc);
+        BuilderCommon<Void> common = new BuilderCommon<>(filters, ignoredProc);
         RemoveWatchesBuilderImpl builder = new RemoveWatchesBuilderImpl(client,
             watcher,
             curatorWatcher,

http://git-wip-us.apache.org/repos/asf/curator/blob/ee4031de/curator-x-async/src/main/java/org/apache/curator/x/async/details/AsyncSetACLBuilderImpl.java
----------------------------------------------------------------------
diff --git a/curator-x-async/src/main/java/org/apache/curator/x/async/details/AsyncSetACLBuilderImpl.java b/curator-x-async/src/main/java/org/apache/curator/x/async/details/AsyncSetACLBuilderImpl.java
index 8908de6..e639b9e 100644
--- a/curator-x-async/src/main/java/org/apache/curator/x/async/details/AsyncSetACLBuilderImpl.java
+++ b/curator-x-async/src/main/java/org/apache/curator/x/async/details/AsyncSetACLBuilderImpl.java
@@ -18,12 +18,11 @@
  */
 package org.apache.curator.x.async.details;
 
-import org.apache.curator.framework.api.UnhandledErrorListener;
 import org.apache.curator.framework.imps.CuratorFrameworkImpl;
 import org.apache.curator.framework.imps.SetACLBuilderImpl;
+import org.apache.curator.x.async.AsyncStage;
 import org.apache.curator.x.async.api.AsyncPathable;
 import org.apache.curator.x.async.api.AsyncSetACLBuilder;
-import org.apache.curator.x.async.AsyncStage;
 import org.apache.zookeeper.data.ACL;
 import org.apache.zookeeper.data.Stat;
 import java.util.List;
@@ -34,14 +33,14 @@ import static org.apache.curator.x.async.details.BackgroundProcs.statProc;
 class AsyncSetACLBuilderImpl implements AsyncSetACLBuilder, AsyncPathable<AsyncStage<Stat>>
 {
     private final CuratorFrameworkImpl client;
-    private final UnhandledErrorListener unhandledErrorListener;
+    private final Filters filters;
     private int version = -1;
     private List<ACL> aclList = null;
 
-    AsyncSetACLBuilderImpl(CuratorFrameworkImpl client, UnhandledErrorListener unhandledErrorListener)
+    AsyncSetACLBuilderImpl(CuratorFrameworkImpl client, Filters filters)
     {
         this.client = client;
-        this.unhandledErrorListener = unhandledErrorListener;
+        this.filters = filters;
     }
 
     @Override
@@ -62,7 +61,7 @@ class AsyncSetACLBuilderImpl implements AsyncSetACLBuilder, AsyncPathable<AsyncS
     @Override
     public AsyncStage<Stat> forPath(String path)
     {
-        BuilderCommon<Stat> common = new BuilderCommon<>(unhandledErrorListener, statProc);
+        BuilderCommon<Stat> common = new BuilderCommon<>(filters, statProc);
         SetACLBuilderImpl builder = new SetACLBuilderImpl(client, common.backgrounding, aclList, version);
         return safeCall(common.internalCallback, () -> builder.forPath(path));
     }

http://git-wip-us.apache.org/repos/asf/curator/blob/ee4031de/curator-x-async/src/main/java/org/apache/curator/x/async/details/AsyncSetDataBuilderImpl.java
----------------------------------------------------------------------
diff --git a/curator-x-async/src/main/java/org/apache/curator/x/async/details/AsyncSetDataBuilderImpl.java b/curator-x-async/src/main/java/org/apache/curator/x/async/details/AsyncSetDataBuilderImpl.java
index cf2a56e..750fd59 100644
--- a/curator-x-async/src/main/java/org/apache/curator/x/async/details/AsyncSetDataBuilderImpl.java
+++ b/curator-x-async/src/main/java/org/apache/curator/x/async/details/AsyncSetDataBuilderImpl.java
@@ -18,12 +18,11 @@
  */
 package org.apache.curator.x.async.details;
 
-import org.apache.curator.framework.api.UnhandledErrorListener;
 import org.apache.curator.framework.imps.CuratorFrameworkImpl;
 import org.apache.curator.framework.imps.SetDataBuilderImpl;
+import org.apache.curator.x.async.AsyncStage;
 import org.apache.curator.x.async.api.AsyncPathAndBytesable;
 import org.apache.curator.x.async.api.AsyncSetDataBuilder;
-import org.apache.curator.x.async.AsyncStage;
 import org.apache.zookeeper.data.Stat;
 
 import static org.apache.curator.x.async.details.BackgroundProcs.safeCall;
@@ -32,14 +31,14 @@ import static org.apache.curator.x.async.details.BackgroundProcs.statProc;
 class AsyncSetDataBuilderImpl implements AsyncSetDataBuilder
 {
     private final CuratorFrameworkImpl client;
-    private final UnhandledErrorListener unhandledErrorListener;
+    private final Filters filters;
     private boolean compressed = false;
     private int version = -1;
 
-    AsyncSetDataBuilderImpl(CuratorFrameworkImpl client, UnhandledErrorListener unhandledErrorListener)
+    AsyncSetDataBuilderImpl(CuratorFrameworkImpl client, Filters filters)
     {
         this.client = client;
-        this.unhandledErrorListener = unhandledErrorListener;
+        this.filters = filters;
     }
 
     @Override
@@ -78,7 +77,7 @@ class AsyncSetDataBuilderImpl implements AsyncSetDataBuilder
 
     private AsyncStage<Stat> internalForPath(String path, byte[] data, boolean useData)
     {
-        BuilderCommon<Stat> common = new BuilderCommon<>(unhandledErrorListener, statProc);
+        BuilderCommon<Stat> common = new BuilderCommon<>(filters, statProc);
         SetDataBuilderImpl builder = new SetDataBuilderImpl(client, common.backgrounding, version, compressed);
         return safeCall(common.internalCallback, () -> useData ? builder.forPath(path, data) : builder.forPath(path));
     }

http://git-wip-us.apache.org/repos/asf/curator/blob/ee4031de/curator-x-async/src/main/java/org/apache/curator/x/async/details/BuilderCommon.java
----------------------------------------------------------------------
diff --git a/curator-x-async/src/main/java/org/apache/curator/x/async/details/BuilderCommon.java b/curator-x-async/src/main/java/org/apache/curator/x/async/details/BuilderCommon.java
index 043b5b4..82cd244 100644
--- a/curator-x-async/src/main/java/org/apache/curator/x/async/details/BuilderCommon.java
+++ b/curator-x-async/src/main/java/org/apache/curator/x/async/details/BuilderCommon.java
@@ -18,7 +18,6 @@
  */
 package org.apache.curator.x.async.details;
 
-import org.apache.curator.framework.api.UnhandledErrorListener;
 import org.apache.curator.framework.imps.Backgrounding;
 import org.apache.curator.x.async.WatchMode;
 
@@ -28,15 +27,15 @@ class BuilderCommon<T>
     final Backgrounding backgrounding;
     final InternalWatcher watcher;
 
-    BuilderCommon(UnhandledErrorListener unhandledErrorListener, BackgroundProc<T> proc)
+    BuilderCommon(Filters filters, BackgroundProc<T> proc)
     {
-        this(unhandledErrorListener, null, proc);
+        this(filters,null, proc);
     }
 
-    BuilderCommon(UnhandledErrorListener unhandledErrorListener, WatchMode watchMode, BackgroundProc<T> proc)
+    BuilderCommon(Filters filters, WatchMode watchMode, BackgroundProc<T> proc)
     {
-        watcher = (watchMode != null) ? new InternalWatcher(watchMode) : null;
-        internalCallback = new InternalCallback<>(proc, watcher);
-        backgrounding = new Backgrounding(internalCallback, unhandledErrorListener);
+        watcher = (watchMode != null) ? new InternalWatcher(watchMode, filters.getWatcherFilter()) : null;
+        internalCallback = new InternalCallback<>(proc, watcher, filters.getResultFilter());
+        backgrounding = new Backgrounding(internalCallback, filters.getListener());
     }
 }

http://git-wip-us.apache.org/repos/asf/curator/blob/ee4031de/curator-x-async/src/main/java/org/apache/curator/x/async/details/Filters.java
----------------------------------------------------------------------
diff --git a/curator-x-async/src/main/java/org/apache/curator/x/async/details/Filters.java b/curator-x-async/src/main/java/org/apache/curator/x/async/details/Filters.java
new file mode 100644
index 0000000..ab46590
--- /dev/null
+++ b/curator-x-async/src/main/java/org/apache/curator/x/async/details/Filters.java
@@ -0,0 +1,53 @@
+/**
+ * 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.curator.x.async.details;
+
+import org.apache.curator.framework.api.CuratorEvent;
+import org.apache.curator.framework.api.UnhandledErrorListener;
+import org.apache.zookeeper.WatchedEvent;
+import java.util.function.UnaryOperator;
+
+public class Filters
+{
+    private final UnhandledErrorListener listener;
+    private final UnaryOperator<CuratorEvent> resultFilter;
+    private final UnaryOperator<WatchedEvent> watcherFilter;
+
+    public Filters(UnhandledErrorListener listener, UnaryOperator<CuratorEvent> resultFilter, UnaryOperator<WatchedEvent> watcherFilter)
+    {
+        this.listener = listener;
+        this.resultFilter = resultFilter;
+        this.watcherFilter = watcherFilter;
+    }
+
+    public UnhandledErrorListener getListener()
+    {
+        return listener;
+    }
+
+    public UnaryOperator<CuratorEvent> getResultFilter()
+    {
+        return resultFilter;
+    }
+
+    public UnaryOperator<WatchedEvent> getWatcherFilter()
+    {
+        return watcherFilter;
+    }
+}

http://git-wip-us.apache.org/repos/asf/curator/blob/ee4031de/curator-x-async/src/main/java/org/apache/curator/x/async/details/InternalCallback.java
----------------------------------------------------------------------
diff --git a/curator-x-async/src/main/java/org/apache/curator/x/async/details/InternalCallback.java b/curator-x-async/src/main/java/org/apache/curator/x/async/details/InternalCallback.java
index 505226f..d25c736 100644
--- a/curator-x-async/src/main/java/org/apache/curator/x/async/details/InternalCallback.java
+++ b/curator-x-async/src/main/java/org/apache/curator/x/async/details/InternalCallback.java
@@ -25,16 +25,19 @@ import org.apache.curator.x.async.AsyncStage;
 import org.apache.zookeeper.WatchedEvent;
 import java.util.concurrent.CompletableFuture;
 import java.util.concurrent.CompletionStage;
+import java.util.function.UnaryOperator;
 
 class InternalCallback<T> extends CompletableFuture<T> implements BackgroundCallback, AsyncStage<T>
 {
     private final BackgroundProc<T> resultFunction;
     private final InternalWatcher watcher;
+    private final UnaryOperator<CuratorEvent> resultFilter;
 
-    InternalCallback(BackgroundProc<T> resultFunction, InternalWatcher watcher)
+    InternalCallback(BackgroundProc<T> resultFunction, InternalWatcher watcher, UnaryOperator<CuratorEvent> resultFilter)
     {
         this.resultFunction = resultFunction;
         this.watcher = watcher;
+        this.resultFilter = resultFilter;
     }
 
     @Override
@@ -46,6 +49,7 @@ class InternalCallback<T> extends CompletableFuture<T> implements BackgroundCall
     @Override
     public void processResult(CuratorFramework client, CuratorEvent event) throws Exception
     {
+        event = (resultFilter != null) ? resultFilter.apply(event) : event;
         resultFunction.apply(event, this);
     }
 }

http://git-wip-us.apache.org/repos/asf/curator/blob/ee4031de/curator-x-async/src/main/java/org/apache/curator/x/async/details/InternalWatcher.java
----------------------------------------------------------------------
diff --git a/curator-x-async/src/main/java/org/apache/curator/x/async/details/InternalWatcher.java b/curator-x-async/src/main/java/org/apache/curator/x/async/details/InternalWatcher.java
index 2c7de9e..7578083 100644
--- a/curator-x-async/src/main/java/org/apache/curator/x/async/details/InternalWatcher.java
+++ b/curator-x-async/src/main/java/org/apache/curator/x/async/details/InternalWatcher.java
@@ -24,15 +24,18 @@ import org.apache.zookeeper.WatchedEvent;
 import org.apache.zookeeper.Watcher;
 import java.util.concurrent.CompletableFuture;
 import java.util.concurrent.CompletionStage;
+import java.util.function.UnaryOperator;
 
 class InternalWatcher implements Watcher
 {
     private final WatchMode watchMode;
+    private final UnaryOperator<WatchedEvent> watcherFilter;
     private volatile CompletableFuture<WatchedEvent> future = new CompletableFuture<>();
 
-    InternalWatcher(WatchMode watchMode)
+    InternalWatcher(WatchMode watchMode, UnaryOperator<WatchedEvent> watcherFilter)
     {
         this.watchMode = watchMode;
+        this.watcherFilter = watcherFilter;
     }
 
     CompletableFuture<WatchedEvent> getFuture()
@@ -43,15 +46,16 @@ class InternalWatcher implements Watcher
     @Override
     public void process(WatchedEvent event)
     {
-        switch ( event.getState() )
+        final WatchedEvent localEvent = (watcherFilter != null) ? watcherFilter.apply(event) : event;
+        switch ( localEvent.getState() )
         {
             default:
             {
-                if ( (watchMode != WatchMode.stateChangeOnly) && (event.getType() != Event.EventType.None) )
+                if ( (watchMode != WatchMode.stateChangeOnly) && (localEvent.getType() != Event.EventType.None) )
                 {
-                    if ( !future.complete(event) )
+                    if ( !future.complete(localEvent) )
                     {
-                        future.obtrudeValue(event);
+                        future.obtrudeValue(localEvent);
                     }
                 }
                 break;
@@ -68,7 +72,7 @@ class InternalWatcher implements Watcher
                         @Override
                         public Event.KeeperState getKeeperState()
                         {
-                            return event.getState();
+                            return localEvent.getState();
                         }
 
                         @Override

http://git-wip-us.apache.org/repos/asf/curator/blob/ee4031de/curator-x-async/src/test/java/org/apache/curator/framework/imps/TestFrameworkBackground.java
----------------------------------------------------------------------
diff --git a/curator-x-async/src/test/java/org/apache/curator/framework/imps/TestFrameworkBackground.java b/curator-x-async/src/test/java/org/apache/curator/framework/imps/TestFrameworkBackground.java
index 52c3faa..c00febd 100644
--- a/curator-x-async/src/test/java/org/apache/curator/framework/imps/TestFrameworkBackground.java
+++ b/curator-x-async/src/test/java/org/apache/curator/framework/imps/TestFrameworkBackground.java
@@ -101,7 +101,7 @@ public class TestFrameworkBackground extends BaseClassForTests
                     errorLatch.countDown();
                 }
             };
-            async.withUnhandledErrorListener(listener).create().forPath("/foo");
+            async.with(listener).create().forPath("/foo");
             Assert.assertTrue(new Timing().awaitLatch(errorLatch));
         }
         finally


[28/50] curator git commit: doc clarification

Posted by dr...@apache.org.
doc clarification


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

Branch: refs/heads/master
Commit: 62f428c0456113628bf714bec756c1e13270b80f
Parents: 24ba3c2
Author: randgalt <ra...@apache.org>
Authored: Mon Jan 23 22:04:17 2017 -0500
Committer: randgalt <ra...@apache.org>
Committed: Mon Jan 23 22:04:17 2017 -0500

----------------------------------------------------------------------
 .../src/main/java/org/apache/curator/x/async/WatchMode.java       | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/curator/blob/62f428c0/curator-x-async/src/main/java/org/apache/curator/x/async/WatchMode.java
----------------------------------------------------------------------
diff --git a/curator-x-async/src/main/java/org/apache/curator/x/async/WatchMode.java b/curator-x-async/src/main/java/org/apache/curator/x/async/WatchMode.java
index dbce8c1..13395e9 100644
--- a/curator-x-async/src/main/java/org/apache/curator/x/async/WatchMode.java
+++ b/curator-x-async/src/main/java/org/apache/curator/x/async/WatchMode.java
@@ -36,7 +36,8 @@ public enum WatchMode
     /**
      * The {@link java.util.concurrent.CompletionStage}&lt;org.apache.zookeeper.WatchedEvent&gt; will
      * complete for both successful trigger and connection exceptions. Connection exceptions are
-     * of type: {@link org.apache.curator.x.async.AsyncEventException}.
+     * of type: {@link org.apache.curator.x.async.AsyncEventException}. Note: this is the default
+     * watch mode.
      */
     stateChangeAndSuccess
 }


[22/50] curator git commit: Added AsyncResult - still needs documentation

Posted by dr...@apache.org.
Added AsyncResult - still needs documentation


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

Branch: refs/heads/master
Commit: 649c441529040401e2f414fbaffd8c6122263e70
Parents: 2ef420c
Author: randgalt <ra...@apache.org>
Authored: Sat Jan 21 11:06:36 2017 -0500
Committer: randgalt <ra...@apache.org>
Committed: Sat Jan 21 11:06:36 2017 -0500

----------------------------------------------------------------------
 .../org/apache/curator/x/async/AsyncResult.java | 118 +++++++++++++++
 .../x/async/details/AsyncResultImpl.java        | 142 +++++++++++++++++++
 .../curator/x/async/TestBasicOperations.java    |  40 +++++-
 3 files changed, 299 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/curator/blob/649c4415/curator-x-async/src/main/java/org/apache/curator/x/async/AsyncResult.java
----------------------------------------------------------------------
diff --git a/curator-x-async/src/main/java/org/apache/curator/x/async/AsyncResult.java b/curator-x-async/src/main/java/org/apache/curator/x/async/AsyncResult.java
new file mode 100644
index 0000000..5c99480
--- /dev/null
+++ b/curator-x-async/src/main/java/org/apache/curator/x/async/AsyncResult.java
@@ -0,0 +1,118 @@
+/**
+ * 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.curator.x.async;
+
+import org.apache.curator.x.async.details.AsyncResultImpl;
+import org.apache.zookeeper.KeeperException;
+import java.util.Optional;
+import java.util.concurrent.CompletionStage;
+
+/**
+ * <p>
+ *     Utility that combines the value, the ZooKeeper result code and the exception in one object
+ *     allowing you to not worry about exceptional completions. i.e. the {@link java.util.concurrent.CompletionStage}
+ *     retured by {@link org.apache.curator.x.async.AsyncResult#of(AsyncStage)} always completes successfully with an
+ *     {@link org.apache.curator.x.async.AsyncResult} object.
+ * </p>
+ *
+ * <p>
+ *     All three possible results from a ZooKeeper method are encapsulated in this object. If the ZooKeeper
+ *     method succeeds, the internal value will be set. If there was a standard ZooKeeper error code
+ *     ({@link org.apache.zookeeper.KeeperException.Code#NODEEXISTS}, etc.), that code is set and the
+ *     value is null. If there was a general exception, that exception is set, the value will be null
+ *     and the code will be {@link org.apache.zookeeper.KeeperException.Code#SYSTEMERROR}.
+ * </p>
+ * @param <T> value type
+ */
+public interface AsyncResult<T>
+{
+    /**
+     * Return a new stage that wraps an async stage into a result-style completion stage. The returned
+     * CompletionStage will always complete successfully.
+     *
+     * @param stage the stage to wrap
+     * @param <T> value type
+     * @return completion stage that resolves to a result
+     */
+    static <T> CompletionStage<AsyncResult<T>> of(AsyncStage<T> stage)
+    {
+        return stage.handle((value, ex) -> {
+            if ( ex != null )
+            {
+                if ( ex instanceof KeeperException )
+                {
+                    return new AsyncResultImpl<T>(((KeeperException)ex).code());
+                }
+                return new AsyncResultImpl<T>(ex);
+            }
+            return new AsyncResultImpl<T>(value);
+        });
+    }
+
+    /**
+     * Returns the raw result of the ZooKeeper method or <code>null</code>
+     *
+     * @return result or <code>null</code>
+     */
+    T getRawValue();
+
+    /**
+     * An optional wrapper around the ZooKeeper method result
+     *
+     * @return wrapped result
+     */
+    Optional<T> getValue();
+
+    /**
+     * Return the ZooKeeper result code. If the method was successful,
+     * {@link org.apache.zookeeper.KeeperException.Code#OK} is returned. If there was a general
+     * exception {@link org.apache.zookeeper.KeeperException.Code#SYSTEMERROR} is returned.
+     *
+     * @return result code
+     */
+    KeeperException.Code getCode();
+
+    /**
+     * Return any general exception or <code>null</code>
+     *
+     * @return exception or <code>null</code>
+     */
+    Throwable getRawException();
+
+    /**
+     * An optional wrapper around any general exception
+     *
+     * @return wrapped exception
+     */
+    Optional<Throwable> getException();
+
+    /**
+     * If there was a general exception (but <strong>not</strong> a {@link org.apache.zookeeper.KeeperException})
+     * a {@link java.lang.RuntimeException} is thrown that wraps the exception. Otherwise, the method returns
+     * without any action being performed.
+     */
+    void checkException();
+
+    /**
+     * If there was a general exception or a {@link org.apache.zookeeper.KeeperException}
+     * a {@link java.lang.RuntimeException} is thrown that wraps the exception. Otherwise, the method returns
+     * without any action being performed.
+     */
+    void checkError();
+}

http://git-wip-us.apache.org/repos/asf/curator/blob/649c4415/curator-x-async/src/main/java/org/apache/curator/x/async/details/AsyncResultImpl.java
----------------------------------------------------------------------
diff --git a/curator-x-async/src/main/java/org/apache/curator/x/async/details/AsyncResultImpl.java b/curator-x-async/src/main/java/org/apache/curator/x/async/details/AsyncResultImpl.java
new file mode 100644
index 0000000..c555b83
--- /dev/null
+++ b/curator-x-async/src/main/java/org/apache/curator/x/async/details/AsyncResultImpl.java
@@ -0,0 +1,142 @@
+/**
+ * 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.curator.x.async.details;
+
+import org.apache.curator.x.async.AsyncResult;
+import org.apache.zookeeper.KeeperException;
+import java.util.Objects;
+import java.util.Optional;
+
+public class AsyncResultImpl<T> implements AsyncResult<T>
+{
+    private final T value;
+    private final KeeperException.Code code;
+    private final Throwable exception;
+
+    public AsyncResultImpl()
+    {
+        this(null, KeeperException.Code.OK, null);
+    }
+
+    public AsyncResultImpl(KeeperException.Code code)
+    {
+        this(null, code, null);
+    }
+
+    public AsyncResultImpl(T value)
+    {
+        this(value, KeeperException.Code.OK, null);
+    }
+
+    public AsyncResultImpl(Throwable exception)
+    {
+        this(null, KeeperException.Code.SYSTEMERROR, exception);
+    }
+
+    private AsyncResultImpl(T value, KeeperException.Code code, Throwable exception)
+    {
+        this.value = value;
+        this.exception = exception;
+        this.code = Objects.requireNonNull(code, "error cannot be null");
+    }
+
+    public T getRawValue()
+    {
+        return value;
+    }
+
+    public Optional<T> getValue()
+    {
+        return Optional.ofNullable(value);
+    }
+
+    public KeeperException.Code getCode()
+    {
+        return code;
+    }
+
+    public Throwable getRawException()
+    {
+        return exception;
+    }
+
+    public Optional<Throwable> getException()
+    {
+        return Optional.ofNullable(exception);
+    }
+
+    public void checkException()
+    {
+        if ( exception != null )
+        {
+            throw new RuntimeException(exception);
+        }
+    }
+
+    @Override
+    public void checkError()
+    {
+        checkException();
+        if ( code != KeeperException.Code.OK )
+        {
+            throw new RuntimeException(KeeperException.create(code));
+        }
+    }
+
+    @Override
+    public boolean equals(Object o)
+    {
+        if ( this == o )
+        {
+            return true;
+        }
+        if ( o == null || getClass() != o.getClass() )
+        {
+            return false;
+        }
+
+        AsyncResultImpl<?> that = (AsyncResultImpl<?>)o;
+
+        if ( value != null ? !value.equals(that.value) : that.value != null )
+        {
+            return false;
+        }
+        //noinspection SimplifiableIfStatement
+        if ( code != that.code )
+        {
+            return false;
+        }
+        return exception != null ? exception.equals(that.exception) : that.exception == null;
+    }
+
+    @Override
+    public int hashCode()
+    {
+        int result = value != null ? value.hashCode() : 0;
+        result = 31 * result + code.hashCode();
+        result = 31 * result + (exception != null ? exception.hashCode() : 0);
+        return result;
+    }
+
+    @Override
+    public String toString()
+    {
+        return "AsyncResult{" + "value=" + value + ", code=" + code + ", exception=" + exception + '}';
+    }
+}

http://git-wip-us.apache.org/repos/asf/curator/blob/649c4415/curator-x-async/src/test/java/org/apache/curator/x/async/TestBasicOperations.java
----------------------------------------------------------------------
diff --git a/curator-x-async/src/test/java/org/apache/curator/x/async/TestBasicOperations.java b/curator-x-async/src/test/java/org/apache/curator/x/async/TestBasicOperations.java
index 34c02aa..1c4f241 100644
--- a/curator-x-async/src/test/java/org/apache/curator/x/async/TestBasicOperations.java
+++ b/curator-x-async/src/test/java/org/apache/curator/x/async/TestBasicOperations.java
@@ -55,7 +55,7 @@ public class TestBasicOperations extends BaseClassForTests
     {
         super.setup();
 
-        CuratorFramework client = CuratorFrameworkFactory.newClient(server.getConnectString(), new RetryOneTime(timing.milliseconds()));
+        CuratorFramework client = CuratorFrameworkFactory.newClient(server.getConnectString(), new RetryOneTime(timing.forSleepingABit().milliseconds()));
         client.start();
         this.client = AsyncCuratorFramework.wrap(client);
     }
@@ -144,6 +144,44 @@ public class TestBasicOperations extends BaseClassForTests
         Assert.assertTrue(timing.awaitLatch(latch));
     }
 
+    @Test
+    public void testResultWrapper() throws Exception
+    {
+        CompletionStage<AsyncResult<String>> resultStage = AsyncResult.of(client.create().forPath("/first"));
+        complete(resultStage, (v, e) -> {
+            Assert.assertNull(e);
+            Assert.assertEquals(v.getRawValue(), "/first");
+            Assert.assertNull(v.getRawException());
+            Assert.assertEquals(v.getCode(), KeeperException.Code.OK);
+        });
+
+        resultStage = AsyncResult.of(client.create().forPath("/foo/bar"));
+        complete(resultStage, (v, e) -> {
+            Assert.assertNull(e);
+            Assert.assertNull(v.getRawValue());
+            Assert.assertNull(v.getRawException());
+            Assert.assertEquals(v.getCode(), KeeperException.Code.NONODE);
+        });
+
+        resultStage = AsyncResult.of(client.create().forPath("illegal path"));
+        complete(resultStage, (v, e) -> {
+            Assert.assertNull(e);
+            Assert.assertNull(v.getRawValue());
+            Assert.assertNotNull(v.getRawException());
+            Assert.assertTrue(v.getRawException() instanceof IllegalArgumentException);
+            Assert.assertEquals(v.getCode(), KeeperException.Code.SYSTEMERROR);
+        });
+
+        server.stop();
+        resultStage = AsyncResult.of(client.create().forPath("/second"));
+        complete(resultStage, (v, e) -> {
+            Assert.assertNull(e);
+            Assert.assertNull(v.getRawValue());
+            Assert.assertNull(v.getRawException());
+            Assert.assertEquals(v.getCode(), KeeperException.Code.CONNECTIONLOSS);
+        });
+    }
+
     private <T, U> void complete(CompletionStage<T> stage)
     {
         complete(stage, (v, e) -> {});