[8/9] curator git commit: Merge branch 'CURATOR-3.0' into CURATOR-248

2015-09-07 Thread randgalt
Merge branch 'CURATOR-3.0' into CURATOR-248


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

Branch: refs/heads/CURATOR-3.0
Commit: 940e845d7e1d73b1e4804b6f37ee1ecddce7b67f
Parents: 49b267d f8814f6
Author: randgalt 
Authored: Sun Sep 6 23:49:43 2015 -0700
Committer: randgalt 
Committed: Sun Sep 6 23:49:43 2015 -0700

--
 .../curator/TestSessionFailRetryLoop.java   |  9 +-
 .../curator/framework/recipes/locks/Locker.java | 83 +++
 .../recipes/nodes/PersistentEphemeralNode.java  | 16 
 .../framework/recipes/cache/TestTreeCache.java  |  1 -
 .../locks/TestInterProcessMutexBase.java| 22 +
 .../nodes/TestPersistentEphemeralNode.java  | 17 ++--
 .../org/apache/curator/test/KillSession.java| 87 
 7 files changed, 151 insertions(+), 84 deletions(-)
--




[9/9] curator git commit: renamed to clarify meaning

2015-09-07 Thread randgalt
renamed to clarify meaning


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

Branch: refs/heads/CURATOR-3.0
Commit: 7aa371e9514e1a8227d1ed93833bd9e6238c60ed
Parents: 940e845
Author: randgalt 
Authored: Sun Sep 6 23:51:26 2015 -0700
Committer: randgalt 
Committed: Sun Sep 6 23:51:26 2015 -0700

--
 .../curator/framework/CuratorFramework.java |  4 ++--
 .../framework/CuratorFrameworkFactory.java  | 18 +-
 .../framework/imps/CuratorFrameworkImpl.java| 12 ++--
 .../state/ConnectionStateErrorPolicy.java   | 20 
 .../curator/framework/state/ErrorPolicy.java| 20 
 .../SessionConnectionStateErrorPolicy.java  | 13 +
 .../framework/state/SessionErrorPolicy.java | 13 -
 .../StandardConnectionStateErrorPolicy.java | 14 ++
 .../framework/state/StandardErrorPolicy.java| 14 --
 .../framework/recipes/leader/LeaderLatch.java   |  4 ++--
 .../leader/LeaderSelectorListenerAdapter.java   |  2 +-
 .../recipes/leader/TestLeaderLatch.java | 10 +-
 .../recipes/leader/TestLeaderSelector.java  |  9 -
 13 files changed, 76 insertions(+), 77 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/curator/blob/7aa371e9/curator-framework/src/main/java/org/apache/curator/framework/CuratorFramework.java
--
diff --git 
a/curator-framework/src/main/java/org/apache/curator/framework/CuratorFramework.java
 
b/curator-framework/src/main/java/org/apache/curator/framework/CuratorFramework.java
index d755d28..3d197a0 100644
--- 
a/curator-framework/src/main/java/org/apache/curator/framework/CuratorFramework.java
+++ 
b/curator-framework/src/main/java/org/apache/curator/framework/CuratorFramework.java
@@ -28,7 +28,7 @@ import 
org.apache.curator.framework.api.transaction.TransactionOp;
 import org.apache.curator.framework.imps.CuratorFrameworkState;
 import org.apache.curator.framework.listen.Listenable;
 import org.apache.curator.framework.state.ConnectionStateListener;
-import org.apache.curator.framework.state.ErrorPolicy;
+import org.apache.curator.framework.state.ConnectionStateErrorPolicy;
 import org.apache.curator.utils.EnsurePath;
 import org.apache.zookeeper.Watcher;
 
@@ -304,5 +304,5 @@ public interface CuratorFramework extends Closeable
  *
  * @return error policy
  */
-public ErrorPolicy getErrorPolicy();
+public ConnectionStateErrorPolicy getConnectionStateErrorPolicy();
 }

http://git-wip-us.apache.org/repos/asf/curator/blob/7aa371e9/curator-framework/src/main/java/org/apache/curator/framework/CuratorFrameworkFactory.java
--
diff --git 
a/curator-framework/src/main/java/org/apache/curator/framework/CuratorFrameworkFactory.java
 
b/curator-framework/src/main/java/org/apache/curator/framework/CuratorFrameworkFactory.java
index 2b01b30..4db6d36 100644
--- 
a/curator-framework/src/main/java/org/apache/curator/framework/CuratorFrameworkFactory.java
+++ 
b/curator-framework/src/main/java/org/apache/curator/framework/CuratorFrameworkFactory.java
@@ -34,8 +34,8 @@ import org.apache.curator.framework.imps.CuratorFrameworkImpl;
 import org.apache.curator.framework.imps.CuratorTempFrameworkImpl;
 import org.apache.curator.framework.imps.DefaultACLProvider;
 import org.apache.curator.framework.imps.GzipCompressionProvider;
-import org.apache.curator.framework.state.ErrorPolicy;
-import org.apache.curator.framework.state.StandardErrorPolicy;
+import org.apache.curator.framework.state.ConnectionStateErrorPolicy;
+import org.apache.curator.framework.state.StandardConnectionStateErrorPolicy;
 import org.apache.curator.framework.state.ConnectionState;
 import org.apache.curator.utils.DefaultZookeeperFactory;
 import org.apache.curator.utils.ZookeeperFactory;
@@ -123,7 +123,7 @@ public class CuratorFrameworkFactory
 private ACLProvider aclProvider = DEFAULT_ACL_PROVIDER;
 private boolean canBeReadOnly = false;
 private boolean useContainerParentsIfAvailable = true;
-private ErrorPolicy errorPolicy = new StandardErrorPolicy();
+private ConnectionStateErrorPolicy connectionStateErrorPolicy = new 
StandardConnectionStateErrorPolicy();
 private ConnectionHandlingPolicy connectionHandlingPolicy = 
Boolean.getBoolean("curator-use-classic-connection-handling") ? new 
ClassicConnectionHandlingPolicy() : new StandardConnectionHandlingPolicy();
 
 /**
@@ -353,15 +353,15 @@ public class CuratorFrameworkFactory
 }
 
 

[4/9] curator git commit: Updated LeaderLatch for error policy

2015-09-07 Thread randgalt
Updated LeaderLatch for error policy


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

Branch: refs/heads/CURATOR-3.0
Commit: 5429a217bb23901aaf2b187bb8c1d760d0a76bcc
Parents: 94dff8a
Author: randgalt 
Authored: Mon Aug 24 17:39:41 2015 -0500
Committer: randgalt 
Committed: Mon Aug 24 17:39:41 2015 -0500

--
 .../framework/recipes/leader/LeaderLatch.java   |  39 +++--
 .../recipes/leader/TestLeaderLatch.java | 162 +++
 2 files changed, 187 insertions(+), 14 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/curator/blob/5429a217/curator-recipes/src/main/java/org/apache/curator/framework/recipes/leader/LeaderLatch.java
--
diff --git 
a/curator-recipes/src/main/java/org/apache/curator/framework/recipes/leader/LeaderLatch.java
 
b/curator-recipes/src/main/java/org/apache/curator/framework/recipes/leader/LeaderLatch.java
index da9b8b2..aa4dd9f 100644
--- 
a/curator-recipes/src/main/java/org/apache/curator/framework/recipes/leader/LeaderLatch.java
+++ 
b/curator-recipes/src/main/java/org/apache/curator/framework/recipes/leader/LeaderLatch.java
@@ -160,20 +160,20 @@ public class LeaderLatch implements Closeable
 Preconditions.checkState(state.compareAndSet(State.LATENT, 
State.STARTED), "Cannot be started more than once");
 
 startTask.set(AfterConnectionEstablished.execute(client, new Runnable()
+{
+@Override
+public void run()
+{
+try
 {
-@Override
-public void run()
-{
-try
-{
-internalStart();
-}
-finally
-{
-startTask.set(null);
-}
-}
-}));
+internalStart();
+}
+finally
+{
+startTask.set(null);
+}
+}
+}));
 }
 
 /**
@@ -604,7 +604,10 @@ public class LeaderLatch implements Closeable
 {
 try
 {
-reset();
+if ( 
client.getErrorPolicy().isErrorState(ConnectionState.SUSPENDED) || 
!hasLeadership.get() )
+{
+reset();
+}
 }
 catch ( Exception e )
 {
@@ -615,6 +618,14 @@ public class LeaderLatch implements Closeable
 }
 
 case SUSPENDED:
+{
+if ( 
client.getErrorPolicy().isErrorState(ConnectionState.SUSPENDED) )
+{
+setLeadership(false);
+}
+break;
+}
+
 case LOST:
 {
 setLeadership(false);

http://git-wip-us.apache.org/repos/asf/curator/blob/5429a217/curator-recipes/src/test/java/org/apache/curator/framework/recipes/leader/TestLeaderLatch.java
--
diff --git 
a/curator-recipes/src/test/java/org/apache/curator/framework/recipes/leader/TestLeaderLatch.java
 
b/curator-recipes/src/test/java/org/apache/curator/framework/recipes/leader/TestLeaderLatch.java
index 3742fb7..bd73e9d 100644
--- 
a/curator-recipes/src/test/java/org/apache/curator/framework/recipes/leader/TestLeaderLatch.java
+++ 
b/curator-recipes/src/test/java/org/apache/curator/framework/recipes/leader/TestLeaderLatch.java
@@ -21,12 +21,15 @@ package org.apache.curator.framework.recipes.leader;
 
 import com.google.common.base.Throwables;
 import com.google.common.collect.Lists;
+import com.google.common.collect.Queues;
 import com.google.common.util.concurrent.ThreadFactoryBuilder;
 import org.apache.curator.framework.CuratorFramework;
 import org.apache.curator.framework.CuratorFrameworkFactory;
 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.framework.state.SessionErrorPolicy;
+import org.apache.curator.framework.state.StandardErrorPolicy;
 import org.apache.curator.retry.RetryNTimes;
 import org.apache.curator.retry.RetryOneTime;
 import org.apache.curator.test.BaseClassForTests;
@@ -37,11 +40,13 @@ import org.testng.Assert;
 import org.testng.annotations.Test;
 import java.util.Collection;
 import java.util.L

[2/9] curator git commit: doc

2015-09-07 Thread randgalt
doc


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

Branch: refs/heads/CURATOR-3.0
Commit: 2e1e92e162ef812a9d076695500f0bda8b15b6c5
Parents: 45df7ba
Author: randgalt 
Authored: Mon Aug 24 12:30:33 2015 -0500
Committer: randgalt 
Committed: Mon Aug 24 12:30:33 2015 -0500

--
 src/site/confluence/errors.confluence | 7 +++
 1 file changed, 7 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/curator/blob/2e1e92e1/src/site/confluence/errors.confluence
--
diff --git a/src/site/confluence/errors.confluence 
b/src/site/confluence/errors.confluence
index 28805e0..c9545ac 100644
--- a/src/site/confluence/errors.confluence
+++ b/src/site/confluence/errors.confluence
@@ -31,5 +31,12 @@ appropriate action. These are the possible state changes:
 {{UnhandledErrorListener}} is called when a background task, etc. catches an 
exception. In general, Curator users shouldn't care
 about these as they are logged. However, you can listen for them if you choose.
 
+h2. Error Policy
+
+Curator has a pluggable error policy. The default policy takes the 
conservative approach of treating connection states SUSPENDED and LOST the same 
way.
+i.e. when a recipe sees the state change to SUSPENDED it will assume that the 
ZooKeeper session is lost and will clean up any watchers, nodes, etc. You can 
choose,
+however, a more aggressive approach by setting the error policy to only treat 
LOST (i.e. true session loss) as an error state. Do this in the 
CuratorFrameworkFactory via:
+{{errorPolicy(new SessionErrorPolicy())}}.
+
 h2. Recipes
 In general, the recipes attempt to deal with errors and connection issues. See 
the doc for each recipe for details on how it deals with errors.



[7/9] curator git commit: refined the tests

2015-09-07 Thread randgalt
refined the tests


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

Branch: refs/heads/CURATOR-3.0
Commit: 49b267d185bddb7d2be073731ebc6a8352ed6efb
Parents: c117b08
Author: randgalt 
Authored: Tue Sep 1 06:32:52 2015 -0700
Committer: randgalt 
Committed: Tue Sep 1 06:32:52 2015 -0700

--
 .../framework/recipes/leader/TestLeaderSelector.java   | 13 +
 1 file changed, 9 insertions(+), 4 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/curator/blob/49b267d1/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 e5b9717..cd76bc1 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
@@ -37,6 +37,7 @@ 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;
 import java.util.concurrent.ArrayBlockingQueue;
@@ -103,8 +104,10 @@ public class TestLeaderSelector extends BaseClassForTests
 
Assert.assertEquals(changes.poll(timing.forWaiting().milliseconds(), 
TimeUnit.MILLISECONDS), ConnectionState.CONNECTED.name());
 
Assert.assertEquals(changes.poll(timing.forWaiting().milliseconds(), 
TimeUnit.MILLISECONDS), "leader");
 server.close();
-
Assert.assertEquals(changes.poll(timing.forWaiting().milliseconds(), 
TimeUnit.MILLISECONDS), ConnectionState.SUSPENDED.name());
-
Assert.assertEquals(changes.poll(timing.forWaiting().milliseconds(), 
TimeUnit.MILLISECONDS), "release");
+List next = Lists.newArrayList();
+next.add(changes.poll(timing.forSessionSleep().milliseconds(), 
TimeUnit.MILLISECONDS));
+next.add(changes.poll(timing.forSessionSleep().milliseconds(), 
TimeUnit.MILLISECONDS));
+
Assert.assertTrue(next.equals(Arrays.asList(ConnectionState.SUSPENDED.name(), 
"release")) || next.equals(Arrays.asList("release", 
ConnectionState.SUSPENDED.name())), next.toString());
 
Assert.assertEquals(changes.poll(timing.forSessionSleep().milliseconds(), 
TimeUnit.MILLISECONDS), ConnectionState.LOST.name());
 
 selector.close();
@@ -130,8 +133,10 @@ public class TestLeaderSelector extends BaseClassForTests
 
Assert.assertEquals(changes.poll(timing.forWaiting().milliseconds(), 
TimeUnit.MILLISECONDS), "leader");
 server.stop();
 
Assert.assertEquals(changes.poll(timing.forWaiting().milliseconds(), 
TimeUnit.MILLISECONDS), ConnectionState.SUSPENDED.name());
-
Assert.assertEquals(changes.poll(timing.forSessionSleep().milliseconds(), 
TimeUnit.MILLISECONDS), ConnectionState.LOST.name());
-
Assert.assertEquals(changes.poll(timing.forWaiting().milliseconds(), 
TimeUnit.MILLISECONDS), "release");
+next = Lists.newArrayList();
+next.add(changes.poll(timing.forSessionSleep().milliseconds(), 
TimeUnit.MILLISECONDS));
+next.add(changes.poll(timing.forSessionSleep().milliseconds(), 
TimeUnit.MILLISECONDS));
+
Assert.assertTrue(next.equals(Arrays.asList(ConnectionState.LOST.name(), 
"release")) || next.equals(Arrays.asList("release", 
ConnectionState.LOST.name())), next.toString());
 }
 finally
 {



[1/9] curator git commit: Initial error policy with two implementations. Also, applied it to LeaderSelector as a test

2015-09-07 Thread randgalt
Repository: curator
Updated Branches:
  refs/heads/CURATOR-3.0 f8814f619 -> 7aa371e95


Initial error policy with two implementations. Also, applied it to 
LeaderSelector as a test


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

Branch: refs/heads/CURATOR-3.0
Commit: 45df7ba71f14a5f9751061a7dff956312bfdd421
Parents: f9af0ce
Author: randgalt 
Authored: Mon Aug 24 12:24:06 2015 -0500
Committer: randgalt 
Committed: Mon Aug 24 12:24:06 2015 -0500

--
 .../curator/framework/CuratorFramework.java |  8 ++
 .../framework/CuratorFrameworkFactory.java  | 20 +
 .../framework/imps/CuratorFrameworkImpl.java| 10 +++
 .../curator/framework/state/ErrorPolicy.java| 18 
 .../framework/state/SessionErrorPolicy.java | 13 +++
 .../framework/state/StandardErrorPolicy.java| 14 +++
 .../leader/LeaderSelectorListenerAdapter.java   |  2 +-
 .../recipes/leader/TestLeaderSelector.java  | 90 
 8 files changed, 174 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/curator/blob/45df7ba7/curator-framework/src/main/java/org/apache/curator/framework/CuratorFramework.java
--
diff --git 
a/curator-framework/src/main/java/org/apache/curator/framework/CuratorFramework.java
 
b/curator-framework/src/main/java/org/apache/curator/framework/CuratorFramework.java
index 58c5bf5..d755d28 100644
--- 
a/curator-framework/src/main/java/org/apache/curator/framework/CuratorFramework.java
+++ 
b/curator-framework/src/main/java/org/apache/curator/framework/CuratorFramework.java
@@ -28,6 +28,7 @@ import 
org.apache.curator.framework.api.transaction.TransactionOp;
 import org.apache.curator.framework.imps.CuratorFrameworkState;
 import org.apache.curator.framework.listen.Listenable;
 import org.apache.curator.framework.state.ConnectionStateListener;
+import org.apache.curator.framework.state.ErrorPolicy;
 import org.apache.curator.utils.EnsurePath;
 import org.apache.zookeeper.Watcher;
 
@@ -297,4 +298,11 @@ public interface CuratorFramework extends Closeable
  * @return facade
  */
 public WatcherRemoveCuratorFramework newWatcherRemoveCuratorFramework();
+
+/**
+ * Return the configured error policy
+ *
+ * @return error policy
+ */
+public ErrorPolicy getErrorPolicy();
 }

http://git-wip-us.apache.org/repos/asf/curator/blob/45df7ba7/curator-framework/src/main/java/org/apache/curator/framework/CuratorFrameworkFactory.java
--
diff --git 
a/curator-framework/src/main/java/org/apache/curator/framework/CuratorFrameworkFactory.java
 
b/curator-framework/src/main/java/org/apache/curator/framework/CuratorFrameworkFactory.java
index dcb2ee6..aa5181d 100644
--- 
a/curator-framework/src/main/java/org/apache/curator/framework/CuratorFrameworkFactory.java
+++ 
b/curator-framework/src/main/java/org/apache/curator/framework/CuratorFrameworkFactory.java
@@ -31,6 +31,8 @@ import org.apache.curator.framework.imps.CuratorFrameworkImpl;
 import org.apache.curator.framework.imps.CuratorTempFrameworkImpl;
 import org.apache.curator.framework.imps.DefaultACLProvider;
 import org.apache.curator.framework.imps.GzipCompressionProvider;
+import org.apache.curator.framework.state.ErrorPolicy;
+import org.apache.curator.framework.state.StandardErrorPolicy;
 import org.apache.curator.utils.DefaultZookeeperFactory;
 import org.apache.curator.utils.ZookeeperFactory;
 import org.apache.zookeeper.CreateMode;
@@ -116,6 +118,7 @@ public class CuratorFrameworkFactory
 private ACLProvider aclProvider = DEFAULT_ACL_PROVIDER;
 private boolean canBeReadOnly = false;
 private boolean useContainerParentsIfAvailable = true;
+private ErrorPolicy errorPolicy = new StandardErrorPolicy();
 
 /**
  * Apply the current values and build a new CuratorFramework
@@ -343,6 +346,18 @@ public class CuratorFrameworkFactory
 return this;
 }
 
+/**
+ * Set the error policy to use. The default is {@link 
StandardErrorPolicy}
+ *
+ * @param errorPolicy new error policy
+ * @return this
+ */
+public Builder errorPolicy(ErrorPolicy errorPolicy)
+{
+this.errorPolicy = errorPolicy;
+return this;
+}
+
 public ACLProvider getAclProvider()
 {
 return aclProvider;
@@ -398,6 +413,11 @@ public class CuratorFrameworkFactory
 return useContainerParentsIfAvailable;
 }
 
+public ErrorPolicy getErrorPolicy()
+{

[3/9] curator git commit: Added since tags

2015-09-07 Thread randgalt
Added since tags


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

Branch: refs/heads/CURATOR-3.0
Commit: 94dff8a5a2ec336a23c05ebe5cdf7e4b117d3925
Parents: 2e1e92e
Author: randgalt 
Authored: Mon Aug 24 12:31:52 2015 -0500
Committer: randgalt 
Committed: Mon Aug 24 12:31:52 2015 -0500

--
 .../java/org/apache/curator/framework/CuratorFrameworkFactory.java | 1 +
 .../main/java/org/apache/curator/framework/state/ErrorPolicy.java  | 2 ++
 2 files changed, 3 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/curator/blob/94dff8a5/curator-framework/src/main/java/org/apache/curator/framework/CuratorFrameworkFactory.java
--
diff --git 
a/curator-framework/src/main/java/org/apache/curator/framework/CuratorFrameworkFactory.java
 
b/curator-framework/src/main/java/org/apache/curator/framework/CuratorFrameworkFactory.java
index aa5181d..9a67684 100644
--- 
a/curator-framework/src/main/java/org/apache/curator/framework/CuratorFrameworkFactory.java
+++ 
b/curator-framework/src/main/java/org/apache/curator/framework/CuratorFrameworkFactory.java
@@ -349,6 +349,7 @@ public class CuratorFrameworkFactory
 /**
  * Set the error policy to use. The default is {@link 
StandardErrorPolicy}
  *
+ * @since 3.0.0
  * @param errorPolicy new error policy
  * @return this
  */

http://git-wip-us.apache.org/repos/asf/curator/blob/94dff8a5/curator-framework/src/main/java/org/apache/curator/framework/state/ErrorPolicy.java
--
diff --git 
a/curator-framework/src/main/java/org/apache/curator/framework/state/ErrorPolicy.java
 
b/curator-framework/src/main/java/org/apache/curator/framework/state/ErrorPolicy.java
index 0e1bfb5..73fc99d 100644
--- 
a/curator-framework/src/main/java/org/apache/curator/framework/state/ErrorPolicy.java
+++ 
b/curator-framework/src/main/java/org/apache/curator/framework/state/ErrorPolicy.java
@@ -3,6 +3,8 @@ package org.apache.curator.framework.state;
 /**
  * Recipes should use the configured error policy to decide how to handle
  * errors such as {@link ConnectionState} changes.
+ *
+ * @since 3.0.0
  */
 public interface ErrorPolicy
 {



[6/9] curator git commit: Merge branch 'CURATOR-3.0' into CURATOR-248

2015-09-07 Thread randgalt
Merge branch 'CURATOR-3.0' into CURATOR-248

Conflicts:

curator-framework/src/main/java/org/apache/curator/framework/CuratorFrameworkFactory.java

curator-framework/src/main/java/org/apache/curator/framework/imps/CuratorFrameworkImpl.java


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

Branch: refs/heads/CURATOR-3.0
Commit: c117b0853b5779829ff732514aedd7d60b696ccc
Parents: d412f23 d57aaeb
Author: randgalt 
Authored: Tue Sep 1 06:27:31 2015 -0700
Committer: randgalt 
Committed: Tue Sep 1 06:27:31 2015 -0700

--
 .../org/apache/curator/ConnectionState.java | 108 ---
 .../apache/curator/CuratorZookeeperClient.java  | 112 +--
 .../java/org/apache/curator/HandleHolder.java   |  19 ++
 .../main/java/org/apache/curator/RetryLoop.java |  18 +-
 .../ClassicConnectionHandlingPolicy.java|  68 +
 .../connection/ConnectionHandlingPolicy.java|  72 +
 .../StandardConnectionHandlingPolicy.java   |  56 
 .../org/apache/curator/retry/RetryForever.java  |  60 
 .../org/apache/curator/utils/DebugUtils.java|  11 +-
 .../java/org/apache/curator/TestEnsurePath.java |   3 +
 .../java/org/apache/curator/TestRetryLoop.java  |  20 ++
 .../framework/CuratorFrameworkFactory.java  |  58 
 ...reateModeStatBackgroundPathAndBytesable.java |  25 ++
 .../api/BackgroundPathableQuietlyable.java  |  18 ++
 .../api/CreateBackgroundModeStatACLable.java|  70 +
 .../curator/framework/api/CreateBuilder.java|   9 +-
 ...ateProtectACLCreateModePathAndBytesable.java |  72 +
 ...rotectACLCreateModeStatPathAndBytesable.java |  25 ++
 .../framework/api/UnhandledErrorListener.java   |   4 +-
 .../imps/ClassicInternalConnectionHandler.java  |  58 
 .../framework/imps/CreateBuilderImpl.java   | 299 ++-
 .../framework/imps/CuratorFrameworkImpl.java|  86 +++---
 .../imps/InternalConnectionHandler.java |  10 +
 .../imps/StandardInternalConnectionHandler.java |  22 ++
 .../framework/state/ConnectionState.java|  27 +-
 .../framework/state/ConnectionStateManager.java |  91 --
 .../framework/imps/TestBlockUntilConnected.java |   1 +
 .../framework/imps/TestCreateReturningStat.java | 199 
 .../imps/TestEnabledSessionExpiredState.java| 179 +++
 .../framework/imps/TestFrameworkEdges.java  |   6 +-
 .../framework/recipes/cache/NodeCache.java  |  41 ++-
 ...estResetConnectionWithBackgroundFailure.java |  19 +-
 .../recipes/leader/TestLeaderLatch.java |  15 +-
 .../recipes/leader/TestLeaderSelector.java  |   5 +-
 .../recipes/leader/TestLeaderSelectorEdges.java |   6 +-
 .../locks/TestInterProcessMutexBase.java|  19 +-
 .../apache/curator/test/BaseClassForTests.java  |  37 ++-
 .../java/org/apache/curator/test/Timing.java|  35 ++-
 curator-x-discovery-server/pom.xml  |   6 +
 curator-x-discovery/pom.xml |   6 +
 .../discovery/details/TestServiceDiscovery.java |   2 +
 curator-x-rpc/pom.xml   |   6 +
 src/site/confluence/errors.confluence   |   6 +-
 src/site/confluence/index.confluence|   7 +
 44 files changed, 1798 insertions(+), 218 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/curator/blob/c117b085/curator-framework/src/main/java/org/apache/curator/framework/CuratorFrameworkFactory.java
--
diff --cc 
curator-framework/src/main/java/org/apache/curator/framework/CuratorFrameworkFactory.java
index 9a67684,daffa13..2b01b30
--- 
a/curator-framework/src/main/java/org/apache/curator/framework/CuratorFrameworkFactory.java
+++ 
b/curator-framework/src/main/java/org/apache/curator/framework/CuratorFrameworkFactory.java
@@@ -31,8 -34,7 +34,9 @@@ import org.apache.curator.framework.imp
  import org.apache.curator.framework.imps.CuratorTempFrameworkImpl;
  import org.apache.curator.framework.imps.DefaultACLProvider;
  import org.apache.curator.framework.imps.GzipCompressionProvider;
 +import org.apache.curator.framework.state.ErrorPolicy;
 +import org.apache.curator.framework.state.StandardErrorPolicy;
+ import org.apache.curator.framework.state.ConnectionState;
  import org.apache.curator.utils.DefaultZookeeperFactory;
  import org.apache.curator.utils.ZookeeperFactory;
  import org.apache.zookeeper.CreateMode;
@@@ -118,7 -121,7 +123,8 @@@ public class CuratorFrameworkFactor
  private ACLProvider aclProvider = DEFAULT_ACL_PROVIDER;
  private boolean canBeReadOnly = false;
  private boolean useContainerParentsIfAvailable = true;
 +private ErrorPolicy er

[5/9] curator git commit: removed import

2015-09-07 Thread randgalt
removed import


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

Branch: refs/heads/CURATOR-3.0
Commit: d412f2320d571d23c8960214482e84a7911bec16
Parents: 5429a21
Author: randgalt 
Authored: Mon Aug 24 22:03:13 2015 -0500
Committer: randgalt 
Committed: Mon Aug 24 22:03:13 2015 -0500

--
 .../apache/curator/framework/recipes/leader/TestLeaderLatch.java| 1 -
 1 file changed, 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/curator/blob/d412f232/curator-recipes/src/test/java/org/apache/curator/framework/recipes/leader/TestLeaderLatch.java
--
diff --git 
a/curator-recipes/src/test/java/org/apache/curator/framework/recipes/leader/TestLeaderLatch.java
 
b/curator-recipes/src/test/java/org/apache/curator/framework/recipes/leader/TestLeaderLatch.java
index bd73e9d..41b53fd 100644
--- 
a/curator-recipes/src/test/java/org/apache/curator/framework/recipes/leader/TestLeaderLatch.java
+++ 
b/curator-recipes/src/test/java/org/apache/curator/framework/recipes/leader/TestLeaderLatch.java
@@ -46,7 +46,6 @@ import java.util.concurrent.CountDownLatch;
 import java.util.concurrent.ExecutorCompletionService;
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
-import java.util.concurrent.Semaphore;
 import java.util.concurrent.TimeUnit;
 import java.util.concurrent.atomic.AtomicBoolean;
 import java.util.concurrent.atomic.AtomicInteger;