[7/8] curator git commit: use maybeWatch
use maybeWatch Project: http://git-wip-us.apache.org/repos/asf/curator/repo Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/7e9628ee Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/7e9628ee Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/7e9628ee Branch: refs/heads/CURATOR-477 Commit: 7e9628ee5ea90d7260ce04e0625d52a68a5d2789 Parents: b7c902a Author: Rama Authored: Tue Sep 25 17:18:05 2018 +0530 Committer: Rama Committed: Tue Sep 25 17:18:05 2018 +0530 -- .../org/apache/curator/framework/recipes/cache/TreeCache.java | 6 +- 1 file changed, 1 insertion(+), 5 deletions(-) -- http://git-wip-us.apache.org/repos/asf/curator/blob/7e9628ee/curator-recipes/src/main/java/org/apache/curator/framework/recipes/cache/TreeCache.java -- diff --git 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 index e6119f5..f42c1d5 100644 --- 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 @@ -347,11 +347,7 @@ public class TreeCache implements Closeable if ( parent == null ) { // Root node; use an exist query to watch for existence. -if (disableZkWatches) { -client.checkExists().forPath(path); -} else { - client.checkExists().usingWatcher(this).inBackground(this).forPath(path); -} +maybeWatch(client.checkExists()).forPath(path); } else {
[2/8] curator git commit: address review feedback
address review feedback Project: http://git-wip-us.apache.org/repos/asf/curator/repo Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/88df79b4 Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/88df79b4 Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/88df79b4 Branch: refs/heads/master Commit: 88df79b474c252ddb97096c6e967daa38a02b545 Parents: d4a0d95 Author: Rama Authored: Sun Sep 23 13:28:23 2018 +0530 Committer: Rama Committed: Sun Sep 23 13:28:23 2018 +0530 -- .../framework/recipes/cache/TreeCache.java | 90 +++- .../framework/recipes/cache/TestTreeCache.java | 2 +- 2 files changed, 51 insertions(+), 41 deletions(-) -- http://git-wip-us.apache.org/repos/asf/curator/blob/88df79b4/curator-recipes/src/main/java/org/apache/curator/framework/recipes/cache/TreeCache.java -- diff --git 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 index 7bcc8d1..7c68868 100644 --- 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 @@ -19,15 +19,35 @@ package org.apache.curator.framework.recipes.cache; +import static com.google.common.base.Preconditions.checkNotNull; +import static org.apache.curator.utils.PathUtils.validatePath; + import com.google.common.annotations.VisibleForTesting; import com.google.common.base.Function; import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableMap; import com.google.common.collect.Maps; +import java.io.Closeable; +import java.util.ArrayList; +import java.util.Collections; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; +import java.util.concurrent.ConcurrentMap; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; +import java.util.concurrent.ThreadFactory; +import java.util.concurrent.atomic.AtomicBoolean; +import java.util.concurrent.atomic.AtomicLong; +import java.util.concurrent.atomic.AtomicReference; +import java.util.concurrent.atomic.AtomicReferenceFieldUpdater; import org.apache.curator.framework.CuratorFramework; import org.apache.curator.framework.WatcherRemoveCuratorFramework; import org.apache.curator.framework.api.BackgroundCallback; import org.apache.curator.framework.api.CuratorEvent; +import org.apache.curator.framework.api.ErrorListenerPathable; +import org.apache.curator.framework.api.GetDataBuilder; +import org.apache.curator.framework.api.GetDataWatchBackgroundStatable; import org.apache.curator.framework.api.UnhandledErrorListener; import org.apache.curator.framework.listen.Listenable; import org.apache.curator.framework.listen.ListenerContainer; @@ -42,23 +62,6 @@ import org.apache.zookeeper.Watcher; import org.apache.zookeeper.data.Stat; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import java.io.Closeable; -import java.util.ArrayList; -import java.util.Collections; -import java.util.LinkedList; -import java.util.List; -import java.util.Map; -import java.util.concurrent.ConcurrentMap; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.Executors; -import java.util.concurrent.ThreadFactory; -import java.util.concurrent.atomic.AtomicBoolean; -import java.util.concurrent.atomic.AtomicLong; -import java.util.concurrent.atomic.AtomicReference; -import java.util.concurrent.atomic.AtomicReferenceFieldUpdater; - -import static com.google.common.base.Preconditions.checkNotNull; -import static org.apache.curator.utils.PathUtils.validatePath; /** * A utility that attempts to keep all data from all children of a ZK path locally cached. This class @@ -73,7 +76,7 @@ public class TreeCache implements Closeable { private static final Logger LOG = LoggerFactory.getLogger(TreeCache.class); private final boolean createParentNodes; -private final boolean createZkWatches; +private final boolean disableZkWatches; private final TreeCacheSelector selector; public static final class Builder @@ -85,7 +88,7 @@ public class TreeCache implements Closeable private ExecutorService executorService = null; private int maxDepth = Integer.MAX_VALUE; private boolean createParentNodes = false; -private boolean createZkWatches = true; +private boolean disableZkWatches = false; private TreeCacheSelector selector = new DefaultTreeCacheSelector(); private Builder(CuratorFramework client, String path) @@ -104,7 +107,7 @@ public class TreeCache implements Closeable { executor =
[1/8] curator git commit: added support for zkwatches
Repository: curator Updated Branches: refs/heads/CURATOR-477 [created] 2d4aa5778 added support for zkwatches Project: http://git-wip-us.apache.org/repos/asf/curator/repo Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/d4a0d954 Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/d4a0d954 Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/d4a0d954 Branch: refs/heads/CURATOR-477 Commit: d4a0d95488345bfb0983553bfbfbc40643ac031b Parents: 8950151 Author: Rama Authored: Mon Aug 20 12:16:12 2018 +0530 Committer: Rama Committed: Mon Aug 20 12:16:12 2018 +0530 -- .../framework/recipes/cache/TreeCache.java | 41 +--- .../framework/recipes/cache/TestTreeCache.java | 25 2 files changed, 60 insertions(+), 6 deletions(-) -- http://git-wip-us.apache.org/repos/asf/curator/blob/d4a0d954/curator-recipes/src/main/java/org/apache/curator/framework/recipes/cache/TreeCache.java -- diff --git 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 index 7f8aad7..7bcc8d1 100644 --- 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 @@ -73,6 +73,7 @@ public class TreeCache implements Closeable { private static final Logger LOG = LoggerFactory.getLogger(TreeCache.class); private final boolean createParentNodes; +private final boolean createZkWatches; private final TreeCacheSelector selector; public static final class Builder @@ -84,6 +85,7 @@ public class TreeCache implements Closeable private ExecutorService executorService = null; private int maxDepth = Integer.MAX_VALUE; private boolean createParentNodes = false; +private boolean createZkWatches = true; private TreeCacheSelector selector = new DefaultTreeCacheSelector(); private Builder(CuratorFramework client, String path) @@ -102,7 +104,7 @@ public class TreeCache implements Closeable { executor = Executors.newSingleThreadExecutor(defaultThreadFactory); } -return new TreeCache(client, path, cacheData, dataIsCompressed, maxDepth, executor, createParentNodes, selector); +return new TreeCache(client, path, cacheData, dataIsCompressed, maxDepth, executor, createParentNodes, createZkWatches, selector); } /** @@ -166,6 +168,18 @@ public class TreeCache implements Closeable } /** + * By default, TreeCache creates {@link org.apache.zookeeper.ZooKeeper} watches for every created path. + * Change this behavior with this method. + * @param createZkWatches true to create watches + * @return this for chaining + */ +public Builder setCreateZkWatches(boolean createZkWatches) +{ +this.createZkWatches = createZkWatches; +return this; +} + +/** * By default, {@link DefaultTreeCacheSelector} is used. Change the selector here. * * @param selector new selector @@ -253,7 +267,11 @@ public class TreeCache implements Closeable { if ( treeState.get() == TreeState.STARTED ) { - client.getChildren().usingWatcher(this).inBackground(this).forPath(path); +if (createZkWatches) { + client.getChildren().usingWatcher(this).inBackground(this).forPath(path); +} else { +client.getChildren().inBackground(this).forPath(path); +} } } @@ -263,11 +281,20 @@ public class TreeCache implements Closeable { if ( dataIsCompressed ) { - client.getData().decompressed().usingWatcher(this).inBackground(this).forPath(path); +if (createZkWatches) { + client.getData().decompressed().usingWatcher(this).inBackground(this).forPath(path); +} else { + client.getData().decompressed().inBackground(this).forPath(path); +} } else { - client.getData().usingWatcher(this).inBackground(this).forPath(path); + if (createZkWatches) { + client.getData().usingWatcher(this).inBackground(this).forPath(path); + } else { + client.getData().inBackground(this).forPath(path); + + } }
[5/8] curator git commit: reorder imports
reorder imports Project: http://git-wip-us.apache.org/repos/asf/curator/repo Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/7680e15c Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/7680e15c Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/7680e15c Branch: refs/heads/CURATOR-477 Commit: 7680e15ca191f4d09d7475b1e3d3e3a857a80b91 Parents: 53c4770 Author: Rama Authored: Mon Sep 24 13:19:40 2018 +0530 Committer: Rama Committed: Mon Sep 24 13:19:40 2018 +0530 -- .../framework/recipes/cache/TreeCache.java | 34 ++-- 1 file changed, 17 insertions(+), 17 deletions(-) -- http://git-wip-us.apache.org/repos/asf/curator/blob/7680e15c/curator-recipes/src/main/java/org/apache/curator/framework/recipes/cache/TreeCache.java -- diff --git 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 index b6911f3..dc2afc5 100644 --- 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 @@ -19,28 +19,11 @@ package org.apache.curator.framework.recipes.cache; -import static com.google.common.base.Preconditions.checkNotNull; -import static org.apache.curator.utils.PathUtils.validatePath; - import com.google.common.annotations.VisibleForTesting; import com.google.common.base.Function; import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableMap; import com.google.common.collect.Maps; -import java.io.Closeable; -import java.util.ArrayList; -import java.util.Collections; -import java.util.LinkedList; -import java.util.List; -import java.util.Map; -import java.util.concurrent.ConcurrentMap; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.Executors; -import java.util.concurrent.ThreadFactory; -import java.util.concurrent.atomic.AtomicBoolean; -import java.util.concurrent.atomic.AtomicLong; -import java.util.concurrent.atomic.AtomicReference; -import java.util.concurrent.atomic.AtomicReferenceFieldUpdater; import org.apache.curator.framework.CuratorFramework; import org.apache.curator.framework.WatcherRemoveCuratorFramework; import org.apache.curator.framework.api.BackgroundCallback; @@ -62,6 +45,23 @@ import org.apache.zookeeper.Watcher; import org.apache.zookeeper.data.Stat; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.io.Closeable; +import java.util.ArrayList; +import java.util.Collections; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; +import java.util.concurrent.ConcurrentMap; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; +import java.util.concurrent.ThreadFactory; +import java.util.concurrent.atomic.AtomicBoolean; +import java.util.concurrent.atomic.AtomicLong; +import java.util.concurrent.atomic.AtomicReference; +import java.util.concurrent.atomic.AtomicReferenceFieldUpdater; + +import static com.google.common.base.Preconditions.checkNotNull; +import static org.apache.curator.utils.PathUtils.validatePath; /** * A utility that attempts to keep all data from all children of a ZK path locally cached. This class
[7/8] curator git commit: use maybeWatch
use maybeWatch Project: http://git-wip-us.apache.org/repos/asf/curator/repo Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/7e9628ee Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/7e9628ee Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/7e9628ee Branch: refs/heads/master Commit: 7e9628ee5ea90d7260ce04e0625d52a68a5d2789 Parents: b7c902a Author: Rama Authored: Tue Sep 25 17:18:05 2018 +0530 Committer: Rama Committed: Tue Sep 25 17:18:05 2018 +0530 -- .../org/apache/curator/framework/recipes/cache/TreeCache.java | 6 +- 1 file changed, 1 insertion(+), 5 deletions(-) -- http://git-wip-us.apache.org/repos/asf/curator/blob/7e9628ee/curator-recipes/src/main/java/org/apache/curator/framework/recipes/cache/TreeCache.java -- diff --git 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 index e6119f5..f42c1d5 100644 --- 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 @@ -347,11 +347,7 @@ public class TreeCache implements Closeable if ( parent == null ) { // Root node; use an exist query to watch for existence. -if (disableZkWatches) { -client.checkExists().forPath(path); -} else { - client.checkExists().usingWatcher(this).inBackground(this).forPath(path); -} +maybeWatch(client.checkExists()).forPath(path); } else {
[1/8] curator git commit: added support for zkwatches
Repository: curator Updated Branches: refs/heads/master 5b15f5fab -> 2d4aa5778 added support for zkwatches Project: http://git-wip-us.apache.org/repos/asf/curator/repo Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/d4a0d954 Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/d4a0d954 Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/d4a0d954 Branch: refs/heads/master Commit: d4a0d95488345bfb0983553bfbfbc40643ac031b Parents: 8950151 Author: Rama Authored: Mon Aug 20 12:16:12 2018 +0530 Committer: Rama Committed: Mon Aug 20 12:16:12 2018 +0530 -- .../framework/recipes/cache/TreeCache.java | 41 +--- .../framework/recipes/cache/TestTreeCache.java | 25 2 files changed, 60 insertions(+), 6 deletions(-) -- http://git-wip-us.apache.org/repos/asf/curator/blob/d4a0d954/curator-recipes/src/main/java/org/apache/curator/framework/recipes/cache/TreeCache.java -- diff --git 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 index 7f8aad7..7bcc8d1 100644 --- 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 @@ -73,6 +73,7 @@ public class TreeCache implements Closeable { private static final Logger LOG = LoggerFactory.getLogger(TreeCache.class); private final boolean createParentNodes; +private final boolean createZkWatches; private final TreeCacheSelector selector; public static final class Builder @@ -84,6 +85,7 @@ public class TreeCache implements Closeable private ExecutorService executorService = null; private int maxDepth = Integer.MAX_VALUE; private boolean createParentNodes = false; +private boolean createZkWatches = true; private TreeCacheSelector selector = new DefaultTreeCacheSelector(); private Builder(CuratorFramework client, String path) @@ -102,7 +104,7 @@ public class TreeCache implements Closeable { executor = Executors.newSingleThreadExecutor(defaultThreadFactory); } -return new TreeCache(client, path, cacheData, dataIsCompressed, maxDepth, executor, createParentNodes, selector); +return new TreeCache(client, path, cacheData, dataIsCompressed, maxDepth, executor, createParentNodes, createZkWatches, selector); } /** @@ -166,6 +168,18 @@ public class TreeCache implements Closeable } /** + * By default, TreeCache creates {@link org.apache.zookeeper.ZooKeeper} watches for every created path. + * Change this behavior with this method. + * @param createZkWatches true to create watches + * @return this for chaining + */ +public Builder setCreateZkWatches(boolean createZkWatches) +{ +this.createZkWatches = createZkWatches; +return this; +} + +/** * By default, {@link DefaultTreeCacheSelector} is used. Change the selector here. * * @param selector new selector @@ -253,7 +267,11 @@ public class TreeCache implements Closeable { if ( treeState.get() == TreeState.STARTED ) { - client.getChildren().usingWatcher(this).inBackground(this).forPath(path); +if (createZkWatches) { + client.getChildren().usingWatcher(this).inBackground(this).forPath(path); +} else { +client.getChildren().inBackground(this).forPath(path); +} } } @@ -263,11 +281,20 @@ public class TreeCache implements Closeable { if ( dataIsCompressed ) { - client.getData().decompressed().usingWatcher(this).inBackground(this).forPath(path); +if (createZkWatches) { + client.getData().decompressed().usingWatcher(this).inBackground(this).forPath(path); +} else { + client.getData().decompressed().inBackground(this).forPath(path); +} } else { - client.getData().usingWatcher(this).inBackground(this).forPath(path); + if (createZkWatches) { + client.getData().usingWatcher(this).inBackground(this).forPath(path); + } else { + client.getData().inBackground(this).forPath(path); + + } } }
[8/8] curator git commit: Merge branch 'CURATOR-477' of https://github.com/ramaraochavali/curator into CURATOR-477
Merge branch 'CURATOR-477' of https://github.com/ramaraochavali/curator into CURATOR-477 Project: http://git-wip-us.apache.org/repos/asf/curator/repo Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/2d4aa577 Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/2d4aa577 Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/2d4aa577 Branch: refs/heads/master Commit: 2d4aa5778aaca926e59e3fd3dcec6c46e4fbe1b4 Parents: 5b15f5f 7e9628e Author: Cam McKenzie Authored: Mon Dec 10 14:46:10 2018 +1100 Committer: Cam McKenzie Committed: Mon Dec 10 14:46:10 2018 +1100 -- .../framework/recipes/cache/TreeCache.java | 42 .../framework/recipes/cache/TestTreeCache.java | 25 2 files changed, 60 insertions(+), 7 deletions(-) --
[6/8] curator git commit: added for exists watcher also
added for exists watcher also Project: http://git-wip-us.apache.org/repos/asf/curator/repo Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/b7c902ae Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/b7c902ae Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/b7c902ae Branch: refs/heads/master Commit: b7c902ae01c58806e09316898883406ad5c7edd7 Parents: 7680e15 Author: Rama Authored: Tue Sep 25 13:08:47 2018 +0530 Committer: Rama Committed: Tue Sep 25 13:08:47 2018 +0530 -- .../org/apache/curator/framework/recipes/cache/TreeCache.java | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/curator/blob/b7c902ae/curator-recipes/src/main/java/org/apache/curator/framework/recipes/cache/TreeCache.java -- diff --git 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 index dc2afc5..e6119f5 100644 --- 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 @@ -347,7 +347,11 @@ public class TreeCache implements Closeable if ( parent == null ) { // Root node; use an exist query to watch for existence. - client.checkExists().usingWatcher(this).inBackground(this).forPath(path); +if (disableZkWatches) { +client.checkExists().forPath(path); +} else { + client.checkExists().usingWatcher(this).inBackground(this).forPath(path); +} } else {
[4/8] curator git commit: address review comments
address review comments Project: http://git-wip-us.apache.org/repos/asf/curator/repo Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/53c47706 Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/53c47706 Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/53c47706 Branch: refs/heads/master Commit: 53c47706913cc4e22c4fc229bc8bc95a730077fd Parents: 60e9be8 Author: Rama Authored: Mon Sep 24 13:17:15 2018 +0530 Committer: Rama Committed: Mon Sep 24 13:17:15 2018 +0530 -- .../framework/recipes/cache/TreeCache.java | 23 +--- 1 file changed, 6 insertions(+), 17 deletions(-) -- http://git-wip-us.apache.org/repos/asf/curator/blob/53c47706/curator-recipes/src/main/java/org/apache/curator/framework/recipes/cache/TreeCache.java -- diff --git 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 index 70e0abd..b6911f3 100644 --- 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 @@ -44,11 +44,11 @@ import java.util.concurrent.atomic.AtomicReferenceFieldUpdater; import org.apache.curator.framework.CuratorFramework; import org.apache.curator.framework.WatcherRemoveCuratorFramework; import org.apache.curator.framework.api.BackgroundCallback; +import org.apache.curator.framework.api.BackgroundPathable; import org.apache.curator.framework.api.CuratorEvent; -import org.apache.curator.framework.api.ErrorListenerPathable; -import org.apache.curator.framework.api.GetDataBuilder; -import org.apache.curator.framework.api.GetDataWatchBackgroundStatable; +import org.apache.curator.framework.api.Pathable; import org.apache.curator.framework.api.UnhandledErrorListener; +import org.apache.curator.framework.api.Watchable; import org.apache.curator.framework.listen.Listenable; import org.apache.curator.framework.listen.ListenerContainer; import org.apache.curator.framework.state.ConnectionState; @@ -270,11 +270,7 @@ public class TreeCache implements Closeable { if ( treeState.get() == TreeState.STARTED ) { -if (disableZkWatches) { -client.getChildren().inBackground(this).forPath(path); -} else { - client.getChildren().usingWatcher(this).inBackground(this).forPath(path); -} +maybeWatch(client.getChildren()).forPath(path); } } @@ -293,15 +289,8 @@ public class TreeCache implements Closeable } } -private ErrorListenerPathable maybeWatch(GetDataWatchBackgroundStatable dataBuilder) { -if (disableZkWatches) { -return dataBuilder.inBackground(this); -} else { -return dataBuilder.usingWatcher(this).inBackground(this); -} -} - -private ErrorListenerPathable maybeWatch(GetDataBuilder dataBuilder) { +private > & BackgroundPathable> Pathable maybeWatch( +P dataBuilder) { if (disableZkWatches) { return dataBuilder.inBackground(this); } else {
[3/8] curator git commit: fix test case
fix test case Project: http://git-wip-us.apache.org/repos/asf/curator/repo Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/60e9be8f Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/60e9be8f Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/60e9be8f Branch: refs/heads/master Commit: 60e9be8fce41368f25931c998bb287b3750d41ba Parents: 88df79b Author: Rama Authored: Mon Sep 24 09:56:48 2018 +0530 Committer: Rama Committed: Mon Sep 24 09:56:48 2018 +0530 -- .../org/apache/curator/framework/recipes/cache/TreeCache.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) -- http://git-wip-us.apache.org/repos/asf/curator/blob/60e9be8f/curator-recipes/src/main/java/org/apache/curator/framework/recipes/cache/TreeCache.java -- diff --git 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 index 7c68868..70e0abd 100644 --- 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 @@ -173,7 +173,7 @@ public class TreeCache implements Closeable /** * By default, TreeCache creates {@link org.apache.zookeeper.ZooKeeper} watches for every created path. * Change this behavior with this method. - * @param disableZkWatches false to create watches + * @param disableZkWatches true to disable zk watches * @return this for chaining */ public Builder disableZkWatches(boolean disableZkWatches) @@ -572,7 +572,7 @@ public class TreeCache implements Closeable */ public TreeCache(CuratorFramework client, String path) { -this(client, path, true, false, Integer.MAX_VALUE, Executors.newSingleThreadExecutor(defaultThreadFactory), false, true, new DefaultTreeCacheSelector()); +this(client, path, true, false, Integer.MAX_VALUE, Executors.newSingleThreadExecutor(defaultThreadFactory), false, false, new DefaultTreeCacheSelector()); } /** @@ -582,7 +582,7 @@ public class TreeCache implements Closeable * @param dataIsCompressed if true, data in the path is compressed * @param executorService Closeable ExecutorService to use for the TreeCache's background thread * @param createParentNodes true to create parent nodes as containers - * @param disableZkWatches false to create Zookeeper watches + * @param disableZkWatches true to disable Zookeeper watches * @param selector the selector to use */ TreeCache(CuratorFramework client, String path, boolean cacheData, boolean dataIsCompressed, int maxDepth, final ExecutorService executorService, boolean createParentNodes, boolean disableZkWatches, TreeCacheSelector selector)
[5/8] curator git commit: reorder imports
reorder imports Project: http://git-wip-us.apache.org/repos/asf/curator/repo Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/7680e15c Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/7680e15c Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/7680e15c Branch: refs/heads/master Commit: 7680e15ca191f4d09d7475b1e3d3e3a857a80b91 Parents: 53c4770 Author: Rama Authored: Mon Sep 24 13:19:40 2018 +0530 Committer: Rama Committed: Mon Sep 24 13:19:40 2018 +0530 -- .../framework/recipes/cache/TreeCache.java | 34 ++-- 1 file changed, 17 insertions(+), 17 deletions(-) -- http://git-wip-us.apache.org/repos/asf/curator/blob/7680e15c/curator-recipes/src/main/java/org/apache/curator/framework/recipes/cache/TreeCache.java -- diff --git 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 index b6911f3..dc2afc5 100644 --- 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 @@ -19,28 +19,11 @@ package org.apache.curator.framework.recipes.cache; -import static com.google.common.base.Preconditions.checkNotNull; -import static org.apache.curator.utils.PathUtils.validatePath; - import com.google.common.annotations.VisibleForTesting; import com.google.common.base.Function; import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableMap; import com.google.common.collect.Maps; -import java.io.Closeable; -import java.util.ArrayList; -import java.util.Collections; -import java.util.LinkedList; -import java.util.List; -import java.util.Map; -import java.util.concurrent.ConcurrentMap; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.Executors; -import java.util.concurrent.ThreadFactory; -import java.util.concurrent.atomic.AtomicBoolean; -import java.util.concurrent.atomic.AtomicLong; -import java.util.concurrent.atomic.AtomicReference; -import java.util.concurrent.atomic.AtomicReferenceFieldUpdater; import org.apache.curator.framework.CuratorFramework; import org.apache.curator.framework.WatcherRemoveCuratorFramework; import org.apache.curator.framework.api.BackgroundCallback; @@ -62,6 +45,23 @@ import org.apache.zookeeper.Watcher; import org.apache.zookeeper.data.Stat; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.io.Closeable; +import java.util.ArrayList; +import java.util.Collections; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; +import java.util.concurrent.ConcurrentMap; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; +import java.util.concurrent.ThreadFactory; +import java.util.concurrent.atomic.AtomicBoolean; +import java.util.concurrent.atomic.AtomicLong; +import java.util.concurrent.atomic.AtomicReference; +import java.util.concurrent.atomic.AtomicReferenceFieldUpdater; + +import static com.google.common.base.Preconditions.checkNotNull; +import static org.apache.curator.utils.PathUtils.validatePath; /** * A utility that attempts to keep all data from all children of a ZK path locally cached. This class
[2/8] curator git commit: address review feedback
address review feedback Project: http://git-wip-us.apache.org/repos/asf/curator/repo Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/88df79b4 Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/88df79b4 Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/88df79b4 Branch: refs/heads/CURATOR-477 Commit: 88df79b474c252ddb97096c6e967daa38a02b545 Parents: d4a0d95 Author: Rama Authored: Sun Sep 23 13:28:23 2018 +0530 Committer: Rama Committed: Sun Sep 23 13:28:23 2018 +0530 -- .../framework/recipes/cache/TreeCache.java | 90 +++- .../framework/recipes/cache/TestTreeCache.java | 2 +- 2 files changed, 51 insertions(+), 41 deletions(-) -- http://git-wip-us.apache.org/repos/asf/curator/blob/88df79b4/curator-recipes/src/main/java/org/apache/curator/framework/recipes/cache/TreeCache.java -- diff --git 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 index 7bcc8d1..7c68868 100644 --- 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 @@ -19,15 +19,35 @@ package org.apache.curator.framework.recipes.cache; +import static com.google.common.base.Preconditions.checkNotNull; +import static org.apache.curator.utils.PathUtils.validatePath; + import com.google.common.annotations.VisibleForTesting; import com.google.common.base.Function; import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableMap; import com.google.common.collect.Maps; +import java.io.Closeable; +import java.util.ArrayList; +import java.util.Collections; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; +import java.util.concurrent.ConcurrentMap; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; +import java.util.concurrent.ThreadFactory; +import java.util.concurrent.atomic.AtomicBoolean; +import java.util.concurrent.atomic.AtomicLong; +import java.util.concurrent.atomic.AtomicReference; +import java.util.concurrent.atomic.AtomicReferenceFieldUpdater; import org.apache.curator.framework.CuratorFramework; import org.apache.curator.framework.WatcherRemoveCuratorFramework; import org.apache.curator.framework.api.BackgroundCallback; import org.apache.curator.framework.api.CuratorEvent; +import org.apache.curator.framework.api.ErrorListenerPathable; +import org.apache.curator.framework.api.GetDataBuilder; +import org.apache.curator.framework.api.GetDataWatchBackgroundStatable; import org.apache.curator.framework.api.UnhandledErrorListener; import org.apache.curator.framework.listen.Listenable; import org.apache.curator.framework.listen.ListenerContainer; @@ -42,23 +62,6 @@ import org.apache.zookeeper.Watcher; import org.apache.zookeeper.data.Stat; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import java.io.Closeable; -import java.util.ArrayList; -import java.util.Collections; -import java.util.LinkedList; -import java.util.List; -import java.util.Map; -import java.util.concurrent.ConcurrentMap; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.Executors; -import java.util.concurrent.ThreadFactory; -import java.util.concurrent.atomic.AtomicBoolean; -import java.util.concurrent.atomic.AtomicLong; -import java.util.concurrent.atomic.AtomicReference; -import java.util.concurrent.atomic.AtomicReferenceFieldUpdater; - -import static com.google.common.base.Preconditions.checkNotNull; -import static org.apache.curator.utils.PathUtils.validatePath; /** * A utility that attempts to keep all data from all children of a ZK path locally cached. This class @@ -73,7 +76,7 @@ public class TreeCache implements Closeable { private static final Logger LOG = LoggerFactory.getLogger(TreeCache.class); private final boolean createParentNodes; -private final boolean createZkWatches; +private final boolean disableZkWatches; private final TreeCacheSelector selector; public static final class Builder @@ -85,7 +88,7 @@ public class TreeCache implements Closeable private ExecutorService executorService = null; private int maxDepth = Integer.MAX_VALUE; private boolean createParentNodes = false; -private boolean createZkWatches = true; +private boolean disableZkWatches = false; private TreeCacheSelector selector = new DefaultTreeCacheSelector(); private Builder(CuratorFramework client, String path) @@ -104,7 +107,7 @@ public class TreeCache implements Closeable { executor =
[3/8] curator git commit: fix test case
fix test case Project: http://git-wip-us.apache.org/repos/asf/curator/repo Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/60e9be8f Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/60e9be8f Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/60e9be8f Branch: refs/heads/CURATOR-477 Commit: 60e9be8fce41368f25931c998bb287b3750d41ba Parents: 88df79b Author: Rama Authored: Mon Sep 24 09:56:48 2018 +0530 Committer: Rama Committed: Mon Sep 24 09:56:48 2018 +0530 -- .../org/apache/curator/framework/recipes/cache/TreeCache.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) -- http://git-wip-us.apache.org/repos/asf/curator/blob/60e9be8f/curator-recipes/src/main/java/org/apache/curator/framework/recipes/cache/TreeCache.java -- diff --git 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 index 7c68868..70e0abd 100644 --- 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 @@ -173,7 +173,7 @@ public class TreeCache implements Closeable /** * By default, TreeCache creates {@link org.apache.zookeeper.ZooKeeper} watches for every created path. * Change this behavior with this method. - * @param disableZkWatches false to create watches + * @param disableZkWatches true to disable zk watches * @return this for chaining */ public Builder disableZkWatches(boolean disableZkWatches) @@ -572,7 +572,7 @@ public class TreeCache implements Closeable */ public TreeCache(CuratorFramework client, String path) { -this(client, path, true, false, Integer.MAX_VALUE, Executors.newSingleThreadExecutor(defaultThreadFactory), false, true, new DefaultTreeCacheSelector()); +this(client, path, true, false, Integer.MAX_VALUE, Executors.newSingleThreadExecutor(defaultThreadFactory), false, false, new DefaultTreeCacheSelector()); } /** @@ -582,7 +582,7 @@ public class TreeCache implements Closeable * @param dataIsCompressed if true, data in the path is compressed * @param executorService Closeable ExecutorService to use for the TreeCache's background thread * @param createParentNodes true to create parent nodes as containers - * @param disableZkWatches false to create Zookeeper watches + * @param disableZkWatches true to disable Zookeeper watches * @param selector the selector to use */ TreeCache(CuratorFramework client, String path, boolean cacheData, boolean dataIsCompressed, int maxDepth, final ExecutorService executorService, boolean createParentNodes, boolean disableZkWatches, TreeCacheSelector selector)
[6/8] curator git commit: added for exists watcher also
added for exists watcher also Project: http://git-wip-us.apache.org/repos/asf/curator/repo Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/b7c902ae Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/b7c902ae Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/b7c902ae Branch: refs/heads/CURATOR-477 Commit: b7c902ae01c58806e09316898883406ad5c7edd7 Parents: 7680e15 Author: Rama Authored: Tue Sep 25 13:08:47 2018 +0530 Committer: Rama Committed: Tue Sep 25 13:08:47 2018 +0530 -- .../org/apache/curator/framework/recipes/cache/TreeCache.java | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/curator/blob/b7c902ae/curator-recipes/src/main/java/org/apache/curator/framework/recipes/cache/TreeCache.java -- diff --git 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 index dc2afc5..e6119f5 100644 --- 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 @@ -347,7 +347,11 @@ public class TreeCache implements Closeable if ( parent == null ) { // Root node; use an exist query to watch for existence. - client.checkExists().usingWatcher(this).inBackground(this).forPath(path); +if (disableZkWatches) { +client.checkExists().forPath(path); +} else { + client.checkExists().usingWatcher(this).inBackground(this).forPath(path); +} } else {
[8/8] curator git commit: Merge branch 'CURATOR-477' of https://github.com/ramaraochavali/curator into CURATOR-477
Merge branch 'CURATOR-477' of https://github.com/ramaraochavali/curator into CURATOR-477 Project: http://git-wip-us.apache.org/repos/asf/curator/repo Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/2d4aa577 Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/2d4aa577 Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/2d4aa577 Branch: refs/heads/CURATOR-477 Commit: 2d4aa5778aaca926e59e3fd3dcec6c46e4fbe1b4 Parents: 5b15f5f 7e9628e Author: Cam McKenzie Authored: Mon Dec 10 14:46:10 2018 +1100 Committer: Cam McKenzie Committed: Mon Dec 10 14:46:10 2018 +1100 -- .../framework/recipes/cache/TreeCache.java | 42 .../framework/recipes/cache/TestTreeCache.java | 25 2 files changed, 60 insertions(+), 7 deletions(-) --
[5/6] curator git commit: Merge branch 'CURATOR-487'
Merge branch 'CURATOR-487' Project: http://git-wip-us.apache.org/repos/asf/curator/repo Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/f6868f4d Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/f6868f4d Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/f6868f4d Branch: refs/heads/master Commit: f6868f4dd76d3ba556268a96a295dc61e161b235 Parents: f49a6d1 ec70208 Author: Cam McKenzie Authored: Mon Dec 10 10:55:44 2018 +1100 Committer: Cam McKenzie Committed: Mon Dec 10 10:55:44 2018 +1100 -- .../framework/imps/GzipCompressionProvider.java | 311 +-- .../imps/TestGzipCompressionProvider.java | 125 2 files changed, 414 insertions(+), 22 deletions(-) --
[3/6] curator git commit: Merge branch 'GzipCompressionProvider-references' of https://github.com/leventov/curator into CURATOR-487
Merge branch 'GzipCompressionProvider-references' of https://github.com/leventov/curator into CURATOR-487 Project: http://git-wip-us.apache.org/repos/asf/curator/repo Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/388787c8 Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/388787c8 Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/388787c8 Branch: refs/heads/master Commit: 388787c838cb2e6e0b755b576eb958257e2cef22 Parents: 05f6a56 7467e59 Author: Cam McKenzie Authored: Mon Dec 10 08:23:30 2018 +1100 Committer: Cam McKenzie Committed: Mon Dec 10 08:23:30 2018 +1100 -- .../framework/imps/GzipCompressionProvider.java | 311 +-- .../imps/GzipCompressionProviderTest.java | 125 2 files changed, 414 insertions(+), 22 deletions(-) --
[4/6] curator git commit: CURATOR-487 - Rename unit test
CURATOR-487 - Rename unit test Project: http://git-wip-us.apache.org/repos/asf/curator/repo Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/ec702086 Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/ec702086 Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/ec702086 Branch: refs/heads/master Commit: ec7020861a724446e663156a7939555623fd70dd Parents: 388787c Author: Cam McKenzie Authored: Mon Dec 10 09:43:34 2018 +1100 Committer: Cam McKenzie Committed: Mon Dec 10 09:43:34 2018 +1100 -- .../imps/GzipCompressionProviderTest.java | 125 --- .../imps/TestGzipCompressionProvider.java | 125 +++ 2 files changed, 125 insertions(+), 125 deletions(-) -- http://git-wip-us.apache.org/repos/asf/curator/blob/ec702086/curator-framework/src/test/java/org/apache/curator/framework/imps/GzipCompressionProviderTest.java -- diff --git a/curator-framework/src/test/java/org/apache/curator/framework/imps/GzipCompressionProviderTest.java b/curator-framework/src/test/java/org/apache/curator/framework/imps/GzipCompressionProviderTest.java deleted file mode 100644 index 51edaba..000 --- a/curator-framework/src/test/java/org/apache/curator/framework/imps/GzipCompressionProviderTest.java +++ /dev/null @@ -1,125 +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.framework.imps; - -import org.testng.Assert; -import org.testng.annotations.Test; - -import java.io.ByteArrayOutputStream; -import java.io.IOException; -import java.util.Arrays; -import java.util.concurrent.ThreadLocalRandom; -import java.util.zip.GZIPOutputStream; - -public class GzipCompressionProviderTest -{ -@Test -public void testSimple() throws IOException -{ -GzipCompressionProvider provider = new GzipCompressionProvider(); -byte[] data = "Hello, world!".getBytes(); -byte[] compressedData = provider.compress(null, data); -byte[] jdkCompressedData = jdkCompress(data); -Assert.assertTrue(Arrays.equals(compressedData, jdkCompressedData)); -byte[] decompressedData = provider.decompress(null, compressedData); -Assert.assertTrue(Arrays.equals(decompressedData, data)); -} - -@Test -public void testEmpty() throws IOException -{ -GzipCompressionProvider provider = new GzipCompressionProvider(); -byte[] compressedData = provider.compress(null, new byte[0]); -byte[] compressedData2 = GzipCompressionProvider.doCompress(new byte[0]); -byte[] jdkCompress = jdkCompress(new byte[0]); -// Ensures GzipCompressionProvider.COMPRESSED_EMPTY_BYTES value is valid -Assert.assertTrue(Arrays.equals(compressedData, compressedData2)); -Assert.assertTrue(Arrays.equals(compressedData, jdkCompress)); -byte[] decompressedData = provider.decompress(null, compressedData); -Assert.assertEquals(0, decompressedData.length); -} - -/** - * This test ensures that in the face of corrupt data, specifically IOException is thrown, rather some other kind - * of runtime exception. Users of {@link GzipCompressionProvider#decompress(String, byte[])} may depend on this. - */ -@Test -public void testDecompressCorrupt() -{ -GzipCompressionProvider provider = new GzipCompressionProvider(); -try { -provider.decompress(null, new byte[100]); -Assert.fail("Expected IOException"); -} catch (IOException ignore) { -// expected -} -byte[] compressedData = provider.compress(null, new byte[0]); -for (int i = 0; i < compressedData.length; i++) -{ -try { -provider.decompress(null, Arrays.copyOf(compressedData, i)); -} catch (IOException ignore) { -// expected -} -for (int change = 1; change < 256; change++) -{ -byte b = compressedData[i]; -
[5/7] curator git commit: [maven-release-plugin] prepare release apache-curator-4.0.2
[maven-release-plugin] prepare release apache-curator-4.0.2 Project: http://git-wip-us.apache.org/repos/asf/curator/repo Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/68f03ebd Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/68f03ebd Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/68f03ebd Branch: refs/heads/master Commit: 68f03ebddfb56ec32296f033df547b99829ce007 Parents: 1a94781 Author: randgalt Authored: Sun Dec 9 18:54:40 2018 -0500 Committer: randgalt Committed: Sun Dec 9 18:54:40 2018 -0500 -- curator-client/pom.xml | 4 ++-- curator-examples/pom.xml | 2 +- curator-framework/pom.xml | 4 ++-- curator-recipes/pom.xml| 4 ++-- curator-test-zk34/pom.xml | 2 +- curator-test/pom.xml | 4 ++-- curator-x-async/pom.xml| 2 +- curator-x-discovery-server/pom.xml | 4 ++-- curator-x-discovery/pom.xml| 4 ++-- pom.xml| 4 ++-- 10 files changed, 17 insertions(+), 17 deletions(-) -- http://git-wip-us.apache.org/repos/asf/curator/blob/68f03ebd/curator-client/pom.xml -- diff --git a/curator-client/pom.xml b/curator-client/pom.xml index 604e48c..296b788 100644 --- a/curator-client/pom.xml +++ b/curator-client/pom.xml @@ -23,11 +23,11 @@ org.apache.curator apache-curator -4.0.2-SNAPSHOT +4.0.2 curator-client -4.0.2-SNAPSHOT +4.0.2 bundle Curator Client http://git-wip-us.apache.org/repos/asf/curator/blob/68f03ebd/curator-examples/pom.xml -- diff --git a/curator-examples/pom.xml b/curator-examples/pom.xml index d2992c1..209dd7b 100644 --- a/curator-examples/pom.xml +++ b/curator-examples/pom.xml @@ -24,7 +24,7 @@ org.apache.curator apache-curator -4.0.2-SNAPSHOT +4.0.2 curator-examples http://git-wip-us.apache.org/repos/asf/curator/blob/68f03ebd/curator-framework/pom.xml -- diff --git a/curator-framework/pom.xml b/curator-framework/pom.xml index b26407c..ab4612c 100644 --- a/curator-framework/pom.xml +++ b/curator-framework/pom.xml @@ -24,11 +24,11 @@ org.apache.curator apache-curator -4.0.2-SNAPSHOT +4.0.2 curator-framework -4.0.2-SNAPSHOT +4.0.2 bundle Curator Framework http://git-wip-us.apache.org/repos/asf/curator/blob/68f03ebd/curator-recipes/pom.xml -- diff --git a/curator-recipes/pom.xml b/curator-recipes/pom.xml index 6d6a30e..412faaa 100644 --- a/curator-recipes/pom.xml +++ b/curator-recipes/pom.xml @@ -24,11 +24,11 @@ org.apache.curator apache-curator -4.0.2-SNAPSHOT +4.0.2 curator-recipes -4.0.2-SNAPSHOT +4.0.2 bundle Curator Recipes http://git-wip-us.apache.org/repos/asf/curator/blob/68f03ebd/curator-test-zk34/pom.xml -- diff --git a/curator-test-zk34/pom.xml b/curator-test-zk34/pom.xml index c2c74fa..7e4c166 100644 --- a/curator-test-zk34/pom.xml +++ b/curator-test-zk34/pom.xml @@ -3,7 +3,7 @@ apache-curator org.apache.curator -4.0.2-SNAPSHOT +4.0.2 4.0.0 http://git-wip-us.apache.org/repos/asf/curator/blob/68f03ebd/curator-test/pom.xml -- diff --git a/curator-test/pom.xml b/curator-test/pom.xml index 0dd465c..251e43b 100644 --- a/curator-test/pom.xml +++ b/curator-test/pom.xml @@ -24,11 +24,11 @@ org.apache.curator apache-curator -4.0.2-SNAPSHOT +4.0.2 curator-test -4.0.2-SNAPSHOT +4.0.2 Curator Testing Unit testing utilities. http://git-wip-us.apache.org/repos/asf/curator/blob/68f03ebd/curator-x-async/pom.xml -- diff --git a/curator-x-async/pom.xml b/curator-x-async/pom.xml index 88f30d6..107fc2f 100644 --- a/curator-x-async/pom.xml +++ b/curator-x-async/pom.xml @@ -3,7 +3,7 @@ org.apache.curator apache-curator -4.0.2-SNAPSHOT +4.0.2 4.0.0 http://git-wip-us.apache.org/repos/asf/curator/blob/68f03ebd/curator-x-discovery-server/pom.xml -- diff --git a/curator-x-discovery-server/pom.xml b/curator-x-discovery-server/pom.xml index 96a6302..c19953e 100644 --- a/curator-x-discovery-server/pom.xml +++ b/curator-x-discovery-server/pom.xml @@
[3/7] curator git commit: [maven-release-plugin] prepare for next development iteration
[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/a601cb02 Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/a601cb02 Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/a601cb02 Branch: refs/heads/master Commit: a601cb02bd23625bdb33a1be219e49b9f8d8a50a Parents: 41a9e1e Author: randgalt Authored: Sun Dec 9 18:51:49 2018 -0500 Committer: randgalt Committed: Sun Dec 9 18:51:49 2018 -0500 -- curator-client/pom.xml | 4 ++-- curator-examples/pom.xml | 2 +- curator-framework/pom.xml | 4 ++-- curator-recipes/pom.xml| 4 ++-- curator-test-zk34/pom.xml | 2 +- curator-test/pom.xml | 4 ++-- curator-x-async/pom.xml| 2 +- curator-x-discovery-server/pom.xml | 4 ++-- curator-x-discovery/pom.xml| 4 ++-- pom.xml| 4 ++-- 10 files changed, 17 insertions(+), 17 deletions(-) -- http://git-wip-us.apache.org/repos/asf/curator/blob/a601cb02/curator-client/pom.xml -- diff --git a/curator-client/pom.xml b/curator-client/pom.xml index 296b788..f614f3c 100644 --- a/curator-client/pom.xml +++ b/curator-client/pom.xml @@ -23,11 +23,11 @@ org.apache.curator apache-curator -4.0.2 +4.0.3-SNAPSHOT curator-client -4.0.2 +4.0.3-SNAPSHOT bundle Curator Client http://git-wip-us.apache.org/repos/asf/curator/blob/a601cb02/curator-examples/pom.xml -- diff --git a/curator-examples/pom.xml b/curator-examples/pom.xml index 209dd7b..4359ee9 100644 --- a/curator-examples/pom.xml +++ b/curator-examples/pom.xml @@ -24,7 +24,7 @@ org.apache.curator apache-curator -4.0.2 +4.0.3-SNAPSHOT curator-examples http://git-wip-us.apache.org/repos/asf/curator/blob/a601cb02/curator-framework/pom.xml -- diff --git a/curator-framework/pom.xml b/curator-framework/pom.xml index ab4612c..f2b529c 100644 --- a/curator-framework/pom.xml +++ b/curator-framework/pom.xml @@ -24,11 +24,11 @@ org.apache.curator apache-curator -4.0.2 +4.0.3-SNAPSHOT curator-framework -4.0.2 +4.0.3-SNAPSHOT bundle Curator Framework http://git-wip-us.apache.org/repos/asf/curator/blob/a601cb02/curator-recipes/pom.xml -- diff --git a/curator-recipes/pom.xml b/curator-recipes/pom.xml index 412faaa..fb54ac5 100644 --- a/curator-recipes/pom.xml +++ b/curator-recipes/pom.xml @@ -24,11 +24,11 @@ org.apache.curator apache-curator -4.0.2 +4.0.3-SNAPSHOT curator-recipes -4.0.2 +4.0.3-SNAPSHOT bundle Curator Recipes http://git-wip-us.apache.org/repos/asf/curator/blob/a601cb02/curator-test-zk34/pom.xml -- diff --git a/curator-test-zk34/pom.xml b/curator-test-zk34/pom.xml index 7e4c166..e43ccad 100644 --- a/curator-test-zk34/pom.xml +++ b/curator-test-zk34/pom.xml @@ -3,7 +3,7 @@ apache-curator org.apache.curator -4.0.2 +4.0.3-SNAPSHOT 4.0.0 http://git-wip-us.apache.org/repos/asf/curator/blob/a601cb02/curator-test/pom.xml -- diff --git a/curator-test/pom.xml b/curator-test/pom.xml index 251e43b..6be1e13 100644 --- a/curator-test/pom.xml +++ b/curator-test/pom.xml @@ -24,11 +24,11 @@ org.apache.curator apache-curator -4.0.2 +4.0.3-SNAPSHOT curator-test -4.0.2 +4.0.3-SNAPSHOT Curator Testing Unit testing utilities. http://git-wip-us.apache.org/repos/asf/curator/blob/a601cb02/curator-x-async/pom.xml -- diff --git a/curator-x-async/pom.xml b/curator-x-async/pom.xml index 107fc2f..76a3c0c 100644 --- a/curator-x-async/pom.xml +++ b/curator-x-async/pom.xml @@ -3,7 +3,7 @@ org.apache.curator apache-curator -4.0.2 +4.0.3-SNAPSHOT 4.0.0 http://git-wip-us.apache.org/repos/asf/curator/blob/a601cb02/curator-x-discovery-server/pom.xml -- diff --git a/curator-x-discovery-server/pom.xml b/curator-x-discovery-server/pom.xml index c19953e..62e348a 100644 --- a/curator-x-discovery-server/pom.xml +++ b/curator-x-discovery-server/pom.xml
[4/7] curator git commit: [maven-release-plugin] rollback the release of apache-curator-4.0.2-SNAPSHOT
[maven-release-plugin] rollback the release of apache-curator-4.0.2-SNAPSHOT Project: http://git-wip-us.apache.org/repos/asf/curator/repo Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/1a94781b Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/1a94781b Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/1a94781b Branch: refs/heads/master Commit: 1a94781bf59b8bf59d1f52b810e70ed73e5a796f Parents: a601cb0 Author: randgalt Authored: Sun Dec 9 18:52:59 2018 -0500 Committer: randgalt Committed: Sun Dec 9 18:52:59 2018 -0500 -- curator-client/pom.xml | 4 ++-- curator-examples/pom.xml | 2 +- curator-framework/pom.xml | 4 ++-- curator-recipes/pom.xml| 4 ++-- curator-test-zk34/pom.xml | 2 +- curator-test/pom.xml | 4 ++-- curator-x-async/pom.xml| 2 +- curator-x-discovery-server/pom.xml | 4 ++-- curator-x-discovery/pom.xml| 4 ++-- pom.xml| 2 +- 10 files changed, 16 insertions(+), 16 deletions(-) -- http://git-wip-us.apache.org/repos/asf/curator/blob/1a94781b/curator-client/pom.xml -- diff --git a/curator-client/pom.xml b/curator-client/pom.xml index f614f3c..604e48c 100644 --- a/curator-client/pom.xml +++ b/curator-client/pom.xml @@ -23,11 +23,11 @@ org.apache.curator apache-curator -4.0.3-SNAPSHOT +4.0.2-SNAPSHOT curator-client -4.0.3-SNAPSHOT +4.0.2-SNAPSHOT bundle Curator Client http://git-wip-us.apache.org/repos/asf/curator/blob/1a94781b/curator-examples/pom.xml -- diff --git a/curator-examples/pom.xml b/curator-examples/pom.xml index 4359ee9..d2992c1 100644 --- a/curator-examples/pom.xml +++ b/curator-examples/pom.xml @@ -24,7 +24,7 @@ org.apache.curator apache-curator -4.0.3-SNAPSHOT +4.0.2-SNAPSHOT curator-examples http://git-wip-us.apache.org/repos/asf/curator/blob/1a94781b/curator-framework/pom.xml -- diff --git a/curator-framework/pom.xml b/curator-framework/pom.xml index f2b529c..b26407c 100644 --- a/curator-framework/pom.xml +++ b/curator-framework/pom.xml @@ -24,11 +24,11 @@ org.apache.curator apache-curator -4.0.3-SNAPSHOT +4.0.2-SNAPSHOT curator-framework -4.0.3-SNAPSHOT +4.0.2-SNAPSHOT bundle Curator Framework http://git-wip-us.apache.org/repos/asf/curator/blob/1a94781b/curator-recipes/pom.xml -- diff --git a/curator-recipes/pom.xml b/curator-recipes/pom.xml index fb54ac5..6d6a30e 100644 --- a/curator-recipes/pom.xml +++ b/curator-recipes/pom.xml @@ -24,11 +24,11 @@ org.apache.curator apache-curator -4.0.3-SNAPSHOT +4.0.2-SNAPSHOT curator-recipes -4.0.3-SNAPSHOT +4.0.2-SNAPSHOT bundle Curator Recipes http://git-wip-us.apache.org/repos/asf/curator/blob/1a94781b/curator-test-zk34/pom.xml -- diff --git a/curator-test-zk34/pom.xml b/curator-test-zk34/pom.xml index e43ccad..c2c74fa 100644 --- a/curator-test-zk34/pom.xml +++ b/curator-test-zk34/pom.xml @@ -3,7 +3,7 @@ apache-curator org.apache.curator -4.0.3-SNAPSHOT +4.0.2-SNAPSHOT 4.0.0 http://git-wip-us.apache.org/repos/asf/curator/blob/1a94781b/curator-test/pom.xml -- diff --git a/curator-test/pom.xml b/curator-test/pom.xml index 6be1e13..0dd465c 100644 --- a/curator-test/pom.xml +++ b/curator-test/pom.xml @@ -24,11 +24,11 @@ org.apache.curator apache-curator -4.0.3-SNAPSHOT +4.0.2-SNAPSHOT curator-test -4.0.3-SNAPSHOT +4.0.2-SNAPSHOT Curator Testing Unit testing utilities. http://git-wip-us.apache.org/repos/asf/curator/blob/1a94781b/curator-x-async/pom.xml -- diff --git a/curator-x-async/pom.xml b/curator-x-async/pom.xml index 76a3c0c..88f30d6 100644 --- a/curator-x-async/pom.xml +++ b/curator-x-async/pom.xml @@ -3,7 +3,7 @@ org.apache.curator apache-curator -4.0.3-SNAPSHOT +4.0.2-SNAPSHOT 4.0.0 http://git-wip-us.apache.org/repos/asf/curator/blob/1a94781b/curator-x-discovery-server/pom.xml -- diff --git a/curator-x-discovery-server/pom.xml b/curator-x-discovery-server/pom.xml
[7/7] curator git commit: [maven-release-plugin] rollback the release of apache-curator-4.0.2
[maven-release-plugin] rollback the release of apache-curator-4.0.2 Project: http://git-wip-us.apache.org/repos/asf/curator/repo Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/b1e69a6a Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/b1e69a6a Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/b1e69a6a Branch: refs/heads/master Commit: b1e69a6af820152a0a1c4808fe51d41bb4716b5e Parents: c495c1a Author: randgalt Authored: Sun Dec 9 18:55:21 2018 -0500 Committer: randgalt Committed: Sun Dec 9 18:55:21 2018 -0500 -- curator-client/pom.xml | 4 ++-- curator-examples/pom.xml | 2 +- curator-framework/pom.xml | 4 ++-- curator-recipes/pom.xml| 4 ++-- curator-test-zk34/pom.xml | 2 +- curator-test/pom.xml | 4 ++-- curator-x-async/pom.xml| 2 +- curator-x-discovery-server/pom.xml | 4 ++-- curator-x-discovery/pom.xml| 4 ++-- pom.xml| 2 +- 10 files changed, 16 insertions(+), 16 deletions(-) -- http://git-wip-us.apache.org/repos/asf/curator/blob/b1e69a6a/curator-client/pom.xml -- diff --git a/curator-client/pom.xml b/curator-client/pom.xml index f614f3c..604e48c 100644 --- a/curator-client/pom.xml +++ b/curator-client/pom.xml @@ -23,11 +23,11 @@ org.apache.curator apache-curator -4.0.3-SNAPSHOT +4.0.2-SNAPSHOT curator-client -4.0.3-SNAPSHOT +4.0.2-SNAPSHOT bundle Curator Client http://git-wip-us.apache.org/repos/asf/curator/blob/b1e69a6a/curator-examples/pom.xml -- diff --git a/curator-examples/pom.xml b/curator-examples/pom.xml index 4359ee9..d2992c1 100644 --- a/curator-examples/pom.xml +++ b/curator-examples/pom.xml @@ -24,7 +24,7 @@ org.apache.curator apache-curator -4.0.3-SNAPSHOT +4.0.2-SNAPSHOT curator-examples http://git-wip-us.apache.org/repos/asf/curator/blob/b1e69a6a/curator-framework/pom.xml -- diff --git a/curator-framework/pom.xml b/curator-framework/pom.xml index f2b529c..b26407c 100644 --- a/curator-framework/pom.xml +++ b/curator-framework/pom.xml @@ -24,11 +24,11 @@ org.apache.curator apache-curator -4.0.3-SNAPSHOT +4.0.2-SNAPSHOT curator-framework -4.0.3-SNAPSHOT +4.0.2-SNAPSHOT bundle Curator Framework http://git-wip-us.apache.org/repos/asf/curator/blob/b1e69a6a/curator-recipes/pom.xml -- diff --git a/curator-recipes/pom.xml b/curator-recipes/pom.xml index fb54ac5..6d6a30e 100644 --- a/curator-recipes/pom.xml +++ b/curator-recipes/pom.xml @@ -24,11 +24,11 @@ org.apache.curator apache-curator -4.0.3-SNAPSHOT +4.0.2-SNAPSHOT curator-recipes -4.0.3-SNAPSHOT +4.0.2-SNAPSHOT bundle Curator Recipes http://git-wip-us.apache.org/repos/asf/curator/blob/b1e69a6a/curator-test-zk34/pom.xml -- diff --git a/curator-test-zk34/pom.xml b/curator-test-zk34/pom.xml index e43ccad..c2c74fa 100644 --- a/curator-test-zk34/pom.xml +++ b/curator-test-zk34/pom.xml @@ -3,7 +3,7 @@ apache-curator org.apache.curator -4.0.3-SNAPSHOT +4.0.2-SNAPSHOT 4.0.0 http://git-wip-us.apache.org/repos/asf/curator/blob/b1e69a6a/curator-test/pom.xml -- diff --git a/curator-test/pom.xml b/curator-test/pom.xml index 6be1e13..0dd465c 100644 --- a/curator-test/pom.xml +++ b/curator-test/pom.xml @@ -24,11 +24,11 @@ org.apache.curator apache-curator -4.0.3-SNAPSHOT +4.0.2-SNAPSHOT curator-test -4.0.3-SNAPSHOT +4.0.2-SNAPSHOT Curator Testing Unit testing utilities. http://git-wip-us.apache.org/repos/asf/curator/blob/b1e69a6a/curator-x-async/pom.xml -- diff --git a/curator-x-async/pom.xml b/curator-x-async/pom.xml index 76a3c0c..88f30d6 100644 --- a/curator-x-async/pom.xml +++ b/curator-x-async/pom.xml @@ -3,7 +3,7 @@ org.apache.curator apache-curator -4.0.3-SNAPSHOT +4.0.2-SNAPSHOT 4.0.0 http://git-wip-us.apache.org/repos/asf/curator/blob/b1e69a6a/curator-x-discovery-server/pom.xml -- diff --git a/curator-x-discovery-server/pom.xml b/curator-x-discovery-server/pom.xml index
[6/7] curator git commit: [maven-release-plugin] prepare for next development iteration
[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/c495c1a6 Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/c495c1a6 Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/c495c1a6 Branch: refs/heads/master Commit: c495c1a61b7857b164beafb0c799cbb95bb56fba Parents: 68f03eb Author: randgalt Authored: Sun Dec 9 18:54:51 2018 -0500 Committer: randgalt Committed: Sun Dec 9 18:54:51 2018 -0500 -- curator-client/pom.xml | 4 ++-- curator-examples/pom.xml | 2 +- curator-framework/pom.xml | 4 ++-- curator-recipes/pom.xml| 4 ++-- curator-test-zk34/pom.xml | 2 +- curator-test/pom.xml | 4 ++-- curator-x-async/pom.xml| 2 +- curator-x-discovery-server/pom.xml | 4 ++-- curator-x-discovery/pom.xml| 4 ++-- pom.xml| 4 ++-- 10 files changed, 17 insertions(+), 17 deletions(-) -- http://git-wip-us.apache.org/repos/asf/curator/blob/c495c1a6/curator-client/pom.xml -- diff --git a/curator-client/pom.xml b/curator-client/pom.xml index 296b788..f614f3c 100644 --- a/curator-client/pom.xml +++ b/curator-client/pom.xml @@ -23,11 +23,11 @@ org.apache.curator apache-curator -4.0.2 +4.0.3-SNAPSHOT curator-client -4.0.2 +4.0.3-SNAPSHOT bundle Curator Client http://git-wip-us.apache.org/repos/asf/curator/blob/c495c1a6/curator-examples/pom.xml -- diff --git a/curator-examples/pom.xml b/curator-examples/pom.xml index 209dd7b..4359ee9 100644 --- a/curator-examples/pom.xml +++ b/curator-examples/pom.xml @@ -24,7 +24,7 @@ org.apache.curator apache-curator -4.0.2 +4.0.3-SNAPSHOT curator-examples http://git-wip-us.apache.org/repos/asf/curator/blob/c495c1a6/curator-framework/pom.xml -- diff --git a/curator-framework/pom.xml b/curator-framework/pom.xml index ab4612c..f2b529c 100644 --- a/curator-framework/pom.xml +++ b/curator-framework/pom.xml @@ -24,11 +24,11 @@ org.apache.curator apache-curator -4.0.2 +4.0.3-SNAPSHOT curator-framework -4.0.2 +4.0.3-SNAPSHOT bundle Curator Framework http://git-wip-us.apache.org/repos/asf/curator/blob/c495c1a6/curator-recipes/pom.xml -- diff --git a/curator-recipes/pom.xml b/curator-recipes/pom.xml index 412faaa..fb54ac5 100644 --- a/curator-recipes/pom.xml +++ b/curator-recipes/pom.xml @@ -24,11 +24,11 @@ org.apache.curator apache-curator -4.0.2 +4.0.3-SNAPSHOT curator-recipes -4.0.2 +4.0.3-SNAPSHOT bundle Curator Recipes http://git-wip-us.apache.org/repos/asf/curator/blob/c495c1a6/curator-test-zk34/pom.xml -- diff --git a/curator-test-zk34/pom.xml b/curator-test-zk34/pom.xml index 7e4c166..e43ccad 100644 --- a/curator-test-zk34/pom.xml +++ b/curator-test-zk34/pom.xml @@ -3,7 +3,7 @@ apache-curator org.apache.curator -4.0.2 +4.0.3-SNAPSHOT 4.0.0 http://git-wip-us.apache.org/repos/asf/curator/blob/c495c1a6/curator-test/pom.xml -- diff --git a/curator-test/pom.xml b/curator-test/pom.xml index 251e43b..6be1e13 100644 --- a/curator-test/pom.xml +++ b/curator-test/pom.xml @@ -24,11 +24,11 @@ org.apache.curator apache-curator -4.0.2 +4.0.3-SNAPSHOT curator-test -4.0.2 +4.0.3-SNAPSHOT Curator Testing Unit testing utilities. http://git-wip-us.apache.org/repos/asf/curator/blob/c495c1a6/curator-x-async/pom.xml -- diff --git a/curator-x-async/pom.xml b/curator-x-async/pom.xml index 107fc2f..76a3c0c 100644 --- a/curator-x-async/pom.xml +++ b/curator-x-async/pom.xml @@ -3,7 +3,7 @@ org.apache.curator apache-curator -4.0.2 +4.0.3-SNAPSHOT 4.0.0 http://git-wip-us.apache.org/repos/asf/curator/blob/c495c1a6/curator-x-discovery-server/pom.xml -- diff --git a/curator-x-discovery-server/pom.xml b/curator-x-discovery-server/pom.xml index c19953e..62e348a 100644 --- a/curator-x-discovery-server/pom.xml +++ b/curator-x-discovery-server/pom.xml
[2/7] curator git commit: [maven-release-plugin] prepare release apache-curator-4.0.2-SNAPSHOT
[maven-release-plugin] prepare release apache-curator-4.0.2-SNAPSHOT Project: http://git-wip-us.apache.org/repos/asf/curator/repo Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/41a9e1ee Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/41a9e1ee Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/41a9e1ee Branch: refs/heads/master Commit: 41a9e1ee67bcccfd1f2864cde90881eedc4b2735 Parents: 06f6ccb Author: randgalt Authored: Sun Dec 9 18:51:38 2018 -0500 Committer: randgalt Committed: Sun Dec 9 18:51:38 2018 -0500 -- curator-client/pom.xml | 4 ++-- curator-examples/pom.xml | 2 +- curator-framework/pom.xml | 4 ++-- curator-recipes/pom.xml| 4 ++-- curator-test-zk34/pom.xml | 2 +- curator-test/pom.xml | 4 ++-- curator-x-async/pom.xml| 2 +- curator-x-discovery-server/pom.xml | 4 ++-- curator-x-discovery/pom.xml| 4 ++-- pom.xml| 4 ++-- 10 files changed, 17 insertions(+), 17 deletions(-) -- http://git-wip-us.apache.org/repos/asf/curator/blob/41a9e1ee/curator-client/pom.xml -- diff --git a/curator-client/pom.xml b/curator-client/pom.xml index 604e48c..296b788 100644 --- a/curator-client/pom.xml +++ b/curator-client/pom.xml @@ -23,11 +23,11 @@ org.apache.curator apache-curator -4.0.2-SNAPSHOT +4.0.2 curator-client -4.0.2-SNAPSHOT +4.0.2 bundle Curator Client http://git-wip-us.apache.org/repos/asf/curator/blob/41a9e1ee/curator-examples/pom.xml -- diff --git a/curator-examples/pom.xml b/curator-examples/pom.xml index d2992c1..209dd7b 100644 --- a/curator-examples/pom.xml +++ b/curator-examples/pom.xml @@ -24,7 +24,7 @@ org.apache.curator apache-curator -4.0.2-SNAPSHOT +4.0.2 curator-examples http://git-wip-us.apache.org/repos/asf/curator/blob/41a9e1ee/curator-framework/pom.xml -- diff --git a/curator-framework/pom.xml b/curator-framework/pom.xml index b26407c..ab4612c 100644 --- a/curator-framework/pom.xml +++ b/curator-framework/pom.xml @@ -24,11 +24,11 @@ org.apache.curator apache-curator -4.0.2-SNAPSHOT +4.0.2 curator-framework -4.0.2-SNAPSHOT +4.0.2 bundle Curator Framework http://git-wip-us.apache.org/repos/asf/curator/blob/41a9e1ee/curator-recipes/pom.xml -- diff --git a/curator-recipes/pom.xml b/curator-recipes/pom.xml index 6d6a30e..412faaa 100644 --- a/curator-recipes/pom.xml +++ b/curator-recipes/pom.xml @@ -24,11 +24,11 @@ org.apache.curator apache-curator -4.0.2-SNAPSHOT +4.0.2 curator-recipes -4.0.2-SNAPSHOT +4.0.2 bundle Curator Recipes http://git-wip-us.apache.org/repos/asf/curator/blob/41a9e1ee/curator-test-zk34/pom.xml -- diff --git a/curator-test-zk34/pom.xml b/curator-test-zk34/pom.xml index c2c74fa..7e4c166 100644 --- a/curator-test-zk34/pom.xml +++ b/curator-test-zk34/pom.xml @@ -3,7 +3,7 @@ apache-curator org.apache.curator -4.0.2-SNAPSHOT +4.0.2 4.0.0 http://git-wip-us.apache.org/repos/asf/curator/blob/41a9e1ee/curator-test/pom.xml -- diff --git a/curator-test/pom.xml b/curator-test/pom.xml index 0dd465c..251e43b 100644 --- a/curator-test/pom.xml +++ b/curator-test/pom.xml @@ -24,11 +24,11 @@ org.apache.curator apache-curator -4.0.2-SNAPSHOT +4.0.2 curator-test -4.0.2-SNAPSHOT +4.0.2 Curator Testing Unit testing utilities. http://git-wip-us.apache.org/repos/asf/curator/blob/41a9e1ee/curator-x-async/pom.xml -- diff --git a/curator-x-async/pom.xml b/curator-x-async/pom.xml index 88f30d6..107fc2f 100644 --- a/curator-x-async/pom.xml +++ b/curator-x-async/pom.xml @@ -3,7 +3,7 @@ org.apache.curator apache-curator -4.0.2-SNAPSHOT +4.0.2 4.0.0 http://git-wip-us.apache.org/repos/asf/curator/blob/41a9e1ee/curator-x-discovery-server/pom.xml -- diff --git a/curator-x-discovery-server/pom.xml b/curator-x-discovery-server/pom.xml index 96a6302..c19953e 100644 --- a/curator-x-discovery-server/pom.xml +++
[1/7] curator git commit: CURATOR-461 removed some old settings
Repository: curator Updated Branches: refs/heads/master f49a6d107 -> b1e69a6af CURATOR-461 removed some old settings Project: http://git-wip-us.apache.org/repos/asf/curator/repo Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/06f6ccb5 Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/06f6ccb5 Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/06f6ccb5 Branch: refs/heads/master Commit: 06f6ccb5492e447b25d0c253fad88d41175d149e Parents: f49a6d1 Author: randgalt Authored: Sun Dec 9 18:50:03 2018 -0500 Committer: randgalt Committed: Sun Dec 9 18:50:03 2018 -0500 -- pom.xml | 4 1 file changed, 4 deletions(-) -- http://git-wip-us.apache.org/repos/asf/curator/blob/06f6ccb5/pom.xml -- diff --git a/pom.xml b/pom.xml index f80a9f4..1a69c9c 100644 --- a/pom.xml +++ b/pom.xml @@ -615,9 +615,6 @@ org.apache.maven.plugins maven-install-plugin - -true - @@ -678,7 +675,6 @@ org.apache.maven.plugins maven-javadoc-plugin -true -J-Xmx1g
[1/3] curator git commit: CURATOR-468
Repository: curator Updated Branches: refs/heads/master a17d3af9a -> f49a6d107 CURATOR-468 Adds a test to what #279 had along with a slightly more complete fix. The finally clause of doWork() releases the mutex. In an interrupted situation this would always fail causing the failed delete manager to handle the work resulting in slightly slower deletions and spurious log messaged. This fixes this by clearing the thread interrupted state prior to releasing the mutex and then resetting afterwards if needed. Project: http://git-wip-us.apache.org/repos/asf/curator/repo Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/97e76919 Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/97e76919 Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/97e76919 Branch: refs/heads/master Commit: 97e76919ae0056985aacc786d6c440fb779a6877 Parents: d13a12f Author: randgalt Authored: Thu Dec 6 12:40:43 2018 -0500 Committer: randgalt Committed: Thu Dec 6 12:40:43 2018 -0500 -- .../recipes/leader/LeaderSelector.java | 27 +-- .../recipes/leader/TestLeaderSelector.java | 50 +++- 2 files changed, 71 insertions(+), 6 deletions(-) -- http://git-wip-us.apache.org/repos/asf/curator/blob/97e76919/curator-recipes/src/main/java/org/apache/curator/framework/recipes/leader/LeaderSelector.java -- diff --git a/curator-recipes/src/main/java/org/apache/curator/framework/recipes/leader/LeaderSelector.java b/curator-recipes/src/main/java/org/apache/curator/framework/recipes/leader/LeaderSelector.java index 6ad1053..e505c91 100644 --- a/curator-recipes/src/main/java/org/apache/curator/framework/recipes/leader/LeaderSelector.java +++ b/curator-recipes/src/main/java/org/apache/curator/framework/recipes/leader/LeaderSelector.java @@ -46,6 +46,7 @@ import java.util.concurrent.Future; import java.util.concurrent.ThreadFactory; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicBoolean; +import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicReference; import org.apache.curator.utils.PathUtils; @@ -304,7 +305,7 @@ public class LeaderSelector implements Closeable for ( String path : participantNodes ) { Participant participant = participantForPath(client, path, isLeader); - + if( participant != null ) { builder.add(participant); @@ -340,26 +341,26 @@ public class LeaderSelector implements Closeable static Participant getLeader(CuratorFramework client, Collection participantNodes) throws Exception { Participant result = null; - + if ( participantNodes.size() > 0 ) { Iterator iter = participantNodes.iterator(); while ( iter.hasNext() ) { result = participantForPath(client, iter.next(), true); - + if ( result != null ) { break; } } } - + if( result == null ) { result = new Participant(); } - + return result; } @@ -400,6 +401,9 @@ public class LeaderSelector implements Closeable } @VisibleForTesting +volatile AtomicInteger failedMutexReleaseCount = null; + +@VisibleForTesting void doWork() throws Exception { hasLeadership = false; @@ -444,16 +448,29 @@ public class LeaderSelector implements Closeable if ( hasLeadership ) { hasLeadership = false; +boolean wasInterrupted = Thread.interrupted(); try { mutex.release(); } catch ( Exception e ) { +if ( failedMutexReleaseCount != null ) +{ +failedMutexReleaseCount.incrementAndGet(); +} + ThreadUtils.checkInterrupted(e); log.error("The leader threw an exception", e); // ignore errors - this is just a safety } +finally +{ +if ( wasInterrupted ) +{ +Thread.currentThread().interrupt(); +} +} } } } http://git-wip-us.apache.org/repos/asf/curator/blob/97e76919/curator-recipes/src/test/java/org/apache/curator/framework/recipes/leader/TestLeaderSelector.java -- diff --git
[2/3] curator git commit: Add a comment explaining
Add a comment explaining Project: http://git-wip-us.apache.org/repos/asf/curator/repo Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/ddfcbc1e Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/ddfcbc1e Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/ddfcbc1e Branch: refs/heads/master Commit: ddfcbc1e37fa9e8a9018f2c0d85b7f125efe173c Parents: 97e7691 Author: randgalt Authored: Thu Dec 6 12:43:16 2018 -0500 Committer: randgalt Committed: Thu Dec 6 12:43:16 2018 -0500 -- .../apache/curator/framework/recipes/leader/LeaderSelector.java| 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/curator/blob/ddfcbc1e/curator-recipes/src/main/java/org/apache/curator/framework/recipes/leader/LeaderSelector.java -- diff --git a/curator-recipes/src/main/java/org/apache/curator/framework/recipes/leader/LeaderSelector.java b/curator-recipes/src/main/java/org/apache/curator/framework/recipes/leader/LeaderSelector.java index e505c91..0bb448a 100644 --- a/curator-recipes/src/main/java/org/apache/curator/framework/recipes/leader/LeaderSelector.java +++ b/curator-recipes/src/main/java/org/apache/curator/framework/recipes/leader/LeaderSelector.java @@ -448,7 +448,7 @@ public class LeaderSelector implements Closeable if ( hasLeadership ) { hasLeadership = false; -boolean wasInterrupted = Thread.interrupted(); +boolean wasInterrupted = Thread.interrupted(); // clear any interrupted tatus so that mutex.release() works immediately try { mutex.release();
[3/3] curator git commit: Merge branch 'CURATOR-468'
Merge branch 'CURATOR-468' Project: http://git-wip-us.apache.org/repos/asf/curator/repo Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/f49a6d10 Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/f49a6d10 Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/f49a6d10 Branch: refs/heads/master Commit: f49a6d10748ee9ad8bbc951fa9bea92e4ebbf6a8 Parents: a17d3af ddfcbc1 Author: randgalt Authored: Sun Dec 9 17:59:34 2018 -0500 Committer: randgalt Committed: Sun Dec 9 17:59:34 2018 -0500 -- .../recipes/leader/LeaderSelector.java | 27 +-- .../recipes/leader/TestLeaderSelector.java | 50 +++- 2 files changed, 71 insertions(+), 6 deletions(-) --
[1/6] curator git commit: Merge branch 'CURATOR-491' into CURATOR-490
Repository: curator Updated Branches: refs/heads/master 964f11abb -> a17d3af9a Merge branch 'CURATOR-491' into CURATOR-490 Project: http://git-wip-us.apache.org/repos/asf/curator/repo Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/85161ab3 Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/85161ab3 Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/85161ab3 Branch: refs/heads/master Commit: 85161ab33b36e2f42b00bd4c27d158f8183f2835 Parents: d7774c4 49d08cc Author: randgalt Authored: Sat Dec 8 23:06:31 2018 -0500 Committer: randgalt Committed: Sat Dec 8 23:06:31 2018 -0500 -- .../recipes/cache/PathChildrenCache.java| 29 1 file changed, 23 insertions(+), 6 deletions(-) --
[3/6] curator git commit: Merge branch 'CURATOR-405' into CURATOR-490
Merge branch 'CURATOR-405' into CURATOR-490 Project: http://git-wip-us.apache.org/repos/asf/curator/repo Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/17318342 Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/17318342 Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/17318342 Branch: refs/heads/master Commit: 173183420688875c6e627260ffb4efbbdc48227c Parents: 4c99357 d965266 Author: randgalt Authored: Sun Dec 9 11:13:29 2018 -0500 Committer: randgalt Committed: Sun Dec 9 11:13:29 2018 -0500 -- .../org/apache/curator/framework/state/ConnectionStateManager.java | 1 + 1 file changed, 1 insertion(+) --
[5/6] curator git commit: Merge branch 'CURATOR-493' into CURATOR-490
Merge branch 'CURATOR-493' into CURATOR-490 Project: http://git-wip-us.apache.org/repos/asf/curator/repo Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/caf2a9d8 Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/caf2a9d8 Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/caf2a9d8 Branch: refs/heads/master Commit: caf2a9d81a333154a0d36fcea1a624d4e00df3e1 Parents: b94844a 05f6a56 Author: randgalt Authored: Sun Dec 9 12:34:30 2018 -0500 Committer: randgalt Committed: Sun Dec 9 12:34:30 2018 -0500 -- .../framework/imps/TestFrameworkEdges.java | 70 +++- 1 file changed, 54 insertions(+), 16 deletions(-) --
[2/6] curator git commit: CURATOR-490
CURATOR-490 Various changes to make tests run better: using Timing object in TestCleanState and few tests where it was missing; set the exclude groups in zk34, and set retry tests as status skip Project: http://git-wip-us.apache.org/repos/asf/curator/repo Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/4c993572 Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/4c993572 Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/4c993572 Branch: refs/heads/master Commit: 4c993572f01e1368bd6898cf1fc6ab3eb59d8688 Parents: 85161ab Author: randgalt Authored: Sat Dec 8 23:15:44 2018 -0500 Committer: randgalt Committed: Sat Dec 8 23:15:44 2018 -0500 -- .../org/apache/curator/framework/imps/TestCleanState.java| 4 +++- .../org/apache/curator/framework/imps/TestFramework.java | 3 ++- .../apache/curator/framework/imps/TestFrameworkEdges.java| 4 ++-- .../curator/framework/recipes/cache/TestNodeCache.java | 8 +--- .../framework/recipes/cache/TestPathChildrenCache.java | 2 +- curator-test-zk34/pom.xml| 3 ++- .../main/java/org/apache/curator/test/BaseClassForTests.java | 1 + 7 files changed, 16 insertions(+), 9 deletions(-) -- http://git-wip-us.apache.org/repos/asf/curator/blob/4c993572/curator-framework/src/test/java/org/apache/curator/framework/imps/TestCleanState.java -- diff --git a/curator-framework/src/test/java/org/apache/curator/framework/imps/TestCleanState.java b/curator-framework/src/test/java/org/apache/curator/framework/imps/TestCleanState.java index 7a61eea..d80e053 100644 --- a/curator-framework/src/test/java/org/apache/curator/framework/imps/TestCleanState.java +++ b/curator-framework/src/test/java/org/apache/curator/framework/imps/TestCleanState.java @@ -20,6 +20,7 @@ package org.apache.curator.framework.imps; import org.apache.curator.framework.CuratorFramework; import org.apache.curator.test.WatchersDebug; +import org.apache.curator.test.compatibility.Timing2; import org.apache.curator.utils.CloseableUtils; import org.apache.curator.utils.Compatibility; import org.apache.zookeeper.ZooKeeper; @@ -42,6 +43,7 @@ public class TestCleanState try { +Timing2 timing = new Timing2(); CuratorFrameworkImpl internalClient = (CuratorFrameworkImpl)client; EnsembleTracker ensembleTracker = internalClient.getEnsembleTracker(); if ( ensembleTracker != null ) @@ -60,7 +62,7 @@ public class TestCleanState { if ( i > 0 ) { -Thread.sleep(500); +timing.multiple(.5).sleepABit(); } boolean isLast = (i + 1) == maxLoops; if ( WatchersDebug.getChildWatches(zooKeeper).size() != 0 ) http://git-wip-us.apache.org/repos/asf/curator/blob/4c993572/curator-framework/src/test/java/org/apache/curator/framework/imps/TestFramework.java -- diff --git a/curator-framework/src/test/java/org/apache/curator/framework/imps/TestFramework.java b/curator-framework/src/test/java/org/apache/curator/framework/imps/TestFramework.java index 0a01679..fe49ad7 100644 --- a/curator-framework/src/test/java/org/apache/curator/framework/imps/TestFramework.java +++ b/curator-framework/src/test/java/org/apache/curator/framework/imps/TestFramework.java @@ -32,6 +32,7 @@ import org.apache.curator.retry.RetryOneTime; import org.apache.curator.test.BaseClassForTests; import org.apache.curator.test.Timing; import org.apache.curator.test.compatibility.Timing2; +import org.apache.curator.test.compatibility.Zk35MethodInterceptor; import org.apache.curator.utils.CloseableUtils; import org.apache.curator.utils.EnsurePath; import org.apache.curator.utils.ZKPaths; @@ -76,7 +77,7 @@ public class TestFramework extends BaseClassForTests super.teardown(); } -@Test +@Test(groups = Zk35MethodInterceptor.zk35Group) public void testWaitForShutdownTimeoutMs() throws Exception { final BlockingQueue timeoutQueue = new ArrayBlockingQueue<>(1); http://git-wip-us.apache.org/repos/asf/curator/blob/4c993572/curator-framework/src/test/java/org/apache/curator/framework/imps/TestFrameworkEdges.java -- diff --git a/curator-framework/src/test/java/org/apache/curator/framework/imps/TestFrameworkEdges.java b/curator-framework/src/test/java/org/apache/curator/framework/imps/TestFrameworkEdges.java index f9b16af..0d832f1 100644 --- a/curator-framework/src/test/java/org/apache/curator/framework/imps/TestFrameworkEdges.java +++
[4/6] curator git commit: CURATOR-490 testReentrantSingleLock() should not be run for TestInterProcessSemaphoreMutex as InterProcessSemaphoreMutex is not re-entrant
CURATOR-490 testReentrantSingleLock() should not be run for TestInterProcessSemaphoreMutex as InterProcessSemaphoreMutex is not re-entrant Project: http://git-wip-us.apache.org/repos/asf/curator/repo Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/b94844af Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/b94844af Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/b94844af Branch: refs/heads/master Commit: b94844af500054dc6aa1b342e2ea3665de5f232f Parents: 1731834 Author: randgalt Authored: Sun Dec 9 12:28:32 2018 -0500 Committer: randgalt Committed: Sun Dec 9 12:28:32 2018 -0500 -- .../recipes/locks/TestInterProcessSemaphoreMutex.java | 10 -- 1 file changed, 8 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/curator/blob/b94844af/curator-recipes/src/test/java/org/apache/curator/framework/recipes/locks/TestInterProcessSemaphoreMutex.java -- diff --git a/curator-recipes/src/test/java/org/apache/curator/framework/recipes/locks/TestInterProcessSemaphoreMutex.java b/curator-recipes/src/test/java/org/apache/curator/framework/recipes/locks/TestInterProcessSemaphoreMutex.java index cd8b83e..90bd7da 100644 --- a/curator-recipes/src/test/java/org/apache/curator/framework/recipes/locks/TestInterProcessSemaphoreMutex.java +++ b/curator-recipes/src/test/java/org/apache/curator/framework/recipes/locks/TestInterProcessSemaphoreMutex.java @@ -27,13 +27,19 @@ public class TestInterProcessSemaphoreMutex extends TestInterProcessMutexBase @Override @Test(enabled = false) -public void testReentrant() throws Exception +public void testReentrant() { } @Override @Test(enabled = false) -public void testReentrant2Threads() throws Exception +public void testReentrant2Threads() +{ +} + +@Override +@Test(enabled = false) +public void testReentrantSingleLock() { }
[6/6] curator git commit: Merge branch 'master' into CURATOR-490
Merge branch 'master' into CURATOR-490 Project: http://git-wip-us.apache.org/repos/asf/curator/repo Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/a17d3af9 Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/a17d3af9 Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/a17d3af9 Branch: refs/heads/master Commit: a17d3af9ad618571f40844cf78beb7398e4a0241 Parents: caf2a9d 964f11a Author: randgalt Authored: Sun Dec 9 17:49:20 2018 -0500 Committer: randgalt Committed: Sun Dec 9 17:49:20 2018 -0500 -- --
[2/3] curator git commit: Closes #288 I have a different implementation that is more generalized for future use. I'll close this and open a new PR
Closes #288 I have a different implementation that is more generalized for future use. I'll close this and open a new PR Project: http://git-wip-us.apache.org/repos/asf/curator/repo Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/964f11ab Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/964f11ab Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/964f11ab Branch: refs/heads/CURATOR-490 Commit: 964f11abb503c6de383068e41b032d5f441c5cfe Parents: 771e9a4 Author: randgalt Authored: Sun Dec 9 17:40:44 2018 -0500 Committer: randgalt Committed: Sun Dec 9 17:40:44 2018 -0500 -- --
[3/3] curator git commit: Merge branch 'master' into CURATOR-490
Merge branch 'master' into CURATOR-490 Project: http://git-wip-us.apache.org/repos/asf/curator/repo Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/a17d3af9 Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/a17d3af9 Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/a17d3af9 Branch: refs/heads/CURATOR-490 Commit: a17d3af9ad618571f40844cf78beb7398e4a0241 Parents: caf2a9d 964f11a Author: randgalt Authored: Sun Dec 9 17:49:20 2018 -0500 Committer: randgalt Committed: Sun Dec 9 17:49:20 2018 -0500 -- --
[1/3] curator git commit: Merge branch 'CURATOR-405'
Repository: curator Updated Branches: refs/heads/CURATOR-490 caf2a9d81 -> a17d3af9a Merge branch 'CURATOR-405' Project: http://git-wip-us.apache.org/repos/asf/curator/repo Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/771e9a4c Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/771e9a4c Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/771e9a4c Branch: refs/heads/CURATOR-490 Commit: 771e9a4cde4f8af913db934db01b93460ac97ebc Parents: 05f6a56 d965266 Author: randgalt Authored: Sun Dec 9 17:06:14 2018 -0500 Committer: randgalt Committed: Sun Dec 9 17:06:14 2018 -0500 -- .../org/apache/curator/framework/state/ConnectionStateManager.java | 1 + 1 file changed, 1 insertion(+) --
[1/3] curator git commit: fixed CachedModeledFrameworkImpl children queries, https://issues.apache.org/jira/browse/CURATOR-479
Repository: curator Updated Branches: refs/heads/CURATOR-479 [created] 818783391 fixed CachedModeledFrameworkImpl children queries, https://issues.apache.org/jira/browse/CURATOR-479 Project: http://git-wip-us.apache.org/repos/asf/curator/repo Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/1429676e Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/1429676e Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/1429676e Branch: refs/heads/CURATOR-479 Commit: 1429676ea43ecfbfe3dd7f28f222d58105e41d3f Parents: d13a12f Author: Hendrik Haddorp Authored: Sat Dec 8 21:42:11 2018 +0100 Committer: Hendrik Haddorp Committed: Sat Dec 8 21:42:11 2018 +0100 -- .../details/CachedModeledFrameworkImpl.java | 4 +- .../modeled/TestCachedModeledFramework.java | 48 +++- 2 files changed, 49 insertions(+), 3 deletions(-) -- http://git-wip-us.apache.org/repos/asf/curator/blob/1429676e/curator-x-async/src/main/java/org/apache/curator/x/async/modeled/details/CachedModeledFrameworkImpl.java -- diff --git a/curator-x-async/src/main/java/org/apache/curator/x/async/modeled/details/CachedModeledFrameworkImpl.java b/curator-x-async/src/main/java/org/apache/curator/x/async/modeled/details/CachedModeledFrameworkImpl.java index f701ab3..10d7379 100644 --- a/curator-x-async/src/main/java/org/apache/curator/x/async/modeled/details/CachedModeledFrameworkImpl.java +++ b/curator-x-async/src/main/java/org/apache/curator/x/async/modeled/details/CachedModeledFrameworkImpl.java @@ -248,7 +248,7 @@ class CachedModeledFrameworkImpl implements CachedModeledFramework List paths = cache.currentChildren(client.modelSpec().path()) .keySet() .stream() -.filter(path -> path.equals(cache.basePath())) +.filter(path -> path.startsWith(client.modelSpec().path()) && !path.equals(client.modelSpec().path())) .collect(Collectors.toList()); return completed(paths); } @@ -259,7 +259,7 @@ class CachedModeledFrameworkImpl implements CachedModeledFramework List> nodes = cache.currentChildren(client.modelSpec().path()) .entrySet() .stream() -.filter(e -> e.getKey().equals(cache.basePath())) +.filter(e -> e.getKey().startsWith(client.modelSpec().path()) && !e.getKey().equals(client.modelSpec().path())) .map(Map.Entry::getValue) .collect(Collectors.toList()); return completed(nodes); http://git-wip-us.apache.org/repos/asf/curator/blob/1429676e/curator-x-async/src/test/java/org/apache/curator/x/async/modeled/TestCachedModeledFramework.java -- diff --git a/curator-x-async/src/test/java/org/apache/curator/x/async/modeled/TestCachedModeledFramework.java b/curator-x-async/src/test/java/org/apache/curator/x/async/modeled/TestCachedModeledFramework.java index 80c1f8b..73dc017 100644 --- a/curator-x-async/src/test/java/org/apache/curator/x/async/modeled/TestCachedModeledFramework.java +++ b/curator-x-async/src/test/java/org/apache/curator/x/async/modeled/TestCachedModeledFramework.java @@ -27,6 +27,8 @@ import org.testng.Assert; import org.testng.annotations.Test; import java.io.IOException; import java.math.BigInteger; +import java.util.HashSet; +import java.util.Set; import java.util.concurrent.CountDownLatch; import java.util.concurrent.Semaphore; @@ -73,7 +75,7 @@ public class TestCachedModeledFramework extends TestModeledFrameworkBase public void testPostInitializedFilter() { TestModel model1 = new TestModel("a", "b", "c", 1, BigInteger.ONE); -TestModel model2 = new TestModel("d", "e", "e", 1, BigInteger.ONE); +TestModel model2 = new TestModel("d", "e", "f", 1, BigInteger.ONE); CachedModeledFramework client = ModeledFramework.wrap(async, modelSpec).cached(); Semaphore semaphore = new Semaphore(0); ModeledCacheListener listener = (t, p, s, m) -> semaphore.release(); @@ -93,4 +95,48 @@ public class TestCachedModeledFramework extends TestModeledFrameworkBase client.close(); } } + +@Test +public void testChildren() throws Exception +{ +TestModel parent = new TestModel("a", "b", "c", 20, BigInteger.ONE); +TestModel child1 = new TestModel("d", "e", "f", 1, BigInteger.ONE); +TestModel child2 = new TestModel("g", "h", "i", 1, BigInteger.ONE); +try (CachedModeledFramework client = ModeledFramework.wrap(async, modelSpec).cached()) +{ +Semaphore semaphore = new Semaphore(0); +client.listenable().addListener((t, p, s, m) -> +{ +if (m.equals(child2)) +
[3/3] curator git commit: CURATOR-479
CURATOR-479 Added new method to ZPath, isParentOf(). The, use it in CachedModeledFrameworkImpl.children() and CachedModeledFrameworkImpl.childrenAsZNodes() which were not implemented correctly. Project: http://git-wip-us.apache.org/repos/asf/curator/repo Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/81878339 Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/81878339 Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/81878339 Branch: refs/heads/CURATOR-479 Commit: 81878339179595c304d7efce4450807b218839be Parents: a0f5f6e Author: randgalt Authored: Sun Dec 9 17:46:12 2018 -0500 Committer: randgalt Committed: Sun Dec 9 17:46:12 2018 -0500 -- .../apache/curator/x/async/modeled/ZPath.java | 16 +- .../details/CachedModeledFrameworkImpl.java | 4 ++-- .../x/async/modeled/details/ZPathImpl.java | 22 .../curator/x/async/modeled/TestZPath.java | 10 + 4 files changed, 49 insertions(+), 3 deletions(-) -- http://git-wip-us.apache.org/repos/asf/curator/blob/81878339/curator-x-async/src/main/java/org/apache/curator/x/async/modeled/ZPath.java -- diff --git a/curator-x-async/src/main/java/org/apache/curator/x/async/modeled/ZPath.java b/curator-x-async/src/main/java/org/apache/curator/x/async/modeled/ZPath.java index 70ac536..3b0e47c 100644 --- a/curator-x-async/src/main/java/org/apache/curator/x/async/modeled/ZPath.java +++ b/curator-x-async/src/main/java/org/apache/curator/x/async/modeled/ZPath.java @@ -249,7 +249,7 @@ public interface ZPath extends Resolvable /** * Return true if this path starts with the given path. i.e. - * ZPath.from("/one/two/three").startsWith(ZPath.from("/one/two")) returns true + * ZPath.parse("/one/two/three").startsWith(ZPath.parse("/one/two")) returns true * * @param path base path * @return true/false @@ -257,6 +257,20 @@ public interface ZPath extends Resolvable boolean startsWith(ZPath path); /** + * Return true if this path is a parent, grandparent, etc. of the given path i.e. + * ZPath.parse("/one").isParentOf(ZPath.parse("/one/two/three")) returns true. + * However, ZPath.from("/one/two/three").isParentOf(ZPath.from("/one/two/three")) + * returns false. + * + * @param path base path + * @return true/false + */ +default boolean isParentOf(ZPath path) +{ +return path.startsWith(this) && !path.fullPath().equals(fullPath()); +} + +/** * The string full path that this ZPath represents * * @return full path http://git-wip-us.apache.org/repos/asf/curator/blob/81878339/curator-x-async/src/main/java/org/apache/curator/x/async/modeled/details/CachedModeledFrameworkImpl.java -- diff --git a/curator-x-async/src/main/java/org/apache/curator/x/async/modeled/details/CachedModeledFrameworkImpl.java b/curator-x-async/src/main/java/org/apache/curator/x/async/modeled/details/CachedModeledFrameworkImpl.java index 10d7379..726b476 100644 --- a/curator-x-async/src/main/java/org/apache/curator/x/async/modeled/details/CachedModeledFrameworkImpl.java +++ b/curator-x-async/src/main/java/org/apache/curator/x/async/modeled/details/CachedModeledFrameworkImpl.java @@ -248,7 +248,7 @@ class CachedModeledFrameworkImpl implements CachedModeledFramework List paths = cache.currentChildren(client.modelSpec().path()) .keySet() .stream() -.filter(path -> path.startsWith(client.modelSpec().path()) && !path.equals(client.modelSpec().path())) +.filter(path -> client.modelSpec().path().isParentOf(path)) .collect(Collectors.toList()); return completed(paths); } @@ -259,7 +259,7 @@ class CachedModeledFrameworkImpl implements CachedModeledFramework List> nodes = cache.currentChildren(client.modelSpec().path()) .entrySet() .stream() -.filter(e -> e.getKey().startsWith(client.modelSpec().path()) && !e.getKey().equals(client.modelSpec().path())) +.filter(e -> client.modelSpec().path().isParentOf(e.getKey())) .map(Map.Entry::getValue) .collect(Collectors.toList()); return completed(nodes); http://git-wip-us.apache.org/repos/asf/curator/blob/81878339/curator-x-async/src/main/java/org/apache/curator/x/async/modeled/details/ZPathImpl.java -- diff --git a/curator-x-async/src/main/java/org/apache/curator/x/async/modeled/details/ZPathImpl.java b/curator-x-async/src/main/java/org/apache/curator/x/async/modeled/details/ZPathImpl.java index fff742e..65b25d5 100644 ---
[2/3] curator git commit: Merge branch 'CURATOR-479' of github.com:Hendrik-H/curator into CURATOR-479
Merge branch 'CURATOR-479' of github.com:Hendrik-H/curator into CURATOR-479 Project: http://git-wip-us.apache.org/repos/asf/curator/repo Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/a0f5f6ec Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/a0f5f6ec Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/a0f5f6ec Branch: refs/heads/CURATOR-479 Commit: a0f5f6eccbbc7483bf4a9b9165e0ea8d64c3999b Parents: 771e9a4 1429676 Author: randgalt Authored: Sun Dec 9 17:07:54 2018 -0500 Committer: randgalt Committed: Sun Dec 9 17:07:54 2018 -0500 -- .../details/CachedModeledFrameworkImpl.java | 4 +- .../modeled/TestCachedModeledFramework.java | 48 +++- 2 files changed, 49 insertions(+), 3 deletions(-) --
[3/4] curator git commit: Merge branch 'GzipCompressionProvider-references' of https://github.com/leventov/curator into CURATOR-487
Merge branch 'GzipCompressionProvider-references' of https://github.com/leventov/curator into CURATOR-487 Project: http://git-wip-us.apache.org/repos/asf/curator/repo Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/388787c8 Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/388787c8 Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/388787c8 Branch: refs/heads/CURATOR-487 Commit: 388787c838cb2e6e0b755b576eb958257e2cef22 Parents: 05f6a56 7467e59 Author: Cam McKenzie Authored: Mon Dec 10 08:23:30 2018 +1100 Committer: Cam McKenzie Committed: Mon Dec 10 08:23:30 2018 +1100 -- .../framework/imps/GzipCompressionProvider.java | 311 +-- .../imps/GzipCompressionProviderTest.java | 125 2 files changed, 414 insertions(+), 22 deletions(-) --
[4/4] curator git commit: CURATOR-487 - Rename unit test
CURATOR-487 - Rename unit test Project: http://git-wip-us.apache.org/repos/asf/curator/repo Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/ec702086 Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/ec702086 Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/ec702086 Branch: refs/heads/CURATOR-487 Commit: ec7020861a724446e663156a7939555623fd70dd Parents: 388787c Author: Cam McKenzie Authored: Mon Dec 10 09:43:34 2018 +1100 Committer: Cam McKenzie Committed: Mon Dec 10 09:43:34 2018 +1100 -- .../imps/GzipCompressionProviderTest.java | 125 --- .../imps/TestGzipCompressionProvider.java | 125 +++ 2 files changed, 125 insertions(+), 125 deletions(-) -- http://git-wip-us.apache.org/repos/asf/curator/blob/ec702086/curator-framework/src/test/java/org/apache/curator/framework/imps/GzipCompressionProviderTest.java -- diff --git a/curator-framework/src/test/java/org/apache/curator/framework/imps/GzipCompressionProviderTest.java b/curator-framework/src/test/java/org/apache/curator/framework/imps/GzipCompressionProviderTest.java deleted file mode 100644 index 51edaba..000 --- a/curator-framework/src/test/java/org/apache/curator/framework/imps/GzipCompressionProviderTest.java +++ /dev/null @@ -1,125 +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.framework.imps; - -import org.testng.Assert; -import org.testng.annotations.Test; - -import java.io.ByteArrayOutputStream; -import java.io.IOException; -import java.util.Arrays; -import java.util.concurrent.ThreadLocalRandom; -import java.util.zip.GZIPOutputStream; - -public class GzipCompressionProviderTest -{ -@Test -public void testSimple() throws IOException -{ -GzipCompressionProvider provider = new GzipCompressionProvider(); -byte[] data = "Hello, world!".getBytes(); -byte[] compressedData = provider.compress(null, data); -byte[] jdkCompressedData = jdkCompress(data); -Assert.assertTrue(Arrays.equals(compressedData, jdkCompressedData)); -byte[] decompressedData = provider.decompress(null, compressedData); -Assert.assertTrue(Arrays.equals(decompressedData, data)); -} - -@Test -public void testEmpty() throws IOException -{ -GzipCompressionProvider provider = new GzipCompressionProvider(); -byte[] compressedData = provider.compress(null, new byte[0]); -byte[] compressedData2 = GzipCompressionProvider.doCompress(new byte[0]); -byte[] jdkCompress = jdkCompress(new byte[0]); -// Ensures GzipCompressionProvider.COMPRESSED_EMPTY_BYTES value is valid -Assert.assertTrue(Arrays.equals(compressedData, compressedData2)); -Assert.assertTrue(Arrays.equals(compressedData, jdkCompress)); -byte[] decompressedData = provider.decompress(null, compressedData); -Assert.assertEquals(0, decompressedData.length); -} - -/** - * This test ensures that in the face of corrupt data, specifically IOException is thrown, rather some other kind - * of runtime exception. Users of {@link GzipCompressionProvider#decompress(String, byte[])} may depend on this. - */ -@Test -public void testDecompressCorrupt() -{ -GzipCompressionProvider provider = new GzipCompressionProvider(); -try { -provider.decompress(null, new byte[100]); -Assert.fail("Expected IOException"); -} catch (IOException ignore) { -// expected -} -byte[] compressedData = provider.compress(null, new byte[0]); -for (int i = 0; i < compressedData.length; i++) -{ -try { -provider.decompress(null, Arrays.copyOf(compressedData, i)); -} catch (IOException ignore) { -// expected -} -for (int change = 1; change < 256; change++) -{ -byte b = compressedData[i]; -
[1/4] curator git commit: Make GzipCompressionProvider to recycle Deflaters and Inflaters in pools
Repository: curator Updated Branches: refs/heads/CURATOR-487 [created] ec7020861 Make GzipCompressionProvider to recycle Deflaters and Inflaters in pools Project: http://git-wip-us.apache.org/repos/asf/curator/repo Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/6457f267 Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/6457f267 Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/6457f267 Branch: refs/heads/CURATOR-487 Commit: 6457f267ad713854fb89d32a56f266202cf82cd5 Parents: eebff92 Author: Roman Leventov Authored: Fri Nov 30 18:49:10 2018 +0100 Committer: Roman Leventov Committed: Fri Nov 30 18:55:36 2018 +0100 -- .../framework/imps/GzipCompressionProvider.java | 307 +-- .../imps/GzipCompressionProviderTest.java | 88 ++ 2 files changed, 373 insertions(+), 22 deletions(-) -- http://git-wip-us.apache.org/repos/asf/curator/blob/6457f267/curator-framework/src/main/java/org/apache/curator/framework/imps/GzipCompressionProvider.java -- diff --git a/curator-framework/src/main/java/org/apache/curator/framework/imps/GzipCompressionProvider.java b/curator-framework/src/main/java/org/apache/curator/framework/imps/GzipCompressionProvider.java index 7b35c37..74d0347 100644 --- a/curator-framework/src/main/java/org/apache/curator/framework/imps/GzipCompressionProvider.java +++ b/curator-framework/src/main/java/org/apache/curator/framework/imps/GzipCompressionProvider.java @@ -18,47 +18,310 @@ */ package org.apache.curator.framework.imps; +import com.google.common.annotations.VisibleForTesting; import org.apache.curator.framework.api.CompressionProvider; -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; -import java.util.zip.GZIPInputStream; -import java.util.zip.GZIPOutputStream; + +import java.io.EOFException; +import java.io.IOException; +import java.nio.BufferUnderflowException; +import java.nio.ByteBuffer; +import java.nio.ByteOrder; +import java.util.Arrays; +import java.util.concurrent.ConcurrentLinkedQueue; +import java.util.zip.*; public class GzipCompressionProvider implements CompressionProvider { +// This class re-implements java.util.zip.GZIPInputStream and GZIPOutputStream functionality to avoid +// creation many finalized Deflater and Inflater objects on heap (see +// https://issues.apache.org/jira/browse/CURATOR-487). Even when Curator's minimum supported Java version becomes +// no less than Java 12, where finalize() methods are removed in Deflater and Inflater classes and instead they +// are phantom-referenced via Cleaner, it still makes sense to avoid GZIPInputStream and GZIPOutputStream because +// phantom references are also not entirely free for GC algorithms, and also to allocate less garbage and make +// less unnecessary data copies. + +private static final int MAX_SAFE_JAVA_BYTE_ARRAY_SIZE = Integer.MAX_VALUE - 128; + +/** GZIP header magic number. */ +private static final int GZIP_MAGIC = 0x8b1f; + +/** See {@code java.util.zip.GZIPOutputStream.writeHeader()} */ +private static final byte[] GZIP_HEADER = new byte[] { +(byte) GZIP_MAGIC,// Magic number (byte 0) +(byte) (GZIP_MAGIC >> 8), // Magic number (byte 1) +Deflater.DEFLATED,// Compression method (CM) +0,// Flags (FLG) +0,// Modification time MTIME (byte 0) +0,// Modification time MTIME (byte 1) +0,// Modification time MTIME (byte 2) +0,// Modification time MTIME (byte 3) +0,// Extra flags (XFLG) +0 // Operating system (OS) +}; + +/** GZip flags, {@link #GZIP_HEADER}'s 4th byte */ +private static final int FHCRC = 1 << 1; +private static final int FEXTRA = 1 << 2; +private static final int FNAME = 1 << 3; +private static final int FCOMMENT = 1 << 4; + +private static final int GZIP_HEADER_SIZE = GZIP_HEADER.length; + +/** 32-bit CRC and uncompressed data size */ +private static final int GZIP_TRAILER_SIZE = Integer.BYTES + Integer.BYTES; + +/** + * Since Deflaters and Inflaters are acquired and returned to the pools in try-finally blocks that are free of + * blocking calls themselves, it's not expected that the number of objects in the pools could exceed the number of + * hardware threads on the machine much. Therefore it's accepted to have simple pools of strongly-referenced + * objects. + */ +private static final ConcurrentLinkedQueue DEFLATER_POOL = new ConcurrentLinkedQueue<>(); +private static final
[2/4] curator git commit: Add tests
Add tests Project: http://git-wip-us.apache.org/repos/asf/curator/repo Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/7467e596 Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/7467e596 Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/7467e596 Branch: refs/heads/CURATOR-487 Commit: 7467e5966fea5cabfa47d189688a6b0bd88a7a6d Parents: 6457f26 Author: Roman Leventov Authored: Fri Nov 30 20:22:51 2018 +0100 Committer: Roman Leventov Committed: Fri Nov 30 20:22:51 2018 +0100 -- .../framework/imps/GzipCompressionProvider.java | 22 +++- .../imps/GzipCompressionProviderTest.java | 37 2 files changed, 50 insertions(+), 9 deletions(-) -- http://git-wip-us.apache.org/repos/asf/curator/blob/7467e596/curator-framework/src/main/java/org/apache/curator/framework/imps/GzipCompressionProvider.java -- diff --git a/curator-framework/src/main/java/org/apache/curator/framework/imps/GzipCompressionProvider.java b/curator-framework/src/main/java/org/apache/curator/framework/imps/GzipCompressionProvider.java index 74d0347..fa357d2 100644 --- a/curator-framework/src/main/java/org/apache/curator/framework/imps/GzipCompressionProvider.java +++ b/curator-framework/src/main/java/org/apache/curator/framework/imps/GzipCompressionProvider.java @@ -70,11 +70,14 @@ public class GzipCompressionProvider implements CompressionProvider /** 32-bit CRC and uncompressed data size */ private static final int GZIP_TRAILER_SIZE = Integer.BYTES + Integer.BYTES; +/** DEFLATE doesn't produce shorter compressed data */ +private static final int MIN_COMPRESSED_DATA_SIZE = 2; + /** * Since Deflaters and Inflaters are acquired and returned to the pools in try-finally blocks that are free of * blocking calls themselves, it's not expected that the number of objects in the pools could exceed the number of - * hardware threads on the machine much. Therefore it's accepted to have simple pools of strongly-referenced - * objects. + * hardware threads on the machine much. Therefore it's accepted to have simple "ever-growing" (in fact, no) pools + * of strongly-referenced objects. */ private static final ConcurrentLinkedQueue DEFLATER_POOL = new ConcurrentLinkedQueue<>(); private static final ConcurrentLinkedQueue INFLATER_POOL = new ConcurrentLinkedQueue<>(); @@ -135,8 +138,7 @@ public class GzipCompressionProvider implements CompressionProvider { break; } -// `+ 1` to ensure some growth on the sizes of 0 or 1 -int newResultLength = result.length + (result.length / 2) + 1; +int newResultLength = result.length + (result.length / 2); result = Arrays.copyOf(result, newResultLength); } // Write GZip trailer @@ -162,7 +164,7 @@ public class GzipCompressionProvider implements CompressionProvider if ( dataSize < 512 ) { // Assuming DEFLATE doesn't compress small data well -conservativeCompressedDataSizeEstimate = dataSize; +conservativeCompressedDataSizeEstimate = Math.max(dataSize, MIN_COMPRESSED_DATA_SIZE); } else { @@ -191,7 +193,7 @@ public class GzipCompressionProvider implements CompressionProvider ByteBuffer gzippedData = ByteBuffer.wrap(gzippedDataBytes); gzippedData.order(ByteOrder.LITTLE_ENDIAN); int headerSize = readGzipHeader(gzippedData); -if ( gzippedDataBytes.length < headerSize + GZIP_TRAILER_SIZE ) +if ( gzippedDataBytes.length < headerSize + MIN_COMPRESSED_DATA_SIZE + GZIP_TRAILER_SIZE ) { throw new EOFException("Too short GZipped data"); } @@ -220,7 +222,10 @@ public class GzipCompressionProvider implements CompressionProvider { break; } -else if ( inflater.needsInput() ) +// Just calling inflater.needsInput() doesn't work as expected, apparently it doesn't uphold it's own +// contract and could have needsInput() == true if numDecompressedBytes != 0 and that just means that +// there is not enough space in the result array +else if ( numDecompressedBytes == 0 && inflater.needsInput() ) { throw new ZipException("Corrupt GZipped data"); } @@ -231,9 +236,8 @@ public class GzipCompressionProvider implements CompressionProvider { throw new OutOfMemoryError("Unable to uncompress that much data into a single byte[] array"); } -// `+ 1` to
curator git commit: Closes #288 I have a different implementation that is more generalized for future use. I'll close this and open a new PR
Repository: curator Updated Branches: refs/heads/master 771e9a4cd -> 964f11abb Closes #288 I have a different implementation that is more generalized for future use. I'll close this and open a new PR Project: http://git-wip-us.apache.org/repos/asf/curator/repo Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/964f11ab Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/964f11ab Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/964f11ab Branch: refs/heads/master Commit: 964f11abb503c6de383068e41b032d5f441c5cfe Parents: 771e9a4 Author: randgalt Authored: Sun Dec 9 17:40:44 2018 -0500 Committer: randgalt Committed: Sun Dec 9 17:40:44 2018 -0500 -- --
[1/2] curator git commit: CURATOR-405
Repository: curator Updated Branches: refs/heads/master 05f6a5673 -> 771e9a4cd CURATOR-405 Once the session expiration is injected, reset startOfSuspendedEpoch so that we don't do this copious times while things are being reset. Project: http://git-wip-us.apache.org/repos/asf/curator/repo Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/d9652662 Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/d9652662 Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/d9652662 Branch: refs/heads/master Commit: d9652662293529374c601d90a9700e132a466700 Parents: 2adccc5 Author: randgalt Authored: Sun Dec 9 11:11:30 2018 -0500 Committer: randgalt Committed: Sun Dec 9 11:11:30 2018 -0500 -- .../org/apache/curator/framework/state/ConnectionStateManager.java | 1 + 1 file changed, 1 insertion(+) -- http://git-wip-us.apache.org/repos/asf/curator/blob/d9652662/curator-framework/src/main/java/org/apache/curator/framework/state/ConnectionStateManager.java -- diff --git a/curator-framework/src/main/java/org/apache/curator/framework/state/ConnectionStateManager.java b/curator-framework/src/main/java/org/apache/curator/framework/state/ConnectionStateManager.java index b9384d2..5e28b3d 100644 --- a/curator-framework/src/main/java/org/apache/curator/framework/state/ConnectionStateManager.java +++ b/curator-framework/src/main/java/org/apache/curator/framework/state/ConnectionStateManager.java @@ -301,6 +301,7 @@ public class ConnectionStateManager implements Closeable int useSessionTimeoutMs = getUseSessionTimeoutMs(); if ( elapsedMs >= useSessionTimeoutMs ) { +startOfSuspendedEpoch = System.currentTimeMillis(); // reset startOfSuspendedEpoch to avoid spinning on this session expiration injection CURATOR-405 log.warn(String.format("Session timeout has elapsed while SUSPENDED. Injecting a session expiration. Elapsed ms: %d. Adjusted session timeout ms: %d", elapsedMs, useSessionTimeoutMs)); try {
[2/2] curator git commit: Merge branch 'CURATOR-405'
Merge branch 'CURATOR-405' Project: http://git-wip-us.apache.org/repos/asf/curator/repo Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/771e9a4c Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/771e9a4c Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/771e9a4c Branch: refs/heads/master Commit: 771e9a4cde4f8af913db934db01b93460ac97ebc Parents: 05f6a56 d965266 Author: randgalt Authored: Sun Dec 9 17:06:14 2018 -0500 Committer: randgalt Committed: Sun Dec 9 17:06:14 2018 -0500 -- .../org/apache/curator/framework/state/ConnectionStateManager.java | 1 + 1 file changed, 1 insertion(+) --
[2/2] curator git commit: Merge branch 'CURATOR-493' into CURATOR-490
Merge branch 'CURATOR-493' into CURATOR-490 Project: http://git-wip-us.apache.org/repos/asf/curator/repo Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/caf2a9d8 Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/caf2a9d8 Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/caf2a9d8 Branch: refs/heads/CURATOR-490 Commit: caf2a9d81a333154a0d36fcea1a624d4e00df3e1 Parents: b94844a 05f6a56 Author: randgalt Authored: Sun Dec 9 12:34:30 2018 -0500 Committer: randgalt Committed: Sun Dec 9 12:34:30 2018 -0500 -- .../framework/imps/TestFrameworkEdges.java | 70 +++- 1 file changed, 54 insertions(+), 16 deletions(-) --
[1/2] curator git commit: Fix test case with testDeleteChildrenConcurrently
Repository: curator Updated Branches: refs/heads/CURATOR-490 b94844af5 -> caf2a9d81 Fix test case with testDeleteChildrenConcurrently Project: http://git-wip-us.apache.org/repos/asf/curator/repo Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/05f6a567 Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/05f6a567 Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/05f6a567 Branch: refs/heads/CURATOR-490 Commit: 05f6a56730a956b5a977a11e05aa875fe862dedf Parents: 2adccc5 Author: hebelala Authored: Sun Dec 9 16:21:27 2018 +0800 Committer: hebelala Committed: Sun Dec 9 16:21:27 2018 +0800 -- .../framework/imps/TestFrameworkEdges.java | 70 +++- 1 file changed, 54 insertions(+), 16 deletions(-) -- http://git-wip-us.apache.org/repos/asf/curator/blob/05f6a567/curator-framework/src/test/java/org/apache/curator/framework/imps/TestFrameworkEdges.java -- diff --git a/curator-framework/src/test/java/org/apache/curator/framework/imps/TestFrameworkEdges.java b/curator-framework/src/test/java/org/apache/curator/framework/imps/TestFrameworkEdges.java index f9b16af..a28d6c5 100644 --- a/curator-framework/src/test/java/org/apache/curator/framework/imps/TestFrameworkEdges.java +++ b/curator-framework/src/test/java/org/apache/curator/framework/imps/TestFrameworkEdges.java @@ -45,10 +45,13 @@ import org.apache.zookeeper.KeeperException; import org.apache.zookeeper.WatchedEvent; import org.apache.zookeeper.Watcher; import org.apache.zookeeper.data.Stat; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.testng.Assert; import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; import java.util.List; +import java.util.Random; import java.util.concurrent.ArrayBlockingQueue; import java.util.concurrent.BlockingQueue; import java.util.concurrent.CountDownLatch; @@ -59,10 +62,13 @@ import java.util.concurrent.atomic.AtomicInteger; public class TestFrameworkEdges extends BaseClassForTests { + +private final Logger log = LoggerFactory.getLogger(getClass()); private final Timing2 timing = new Timing2(); @BeforeClass -public static void setUpClass() { +public static void setUpClass() +{ System.setProperty("zookeeper.extendedTypesEnabled", "true"); } @@ -668,12 +674,13 @@ public class TestFrameworkEdges extends BaseClassForTests client.create().creatingParentsIfNeeded().forPath("/parent/child" + i); } -final CountDownLatch countDownLatch = new CountDownLatch(1); +final CountDownLatch latch = new CountDownLatch(1); new Thread(new Runnable() { @Override public void run() { +long start = System.currentTimeMillis(); try { client.delete().deletingChildrenIfNeeded().forPath("/parent"); @@ -686,35 +693,66 @@ public class TestFrameworkEdges extends BaseClassForTests } else { -Assert.fail("unknown exception", e); +Assert.fail("unexpected exception", e); } } finally { -countDownLatch.countDown(); +log.info("client has deleted children, it costs: {}ms", System.currentTimeMillis() - start); +latch.countDown(); } } }).start(); -Thread.sleep(20L); -try -{ -client2.delete().forPath("/parent/child" + (childCount / 2)); -} -catch ( Exception e ) +boolean threadDeleted = false; +boolean client2Deleted = false; +Random random = new Random(); +for ( int i = 0; i < childCount; i++ ) { -if ( e instanceof KeeperException.NoNodeException ) +String child = "/parent/child" + random.nextInt(childCount); +try { -Assert.fail("client2 delete failed, shouldn't throw NoNodeException", e); +if ( !threadDeleted ) +{ +Stat stat = client2.checkExists().forPath(child); +if ( stat == null ) +{ +// the thread client has begin deleted the children +threadDeleted = true; +log.info("client has deleted the child {}", child); +} +
curator git commit: Fix test case with testDeleteChildrenConcurrently
Repository: curator Updated Branches: refs/heads/master 2adccc549 -> 05f6a5673 Fix test case with testDeleteChildrenConcurrently Project: http://git-wip-us.apache.org/repos/asf/curator/repo Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/05f6a567 Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/05f6a567 Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/05f6a567 Branch: refs/heads/master Commit: 05f6a56730a956b5a977a11e05aa875fe862dedf Parents: 2adccc5 Author: hebelala Authored: Sun Dec 9 16:21:27 2018 +0800 Committer: hebelala Committed: Sun Dec 9 16:21:27 2018 +0800 -- .../framework/imps/TestFrameworkEdges.java | 70 +++- 1 file changed, 54 insertions(+), 16 deletions(-) -- http://git-wip-us.apache.org/repos/asf/curator/blob/05f6a567/curator-framework/src/test/java/org/apache/curator/framework/imps/TestFrameworkEdges.java -- diff --git a/curator-framework/src/test/java/org/apache/curator/framework/imps/TestFrameworkEdges.java b/curator-framework/src/test/java/org/apache/curator/framework/imps/TestFrameworkEdges.java index f9b16af..a28d6c5 100644 --- a/curator-framework/src/test/java/org/apache/curator/framework/imps/TestFrameworkEdges.java +++ b/curator-framework/src/test/java/org/apache/curator/framework/imps/TestFrameworkEdges.java @@ -45,10 +45,13 @@ import org.apache.zookeeper.KeeperException; import org.apache.zookeeper.WatchedEvent; import org.apache.zookeeper.Watcher; import org.apache.zookeeper.data.Stat; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.testng.Assert; import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; import java.util.List; +import java.util.Random; import java.util.concurrent.ArrayBlockingQueue; import java.util.concurrent.BlockingQueue; import java.util.concurrent.CountDownLatch; @@ -59,10 +62,13 @@ import java.util.concurrent.atomic.AtomicInteger; public class TestFrameworkEdges extends BaseClassForTests { + +private final Logger log = LoggerFactory.getLogger(getClass()); private final Timing2 timing = new Timing2(); @BeforeClass -public static void setUpClass() { +public static void setUpClass() +{ System.setProperty("zookeeper.extendedTypesEnabled", "true"); } @@ -668,12 +674,13 @@ public class TestFrameworkEdges extends BaseClassForTests client.create().creatingParentsIfNeeded().forPath("/parent/child" + i); } -final CountDownLatch countDownLatch = new CountDownLatch(1); +final CountDownLatch latch = new CountDownLatch(1); new Thread(new Runnable() { @Override public void run() { +long start = System.currentTimeMillis(); try { client.delete().deletingChildrenIfNeeded().forPath("/parent"); @@ -686,35 +693,66 @@ public class TestFrameworkEdges extends BaseClassForTests } else { -Assert.fail("unknown exception", e); +Assert.fail("unexpected exception", e); } } finally { -countDownLatch.countDown(); +log.info("client has deleted children, it costs: {}ms", System.currentTimeMillis() - start); +latch.countDown(); } } }).start(); -Thread.sleep(20L); -try -{ -client2.delete().forPath("/parent/child" + (childCount / 2)); -} -catch ( Exception e ) +boolean threadDeleted = false; +boolean client2Deleted = false; +Random random = new Random(); +for ( int i = 0; i < childCount; i++ ) { -if ( e instanceof KeeperException.NoNodeException ) +String child = "/parent/child" + random.nextInt(childCount); +try { -Assert.fail("client2 delete failed, shouldn't throw NoNodeException", e); +if ( !threadDeleted ) +{ +Stat stat = client2.checkExists().forPath(child); +if ( stat == null ) +{ +// the thread client has begin deleted the children +threadDeleted = true; +log.info("client has deleted the child {}", child); +} +
[1/4] curator git commit: Merge branch 'CURATOR-491'
Repository: curator Updated Branches: refs/heads/CURATOR-490 4c993572f -> b94844af5 Merge branch 'CURATOR-491' Project: http://git-wip-us.apache.org/repos/asf/curator/repo Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/2adccc54 Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/2adccc54 Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/2adccc54 Branch: refs/heads/CURATOR-490 Commit: 2adccc54976ce028d8cfe4bf1e7ac6c404829e78 Parents: d7774c4 49d08cc Author: randgalt Authored: Sun Dec 9 02:27:54 2018 -0500 Committer: randgalt Committed: Sun Dec 9 02:27:54 2018 -0500 -- .../recipes/cache/PathChildrenCache.java| 29 1 file changed, 23 insertions(+), 6 deletions(-) --
[2/4] curator git commit: CURATOR-405
CURATOR-405 Once the session expiration is injected, reset startOfSuspendedEpoch so that we don't do this copious times while things are being reset. Project: http://git-wip-us.apache.org/repos/asf/curator/repo Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/d9652662 Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/d9652662 Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/d9652662 Branch: refs/heads/CURATOR-490 Commit: d9652662293529374c601d90a9700e132a466700 Parents: 2adccc5 Author: randgalt Authored: Sun Dec 9 11:11:30 2018 -0500 Committer: randgalt Committed: Sun Dec 9 11:11:30 2018 -0500 -- .../org/apache/curator/framework/state/ConnectionStateManager.java | 1 + 1 file changed, 1 insertion(+) -- http://git-wip-us.apache.org/repos/asf/curator/blob/d9652662/curator-framework/src/main/java/org/apache/curator/framework/state/ConnectionStateManager.java -- diff --git a/curator-framework/src/main/java/org/apache/curator/framework/state/ConnectionStateManager.java b/curator-framework/src/main/java/org/apache/curator/framework/state/ConnectionStateManager.java index b9384d2..5e28b3d 100644 --- a/curator-framework/src/main/java/org/apache/curator/framework/state/ConnectionStateManager.java +++ b/curator-framework/src/main/java/org/apache/curator/framework/state/ConnectionStateManager.java @@ -301,6 +301,7 @@ public class ConnectionStateManager implements Closeable int useSessionTimeoutMs = getUseSessionTimeoutMs(); if ( elapsedMs >= useSessionTimeoutMs ) { +startOfSuspendedEpoch = System.currentTimeMillis(); // reset startOfSuspendedEpoch to avoid spinning on this session expiration injection CURATOR-405 log.warn(String.format("Session timeout has elapsed while SUSPENDED. Injecting a session expiration. Elapsed ms: %d. Adjusted session timeout ms: %d", elapsedMs, useSessionTimeoutMs)); try {
[3/4] curator git commit: Merge branch 'CURATOR-405' into CURATOR-490
Merge branch 'CURATOR-405' into CURATOR-490 Project: http://git-wip-us.apache.org/repos/asf/curator/repo Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/17318342 Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/17318342 Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/17318342 Branch: refs/heads/CURATOR-490 Commit: 173183420688875c6e627260ffb4efbbdc48227c Parents: 4c99357 d965266 Author: randgalt Authored: Sun Dec 9 11:13:29 2018 -0500 Committer: randgalt Committed: Sun Dec 9 11:13:29 2018 -0500 -- .../org/apache/curator/framework/state/ConnectionStateManager.java | 1 + 1 file changed, 1 insertion(+) --
[4/4] curator git commit: CURATOR-490 testReentrantSingleLock() should not be run for TestInterProcessSemaphoreMutex as InterProcessSemaphoreMutex is not re-entrant
CURATOR-490 testReentrantSingleLock() should not be run for TestInterProcessSemaphoreMutex as InterProcessSemaphoreMutex is not re-entrant Project: http://git-wip-us.apache.org/repos/asf/curator/repo Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/b94844af Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/b94844af Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/b94844af Branch: refs/heads/CURATOR-490 Commit: b94844af500054dc6aa1b342e2ea3665de5f232f Parents: 1731834 Author: randgalt Authored: Sun Dec 9 12:28:32 2018 -0500 Committer: randgalt Committed: Sun Dec 9 12:28:32 2018 -0500 -- .../recipes/locks/TestInterProcessSemaphoreMutex.java | 10 -- 1 file changed, 8 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/curator/blob/b94844af/curator-recipes/src/test/java/org/apache/curator/framework/recipes/locks/TestInterProcessSemaphoreMutex.java -- diff --git a/curator-recipes/src/test/java/org/apache/curator/framework/recipes/locks/TestInterProcessSemaphoreMutex.java b/curator-recipes/src/test/java/org/apache/curator/framework/recipes/locks/TestInterProcessSemaphoreMutex.java index cd8b83e..90bd7da 100644 --- a/curator-recipes/src/test/java/org/apache/curator/framework/recipes/locks/TestInterProcessSemaphoreMutex.java +++ b/curator-recipes/src/test/java/org/apache/curator/framework/recipes/locks/TestInterProcessSemaphoreMutex.java @@ -27,13 +27,19 @@ public class TestInterProcessSemaphoreMutex extends TestInterProcessMutexBase @Override @Test(enabled = false) -public void testReentrant() throws Exception +public void testReentrant() { } @Override @Test(enabled = false) -public void testReentrant2Threads() throws Exception +public void testReentrant2Threads() +{ +} + +@Override +@Test(enabled = false) +public void testReentrantSingleLock() { }
curator git commit: CURATOR-405
Repository: curator Updated Branches: refs/heads/CURATOR-405 [created] d96526622 CURATOR-405 Once the session expiration is injected, reset startOfSuspendedEpoch so that we don't do this copious times while things are being reset. Project: http://git-wip-us.apache.org/repos/asf/curator/repo Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/d9652662 Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/d9652662 Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/d9652662 Branch: refs/heads/CURATOR-405 Commit: d9652662293529374c601d90a9700e132a466700 Parents: 2adccc5 Author: randgalt Authored: Sun Dec 9 11:11:30 2018 -0500 Committer: randgalt Committed: Sun Dec 9 11:11:30 2018 -0500 -- .../org/apache/curator/framework/state/ConnectionStateManager.java | 1 + 1 file changed, 1 insertion(+) -- http://git-wip-us.apache.org/repos/asf/curator/blob/d9652662/curator-framework/src/main/java/org/apache/curator/framework/state/ConnectionStateManager.java -- diff --git a/curator-framework/src/main/java/org/apache/curator/framework/state/ConnectionStateManager.java b/curator-framework/src/main/java/org/apache/curator/framework/state/ConnectionStateManager.java index b9384d2..5e28b3d 100644 --- a/curator-framework/src/main/java/org/apache/curator/framework/state/ConnectionStateManager.java +++ b/curator-framework/src/main/java/org/apache/curator/framework/state/ConnectionStateManager.java @@ -301,6 +301,7 @@ public class ConnectionStateManager implements Closeable int useSessionTimeoutMs = getUseSessionTimeoutMs(); if ( elapsedMs >= useSessionTimeoutMs ) { +startOfSuspendedEpoch = System.currentTimeMillis(); // reset startOfSuspendedEpoch to avoid spinning on this session expiration injection CURATOR-405 log.warn(String.format("Session timeout has elapsed while SUSPENDED. Injecting a session expiration. Elapsed ms: %d. Adjusted session timeout ms: %d", elapsedMs, useSessionTimeoutMs)); try {