[curator] branch master updated: CURATOR-561 Reset connection after repeat expiry
This is an automated email from the ASF dual-hosted git repository. cammckenzie pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/curator.git The following commit(s) were added to refs/heads/master by this push: new e2d32bd CURATOR-561 Reset connection after repeat expiry e2d32bd is described below commit e2d32bd00ec05a18bf149a47865fd807e00a60e1 Author: Scott Kirkpatrick AuthorDate: Wed Nov 3 12:53:48 2021 -0400 CURATOR-561 Reset connection after repeat expiry If there is a problem posting the Expired KeeperState during a session expiration, then the ZooKeeper event thread will die without ever posting the Expired event. This would then cause curator to keep trying to expire the connection but it does nothing because the connection is dead and no events will ever be posted. This can be prevented by forcibly resetting the connection if it's detected that the previous expiry had no effect --- .../framework/state/ConnectionStateManager.java| 10 - .../state/TestConnectionStateManager.java | 45 ++ 2 files changed, 54 insertions(+), 1 deletion(-) 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 9ee09b0..1b5f03b 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 @@ -77,6 +77,8 @@ public class ConnectionStateManager implements Closeable private volatile long startOfSuspendedEpoch = 0; +private volatile long lastExpiredInstanceIndex = -1; + private enum State { LATENT, @@ -318,7 +320,13 @@ public class ConnectionStateManager implements Closeable 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 { - client.getZookeeperClient().getZooKeeper().getTestable().injectSessionExpiration(); +if (lastExpiredInstanceIndex == client.getZookeeperClient().getInstanceIndex()) { +// last expiration didn't work for this instance, so event thread is dead and a reset is needed. CURATOR-561 +client.getZookeeperClient().reset(); +} else { +lastExpiredInstanceIndex = client.getZookeeperClient().getInstanceIndex(); + client.getZookeeperClient().getZooKeeper().getTestable().injectSessionExpiration(); +} } catch ( Exception e ) { diff --git a/curator-framework/src/test/java/org/apache/curator/framework/state/TestConnectionStateManager.java b/curator-framework/src/test/java/org/apache/curator/framework/state/TestConnectionStateManager.java index 4bd94e2..67d36cc 100644 --- a/curator-framework/src/test/java/org/apache/curator/framework/state/TestConnectionStateManager.java +++ b/curator-framework/src/test/java/org/apache/curator/framework/state/TestConnectionStateManager.java @@ -18,8 +18,11 @@ */ package org.apache.curator.framework.state; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertThrows; import static org.junit.jupiter.api.Assertions.assertTrue; +import com.google.common.collect.Queues; import org.apache.curator.framework.CuratorFramework; import org.apache.curator.framework.CuratorFrameworkFactory; import org.apache.curator.retry.RetryOneTime; @@ -27,9 +30,12 @@ import org.apache.curator.test.BaseClassForTests; import org.apache.curator.test.compatibility.CuratorTestBase; import org.apache.curator.test.compatibility.Timing2; import org.apache.curator.utils.CloseableUtils; +import org.apache.zookeeper.WatchedEvent; +import org.apache.zookeeper.Watcher; import org.junit.jupiter.api.Tag; import org.junit.jupiter.api.Test; +import java.util.concurrent.BlockingQueue; import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; @@ -83,4 +89,43 @@ public class TestConnectionStateManager extends BaseClassForTests { CloseableUtils.closeQuietly(client); } } + +@Test +public void testConnectionStateRecoversFromUnexpectedExpiredConnection() throws Exception { +Timing2 timing = new Timing2(); +CuratorFramework client = CuratorFrameworkFactory.builder() +.connectString(server.getConnectString()) +.connectionTimeoutMs(1_000) +.sessionTimeoutMs(250) // try to aggressively expire the connection +.retryPolicy(new Retr
svn commit: r1891815 - in /curator/site/trunk: ./ apidocs/ apidocs/async/ apidocs/async/class-use/ apidocs/cache/ apidocs/cache/class-use/ apidocs/discovery/ apidocs/discovery/class-use/ apidocs/frame
Author: cammckenzie Date: Mon Jul 26 22:27:52 2021 New Revision: 1891815 URL: http://svn.apache.org/viewvc?rev=1891815=rev Log: Update for Cuator version 5.2.0 [This commit notification would consist of 120 parts, which exceeds the limit of 50 ones, so it was shortened to the summary.]
[curator] branch master updated: Update currentStableVersion to 5.2.0
This is an automated email from the ASF dual-hosted git repository. cammckenzie pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/curator.git The following commit(s) were added to refs/heads/master by this push: new 64dc6d8 Update currentStableVersion to 5.2.0 64dc6d8 is described below commit 64dc6d82f003693846f6075413683e386df3885e Author: Cam McKenzie AuthorDate: Mon Jul 26 17:13:02 2021 +1000 Update currentStableVersion to 5.2.0 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index b79aa6e..1c55dee 100644 --- a/pom.xml +++ b/pom.xml @@ -57,7 +57,7 @@ 1.8 false -5.1.0 +5.2.0 UTF-8 UTF-8
[curator] branch master updated (414a408 -> 483379d)
This is an automated email from the ASF dual-hosted git repository. cammckenzie pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/curator.git. from 414a408 CURATOR-599: Configurable ZookeeperFactory by ZKClientConfig add c1746fa [maven-release-plugin] prepare release apache-curator-5.2.0 new 483379d [maven-release-plugin] prepare for next development iteration The 1 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: curator-client/pom.xml | 4 ++-- curator-examples/pom.xml | 2 +- curator-framework/pom.xml | 4 ++-- curator-recipes/pom.xml| 4 ++-- curator-test-zk35/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(-)
[curator] 01/01: [maven-release-plugin] prepare for next development iteration
This is an automated email from the ASF dual-hosted git repository. cammckenzie pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/curator.git commit 483379dfd31f103f379c6788f54662236649e001 Author: Cam McKenzie AuthorDate: Mon Jul 19 16:10:48 2021 +1000 [maven-release-plugin] prepare for next development iteration --- curator-client/pom.xml | 4 ++-- curator-examples/pom.xml | 2 +- curator-framework/pom.xml | 4 ++-- curator-recipes/pom.xml| 4 ++-- curator-test-zk35/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(-) diff --git a/curator-client/pom.xml b/curator-client/pom.xml index 73cd5ec..6ed2145 100644 --- a/curator-client/pom.xml +++ b/curator-client/pom.xml @@ -23,11 +23,11 @@ org.apache.curator apache-curator -5.2.0 +5.2.1-SNAPSHOT curator-client -5.2.0 +5.2.1-SNAPSHOT bundle Curator Client diff --git a/curator-examples/pom.xml b/curator-examples/pom.xml index d8d9109..eff6276 100644 --- a/curator-examples/pom.xml +++ b/curator-examples/pom.xml @@ -24,7 +24,7 @@ org.apache.curator apache-curator -5.2.0 +5.2.1-SNAPSHOT curator-examples diff --git a/curator-framework/pom.xml b/curator-framework/pom.xml index 31afd73..867b14c 100644 --- a/curator-framework/pom.xml +++ b/curator-framework/pom.xml @@ -24,11 +24,11 @@ org.apache.curator apache-curator -5.2.0 +5.2.1-SNAPSHOT curator-framework -5.2.0 +5.2.1-SNAPSHOT bundle Curator Framework diff --git a/curator-recipes/pom.xml b/curator-recipes/pom.xml index 8500b8d..23d1631 100644 --- a/curator-recipes/pom.xml +++ b/curator-recipes/pom.xml @@ -24,11 +24,11 @@ org.apache.curator apache-curator -5.2.0 +5.2.1-SNAPSHOT curator-recipes -5.2.0 +5.2.1-SNAPSHOT bundle Curator Recipes diff --git a/curator-test-zk35/pom.xml b/curator-test-zk35/pom.xml index e0f7583..62a294f 100644 --- a/curator-test-zk35/pom.xml +++ b/curator-test-zk35/pom.xml @@ -20,7 +20,7 @@ org.apache.curator apache-curator -5.2.0 +5.2.1-SNAPSHOT 4.0.0 diff --git a/curator-test/pom.xml b/curator-test/pom.xml index 7f4e396..5d4d8a4 100644 --- a/curator-test/pom.xml +++ b/curator-test/pom.xml @@ -24,11 +24,11 @@ org.apache.curator apache-curator -5.2.0 +5.2.1-SNAPSHOT curator-test -5.2.0 +5.2.1-SNAPSHOT Curator Testing Unit testing utilities. diff --git a/curator-x-async/pom.xml b/curator-x-async/pom.xml index 81ffdc4..b07a730 100644 --- a/curator-x-async/pom.xml +++ b/curator-x-async/pom.xml @@ -3,7 +3,7 @@ org.apache.curator apache-curator -5.2.0 +5.2.1-SNAPSHOT 4.0.0 diff --git a/curator-x-discovery-server/pom.xml b/curator-x-discovery-server/pom.xml index 2729d80..5d58b03 100644 --- a/curator-x-discovery-server/pom.xml +++ b/curator-x-discovery-server/pom.xml @@ -24,11 +24,11 @@ org.apache.curator apache-curator -5.2.0 +5.2.1-SNAPSHOT curator-x-discovery-server -5.2.0 +5.2.1-SNAPSHOT bundle Curator Service Discovery Server diff --git a/curator-x-discovery/pom.xml b/curator-x-discovery/pom.xml index ff5e405..a4453c2 100644 --- a/curator-x-discovery/pom.xml +++ b/curator-x-discovery/pom.xml @@ -24,11 +24,11 @@ org.apache.curator apache-curator -5.2.0 +5.2.1-SNAPSHOT curator-x-discovery -5.2.0 +5.2.1-SNAPSHOT bundle Curator Service Discovery diff --git a/pom.xml b/pom.xml index 8a76ba0..b79aa6e 100644 --- a/pom.xml +++ b/pom.xml @@ -28,7 +28,7 @@ org.apache.curator apache-curator -5.2.0 +5.2.1-SNAPSHOT pom Apache Curator @@ -117,7 +117,7 @@ scm:git:https://gitbox.apache.org/repos/asf/curator.git scm:git:https://gitbox.apache.org/repos/asf/curator.git -apache-curator-5.2.0 +apache-curator-3.2.0
svn commit: r48912 - in /dev/curator: 5.1.0/ 5.2.0/ 5.2.0/apache-curator-5.2.0-source-release.zip 5.2.0/apache-curator-5.2.0-source-release.zip.asc 5.2.0/apache-curator-5.2.0-source-release.zip.sha512
Author: cammckenzie Date: Tue Jul 20 22:18:44 2021 New Revision: 48912 Log: Adding 5.2.0 artefacts Added: dev/curator/5.2.0/ dev/curator/5.2.0/apache-curator-5.2.0-source-release.zip (with props) dev/curator/5.2.0/apache-curator-5.2.0-source-release.zip.asc (with props) dev/curator/5.2.0/apache-curator-5.2.0-source-release.zip.sha512 (with props) Removed: dev/curator/5.1.0/ Added: dev/curator/5.2.0/apache-curator-5.2.0-source-release.zip == Binary file - no diff available. Propchange: dev/curator/5.2.0/apache-curator-5.2.0-source-release.zip -- svn:executable = * Propchange: dev/curator/5.2.0/apache-curator-5.2.0-source-release.zip -- svn:mime-type = application/octet-stream Added: dev/curator/5.2.0/apache-curator-5.2.0-source-release.zip.asc == --- dev/curator/5.2.0/apache-curator-5.2.0-source-release.zip.asc (added) +++ dev/curator/5.2.0/apache-curator-5.2.0-source-release.zip.asc Tue Jul 20 22:18:44 2021 @@ -0,0 +1,17 @@ +-BEGIN PGP SIGNATURE- +Comment: GPGTools - https://gpgtools.org + +iQIzBAABCgAdFiEE5EQn/bG6ZUkD0y1vbXuId9kd+4kFAmD1FzEACgkQbXuId9kd ++4nZpQ//W+Q3gQaT4AIAet0n83h3IBIVTG4GozItCGiUuqK7YOnSo9fS1t4gUdom +s+o++awiOJHGHr4UKXSZibmFGEy0YNlcu7YDAI7b7tPHQdmSD6XddsWazMTaLuHF +0Tzpj0iSoL1mrDvJ8KbLgXcAwaOwNf6mPzRcydRRD81kNJsKreLxa3qDwFLOAtIq +U66Z/tVIqrfChT0eTdHM8zTzG65JvKEsn6WAwojTECNDI575ZO/h7COIoIQSBnJy +kxy2F/HcmazF4ZATjbGqHq8Qe5RuTGj0LW5WkFkwpbwYviY3dpXnsktUdpL7W5EQ +OjW9L1sa9/xJcMjN64IgolINDn20zvoeVA5fcedD8csnsbpqfJv3xxhWlYqGrg7S +MoREr7wvbdukqNmwhQIx9yRXgVWPRRscJESuzuKWuDAi1FSXs3BdkeZxlpdLI9Br +79bc7USFHN7EsGWawMFwTjt70EjpFjmKaHI9YD/fblvOTzlg/CqscHvEtfXkK8DN +NBNQedJk/XC8CZ7eqPFG33ymhdKrCVwV54UramuPnOE1B6Pj7UjdjiiEt0V7AEKV +91Hz+mfL2kYpVI7JVxr+1xhi37xHbIme5MauTIyhVuLtpI0fZwEjy6n+pxm/q7YU +7CJdEk40CNqVZnN4NLWihLcvhaKe3hPSbiaQtaRoU4VtKnPKC60= +=N4J1 +-END PGP SIGNATURE- Propchange: dev/curator/5.2.0/apache-curator-5.2.0-source-release.zip.asc -- svn:executable = * Added: dev/curator/5.2.0/apache-curator-5.2.0-source-release.zip.sha512 == --- dev/curator/5.2.0/apache-curator-5.2.0-source-release.zip.sha512 (added) +++ dev/curator/5.2.0/apache-curator-5.2.0-source-release.zip.sha512 Tue Jul 20 22:18:44 2021 @@ -0,0 +1 @@ +6b81f38c11fdcbaeec4b6f5f209f2f586fc0cb4a8aa332d957d59c8378147f9b1ed93da5435769e8c44530129b4f07bcdea7fbe689429669a635ebf7e0d212ba \ No newline at end of file Propchange: dev/curator/5.2.0/apache-curator-5.2.0-source-release.zip.sha512 -- svn:executable = *
svn commit: r48873 - in /release/curator/5.2.0: ./ apache-curator-5.2.0-source-release.zip apache-curator-5.2.0-source-release.zip.asc apache-curator-5.2.0-source-release.zip.sha512
Author: cammckenzie Date: Mon Jul 19 07:40:25 2021 New Revision: 48873 Log: 5.2.0 artefacts Added: release/curator/5.2.0/ release/curator/5.2.0/apache-curator-5.2.0-source-release.zip (with props) release/curator/5.2.0/apache-curator-5.2.0-source-release.zip.asc (with props) release/curator/5.2.0/apache-curator-5.2.0-source-release.zip.sha512 (with props) Added: release/curator/5.2.0/apache-curator-5.2.0-source-release.zip == Binary file - no diff available. Propchange: release/curator/5.2.0/apache-curator-5.2.0-source-release.zip -- svn:executable = * Propchange: release/curator/5.2.0/apache-curator-5.2.0-source-release.zip -- svn:mime-type = application/octet-stream Added: release/curator/5.2.0/apache-curator-5.2.0-source-release.zip.asc == --- release/curator/5.2.0/apache-curator-5.2.0-source-release.zip.asc (added) +++ release/curator/5.2.0/apache-curator-5.2.0-source-release.zip.asc Mon Jul 19 07:40:25 2021 @@ -0,0 +1,17 @@ +-BEGIN PGP SIGNATURE- +Comment: GPGTools - https://gpgtools.org + +iQIzBAABCgAdFiEE5EQn/bG6ZUkD0y1vbXuId9kd+4kFAmD1FzEACgkQbXuId9kd ++4nZpQ//W+Q3gQaT4AIAet0n83h3IBIVTG4GozItCGiUuqK7YOnSo9fS1t4gUdom +s+o++awiOJHGHr4UKXSZibmFGEy0YNlcu7YDAI7b7tPHQdmSD6XddsWazMTaLuHF +0Tzpj0iSoL1mrDvJ8KbLgXcAwaOwNf6mPzRcydRRD81kNJsKreLxa3qDwFLOAtIq +U66Z/tVIqrfChT0eTdHM8zTzG65JvKEsn6WAwojTECNDI575ZO/h7COIoIQSBnJy +kxy2F/HcmazF4ZATjbGqHq8Qe5RuTGj0LW5WkFkwpbwYviY3dpXnsktUdpL7W5EQ +OjW9L1sa9/xJcMjN64IgolINDn20zvoeVA5fcedD8csnsbpqfJv3xxhWlYqGrg7S +MoREr7wvbdukqNmwhQIx9yRXgVWPRRscJESuzuKWuDAi1FSXs3BdkeZxlpdLI9Br +79bc7USFHN7EsGWawMFwTjt70EjpFjmKaHI9YD/fblvOTzlg/CqscHvEtfXkK8DN +NBNQedJk/XC8CZ7eqPFG33ymhdKrCVwV54UramuPnOE1B6Pj7UjdjiiEt0V7AEKV +91Hz+mfL2kYpVI7JVxr+1xhi37xHbIme5MauTIyhVuLtpI0fZwEjy6n+pxm/q7YU +7CJdEk40CNqVZnN4NLWihLcvhaKe3hPSbiaQtaRoU4VtKnPKC60= +=N4J1 +-END PGP SIGNATURE- Propchange: release/curator/5.2.0/apache-curator-5.2.0-source-release.zip.asc -- svn:executable = * Added: release/curator/5.2.0/apache-curator-5.2.0-source-release.zip.sha512 == --- release/curator/5.2.0/apache-curator-5.2.0-source-release.zip.sha512 (added) +++ release/curator/5.2.0/apache-curator-5.2.0-source-release.zip.sha512 Mon Jul 19 07:40:25 2021 @@ -0,0 +1 @@ +6b81f38c11fdcbaeec4b6f5f209f2f586fc0cb4a8aa332d957d59c8378147f9b1ed93da5435769e8c44530129b4f07bcdea7fbe689429669a635ebf7e0d212ba \ No newline at end of file Propchange: release/curator/5.2.0/apache-curator-5.2.0-source-release.zip.sha512 -- svn:executable = *
[curator] annotated tag apache-curator-5.2.0 created (now 56e57c5)
This is an automated email from the ASF dual-hosted git repository. cammckenzie pushed a change to annotated tag apache-curator-5.2.0 in repository https://gitbox.apache.org/repos/asf/curator.git. at 56e57c5 (tag) tagging c1746faeeba88ae1df2340f0b492ac1c46306242 (commit) replaces apache.curator-5.1.0 by Cam McKenzie on Mon Jul 19 16:10:48 2021 +1000 - Log - [maven-release-plugin] copy for tag apache-curator-5.2.0 --- This annotated tag includes the following new commits: new c1746fa [maven-release-plugin] prepare release apache-curator-5.2.0 The 1 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference.
[curator] 01/01: [maven-release-plugin] prepare release apache-curator-5.2.0
This is an automated email from the ASF dual-hosted git repository. cammckenzie pushed a commit to annotated tag apache-curator-5.2.0 in repository https://gitbox.apache.org/repos/asf/curator.git commit c1746faeeba88ae1df2340f0b492ac1c46306242 Author: Cam McKenzie AuthorDate: Mon Jul 19 16:10:37 2021 +1000 [maven-release-plugin] prepare release apache-curator-5.2.0 --- curator-client/pom.xml | 4 ++-- curator-examples/pom.xml | 2 +- curator-framework/pom.xml | 4 ++-- curator-recipes/pom.xml| 4 ++-- curator-test-zk35/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(-) diff --git a/curator-client/pom.xml b/curator-client/pom.xml index a401fb6..73cd5ec 100644 --- a/curator-client/pom.xml +++ b/curator-client/pom.xml @@ -23,11 +23,11 @@ org.apache.curator apache-curator -5.1.1-SNAPSHOT +5.2.0 curator-client -5.1.1-SNAPSHOT +5.2.0 bundle Curator Client diff --git a/curator-examples/pom.xml b/curator-examples/pom.xml index 32bed31..d8d9109 100644 --- a/curator-examples/pom.xml +++ b/curator-examples/pom.xml @@ -24,7 +24,7 @@ org.apache.curator apache-curator -5.1.1-SNAPSHOT +5.2.0 curator-examples diff --git a/curator-framework/pom.xml b/curator-framework/pom.xml index 2681dfa..31afd73 100644 --- a/curator-framework/pom.xml +++ b/curator-framework/pom.xml @@ -24,11 +24,11 @@ org.apache.curator apache-curator -5.1.1-SNAPSHOT +5.2.0 curator-framework -5.1.1-SNAPSHOT +5.2.0 bundle Curator Framework diff --git a/curator-recipes/pom.xml b/curator-recipes/pom.xml index 8cd2e51..8500b8d 100644 --- a/curator-recipes/pom.xml +++ b/curator-recipes/pom.xml @@ -24,11 +24,11 @@ org.apache.curator apache-curator -5.1.1-SNAPSHOT +5.2.0 curator-recipes -5.1.1-SNAPSHOT +5.2.0 bundle Curator Recipes diff --git a/curator-test-zk35/pom.xml b/curator-test-zk35/pom.xml index 2abfe90..e0f7583 100644 --- a/curator-test-zk35/pom.xml +++ b/curator-test-zk35/pom.xml @@ -20,7 +20,7 @@ org.apache.curator apache-curator -5.1.1-SNAPSHOT +5.2.0 4.0.0 diff --git a/curator-test/pom.xml b/curator-test/pom.xml index 6547998..7f4e396 100644 --- a/curator-test/pom.xml +++ b/curator-test/pom.xml @@ -24,11 +24,11 @@ org.apache.curator apache-curator -5.1.1-SNAPSHOT +5.2.0 curator-test -5.1.1-SNAPSHOT +5.2.0 Curator Testing Unit testing utilities. diff --git a/curator-x-async/pom.xml b/curator-x-async/pom.xml index 3571438..81ffdc4 100644 --- a/curator-x-async/pom.xml +++ b/curator-x-async/pom.xml @@ -3,7 +3,7 @@ org.apache.curator apache-curator -5.1.1-SNAPSHOT +5.2.0 4.0.0 diff --git a/curator-x-discovery-server/pom.xml b/curator-x-discovery-server/pom.xml index 6ea4c06..2729d80 100644 --- a/curator-x-discovery-server/pom.xml +++ b/curator-x-discovery-server/pom.xml @@ -24,11 +24,11 @@ org.apache.curator apache-curator -5.1.1-SNAPSHOT +5.2.0 curator-x-discovery-server -5.1.1-SNAPSHOT +5.2.0 bundle Curator Service Discovery Server diff --git a/curator-x-discovery/pom.xml b/curator-x-discovery/pom.xml index b4e369e..ff5e405 100644 --- a/curator-x-discovery/pom.xml +++ b/curator-x-discovery/pom.xml @@ -24,11 +24,11 @@ org.apache.curator apache-curator -5.1.1-SNAPSHOT +5.2.0 curator-x-discovery -5.1.1-SNAPSHOT +5.2.0 bundle Curator Service Discovery diff --git a/pom.xml b/pom.xml index 12a7369..8a76ba0 100644 --- a/pom.xml +++ b/pom.xml @@ -28,7 +28,7 @@ org.apache.curator apache-curator -5.1.1-SNAPSHOT +5.2.0 pom Apache Curator @@ -117,7 +117,7 @@ scm:git:https://gitbox.apache.org/repos/asf/curator.git scm:git:https://gitbox.apache.org/repos/asf/curator.git -apache-curator-3.2.0 +apache-curator-5.2.0
[curator] 02/03: Merge branch 'master' of https://github.com/apache/curator
This is an automated email from the ASF dual-hosted git repository. cammckenzie pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/curator.git commit 35bd0cbe26dfc52bdc0a22ab49dd7b7d94d65f28 Merge: a4ddf2b 751724b Author: Cam McKenzie AuthorDate: Wed Jun 3 11:00:29 2020 +1000 Merge branch 'master' of https://github.com/apache/curator README.md | 12 1 file changed, 8 insertions(+), 4 deletions(-)
[curator] 01/03: [maven-release-plugin] prepare for next development iteration
This is an automated email from the ASF dual-hosted git repository. cammckenzie pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/curator.git commit a4ddf2bcc3f2f9d961f47d41b2a9d055b2c8b76b Author: Cameron McKenzie AuthorDate: Mon May 18 12:43:58 2020 +1000 [maven-release-plugin] prepare for next development iteration --- curator-client/pom.xml | 4 ++-- curator-examples/pom.xml | 2 +- curator-framework/pom.xml | 4 ++-- curator-recipes/pom.xml| 4 ++-- curator-test-zk35/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(-) diff --git a/curator-client/pom.xml b/curator-client/pom.xml index 769ffad..2d51494 100644 --- a/curator-client/pom.xml +++ b/curator-client/pom.xml @@ -23,11 +23,11 @@ org.apache.curator apache-curator -5.0.0 +5.0.1-SNAPSHOT curator-client -5.0.0 +5.0.1-SNAPSHOT bundle Curator Client diff --git a/curator-examples/pom.xml b/curator-examples/pom.xml index 03ee78d..4c6dd0d 100644 --- a/curator-examples/pom.xml +++ b/curator-examples/pom.xml @@ -24,7 +24,7 @@ org.apache.curator apache-curator -5.0.0 +5.0.1-SNAPSHOT curator-examples diff --git a/curator-framework/pom.xml b/curator-framework/pom.xml index a4fd346..fc76372 100644 --- a/curator-framework/pom.xml +++ b/curator-framework/pom.xml @@ -24,11 +24,11 @@ org.apache.curator apache-curator -5.0.0 +5.0.1-SNAPSHOT curator-framework -5.0.0 +5.0.1-SNAPSHOT bundle Curator Framework diff --git a/curator-recipes/pom.xml b/curator-recipes/pom.xml index 14f3a44..e606b06 100644 --- a/curator-recipes/pom.xml +++ b/curator-recipes/pom.xml @@ -24,11 +24,11 @@ org.apache.curator apache-curator -5.0.0 +5.0.1-SNAPSHOT curator-recipes -5.0.0 +5.0.1-SNAPSHOT bundle Curator Recipes diff --git a/curator-test-zk35/pom.xml b/curator-test-zk35/pom.xml index 31df2f6..4cd7ca2 100644 --- a/curator-test-zk35/pom.xml +++ b/curator-test-zk35/pom.xml @@ -20,7 +20,7 @@ org.apache.curator apache-curator -5.0.0 +5.0.1-SNAPSHOT 4.0.0 diff --git a/curator-test/pom.xml b/curator-test/pom.xml index 01a36f6..cbe3671 100644 --- a/curator-test/pom.xml +++ b/curator-test/pom.xml @@ -24,11 +24,11 @@ org.apache.curator apache-curator -5.0.0 +5.0.1-SNAPSHOT curator-test -5.0.0 +5.0.1-SNAPSHOT Curator Testing Unit testing utilities. diff --git a/curator-x-async/pom.xml b/curator-x-async/pom.xml index 8c2370a..d1caf4a 100644 --- a/curator-x-async/pom.xml +++ b/curator-x-async/pom.xml @@ -3,7 +3,7 @@ org.apache.curator apache-curator -5.0.0 +5.0.1-SNAPSHOT 4.0.0 diff --git a/curator-x-discovery-server/pom.xml b/curator-x-discovery-server/pom.xml index bc8af5b..7abec63 100644 --- a/curator-x-discovery-server/pom.xml +++ b/curator-x-discovery-server/pom.xml @@ -24,11 +24,11 @@ org.apache.curator apache-curator -5.0.0 +5.0.1-SNAPSHOT curator-x-discovery-server -5.0.0 +5.0.1-SNAPSHOT bundle Curator Service Discovery Server diff --git a/curator-x-discovery/pom.xml b/curator-x-discovery/pom.xml index 8aeac36..e19441d 100644 --- a/curator-x-discovery/pom.xml +++ b/curator-x-discovery/pom.xml @@ -24,11 +24,11 @@ org.apache.curator apache-curator -5.0.0 +5.0.1-SNAPSHOT curator-x-discovery -5.0.0 +5.0.1-SNAPSHOT bundle Curator Service Discovery diff --git a/pom.xml b/pom.xml index 11d4107..ffd8385 100644 --- a/pom.xml +++ b/pom.xml @@ -28,7 +28,7 @@ org.apache.curator apache-curator -5.0.0 +5.0.1-SNAPSHOT pom Apache Curator @@ -107,7 +107,7 @@ scm:git:https://gitbox.apache.org/repos/asf/curator.git scm:git:https://gitbox.apache.org/repos/asf/curator.git -apache-curator-5.0.0 +apache-curator-3.2.0
[curator] 03/03: Merge branch 'master' of https://github.com/apache/curator
This is an automated email from the ASF dual-hosted git repository. cammckenzie pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/curator.git commit 2d54d92e106b748d2da1451f5cbe42127441c9e7 Merge: 35bd0cb 095deaf Author: Cam McKenzie AuthorDate: Tue Jun 16 08:11:43 2020 +1000 Merge branch 'master' of https://github.com/apache/curator pom.xml | 12 1 file changed, 12 insertions(+)
[curator] branch master updated (095deaf -> 2d54d92)
This is an automated email from the ASF dual-hosted git repository. cammckenzie pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/curator.git. from 095deaf Add Enrico Olivelli as Committer and PMC add e0bb2fb [maven-release-plugin] prepare release apache-curator-5.0.0 new a4ddf2b [maven-release-plugin] prepare for next development iteration new 35bd0cb Merge branch 'master' of https://github.com/apache/curator new 2d54d92 Merge branch 'master' of https://github.com/apache/curator The 3 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: curator-client/pom.xml | 4 ++-- curator-examples/pom.xml | 2 +- curator-framework/pom.xml | 4 ++-- curator-recipes/pom.xml| 4 ++-- curator-test-zk35/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| 20 ++-- 10 files changed, 25 insertions(+), 25 deletions(-)
svn commit: r39812 - in /release/curator/5.0.0: ./ apache-curator-5.0.0-source-release.zip apache-curator-5.0.0-source-release.zip.asc apache-curator-5.0.0-source-release.zip.sha512
Author: cammckenzie Date: Thu May 28 23:02:12 2020 New Revision: 39812 Log: 5.0.0 release Added: release/curator/5.0.0/ release/curator/5.0.0/apache-curator-5.0.0-source-release.zip (with props) release/curator/5.0.0/apache-curator-5.0.0-source-release.zip.asc (with props) release/curator/5.0.0/apache-curator-5.0.0-source-release.zip.sha512 (with props) Added: release/curator/5.0.0/apache-curator-5.0.0-source-release.zip == Binary file - no diff available. Propchange: release/curator/5.0.0/apache-curator-5.0.0-source-release.zip -- svn:executable = * Propchange: release/curator/5.0.0/apache-curator-5.0.0-source-release.zip -- svn:mime-type = application/octet-stream Added: release/curator/5.0.0/apache-curator-5.0.0-source-release.zip.asc == --- release/curator/5.0.0/apache-curator-5.0.0-source-release.zip.asc (added) +++ release/curator/5.0.0/apache-curator-5.0.0-source-release.zip.asc Thu May 28 23:02:12 2020 @@ -0,0 +1,18 @@ +-BEGIN PGP SIGNATURE- +Version: GnuPG v1 +Comment: GPGTools - https://gpgtools.org + +iQIcBAABCgAGBQJewe9fAAoJEG17iHfZHfuJNDoP/iaXQQFPinwScMIYeimand3l +jwa7yzRyyFF7CkgdJhS/lc55aWaFvqVwUF4eBAtcEXauv9tlvdelUu7VWbzB+H51 +fD44OxwQ1toN7skYFyH6r85OiSotmVCSE9FYTZwcergxMLSO2j7ohz1aZAJbNk4W +nirZgIQQQ/pQJDJJYh7kHdOSyblgkRmBqu+SzssxyrwkElNbbLj1urwNb07IilyE +NmsoZUsf+l9hvoBYsgoKzS73OMwsw0M/1XYmndFI4+cdqxi0V9Br25o33rVA4DV9 +ZRGv3AmbH82tluQ8IQ5LKLiMmLqKJiU9+nhz8UUZGxglolYE4RDqxfz43ZmeAI2t +3YZpvG5oOuwOb1i9PSzbhMkMOqVR0Fs8s+smr2Q1T0CdeycaJ75xwOymYA7XK4zj +kODPLALAM/r39W57oFMUK9ASOHDBUfeSNGvu9N3voCGiagQJdmCVTc8GhoTqkdnZ +/YcrIz+w/MhpZV5Fjk25VXOOnRE3JDobVPqQ+PYyR9a1vdDEj7FHGby8UP+cQQAd +tG7k8A8VfPZlqEsYvNqIeH9trwBvyHOjSEtlzPpcPIgKEe8Z8G03qG7iVR9HBUVe +2vEZ5wb3goigEm0NYx8/Lq63W3Hd6cpekBIC8/G3ykM/YLRGVMb6m0SE9JukTBs+ +NjHfdQeirWaZVxLKk9EL +=ZuCg +-END PGP SIGNATURE- Propchange: release/curator/5.0.0/apache-curator-5.0.0-source-release.zip.asc -- svn:executable = * Added: release/curator/5.0.0/apache-curator-5.0.0-source-release.zip.sha512 == --- release/curator/5.0.0/apache-curator-5.0.0-source-release.zip.sha512 (added) +++ release/curator/5.0.0/apache-curator-5.0.0-source-release.zip.sha512 Thu May 28 23:02:12 2020 @@ -0,0 +1 @@ +439d5b945fd9ef4d1a9dfd0dddb68f383240aa90dc31dba3c727e0908dda138cd5b8f7de144116fdcb604fa2973b0cafbc26cf6174c1f6e3059a1557c00f2488 \ No newline at end of file Propchange: release/curator/5.0.0/apache-curator-5.0.0-source-release.zip.sha512 -- svn:executable = *
svn commit: r39669 - in /dev/curator: 4.3.0/ 5.0.0/ 5.0.0/apache-curator-5.0.0-source-release.zip 5.0.0/apache-curator-5.0.0-source-release.zip.asc 5.0.0/apache-curator-5.0.0-source-release.zip.sha512
Author: cammckenzie Date: Tue May 19 00:45:57 2020 New Revision: 39669 Log: Adding 5.0.0 release Added: dev/curator/5.0.0/ dev/curator/5.0.0/apache-curator-5.0.0-source-release.zip (with props) dev/curator/5.0.0/apache-curator-5.0.0-source-release.zip.asc (with props) dev/curator/5.0.0/apache-curator-5.0.0-source-release.zip.sha512 (with props) Removed: dev/curator/4.3.0/ Added: dev/curator/5.0.0/apache-curator-5.0.0-source-release.zip == Binary file - no diff available. Propchange: dev/curator/5.0.0/apache-curator-5.0.0-source-release.zip -- svn:executable = * Propchange: dev/curator/5.0.0/apache-curator-5.0.0-source-release.zip -- svn:mime-type = application/octet-stream Added: dev/curator/5.0.0/apache-curator-5.0.0-source-release.zip.asc == --- dev/curator/5.0.0/apache-curator-5.0.0-source-release.zip.asc (added) +++ dev/curator/5.0.0/apache-curator-5.0.0-source-release.zip.asc Tue May 19 00:45:57 2020 @@ -0,0 +1,18 @@ +-BEGIN PGP SIGNATURE- +Version: GnuPG v1 +Comment: GPGTools - https://gpgtools.org + +iQIcBAABCgAGBQJewe9fAAoJEG17iHfZHfuJNDoP/iaXQQFPinwScMIYeimand3l +jwa7yzRyyFF7CkgdJhS/lc55aWaFvqVwUF4eBAtcEXauv9tlvdelUu7VWbzB+H51 +fD44OxwQ1toN7skYFyH6r85OiSotmVCSE9FYTZwcergxMLSO2j7ohz1aZAJbNk4W +nirZgIQQQ/pQJDJJYh7kHdOSyblgkRmBqu+SzssxyrwkElNbbLj1urwNb07IilyE +NmsoZUsf+l9hvoBYsgoKzS73OMwsw0M/1XYmndFI4+cdqxi0V9Br25o33rVA4DV9 +ZRGv3AmbH82tluQ8IQ5LKLiMmLqKJiU9+nhz8UUZGxglolYE4RDqxfz43ZmeAI2t +3YZpvG5oOuwOb1i9PSzbhMkMOqVR0Fs8s+smr2Q1T0CdeycaJ75xwOymYA7XK4zj +kODPLALAM/r39W57oFMUK9ASOHDBUfeSNGvu9N3voCGiagQJdmCVTc8GhoTqkdnZ +/YcrIz+w/MhpZV5Fjk25VXOOnRE3JDobVPqQ+PYyR9a1vdDEj7FHGby8UP+cQQAd +tG7k8A8VfPZlqEsYvNqIeH9trwBvyHOjSEtlzPpcPIgKEe8Z8G03qG7iVR9HBUVe +2vEZ5wb3goigEm0NYx8/Lq63W3Hd6cpekBIC8/G3ykM/YLRGVMb6m0SE9JukTBs+ +NjHfdQeirWaZVxLKk9EL +=ZuCg +-END PGP SIGNATURE- Propchange: dev/curator/5.0.0/apache-curator-5.0.0-source-release.zip.asc -- svn:executable = * Added: dev/curator/5.0.0/apache-curator-5.0.0-source-release.zip.sha512 == --- dev/curator/5.0.0/apache-curator-5.0.0-source-release.zip.sha512 (added) +++ dev/curator/5.0.0/apache-curator-5.0.0-source-release.zip.sha512 Tue May 19 00:45:57 2020 @@ -0,0 +1 @@ +439d5b945fd9ef4d1a9dfd0dddb68f383240aa90dc31dba3c727e0908dda138cd5b8f7de144116fdcb604fa2973b0cafbc26cf6174c1f6e3059a1557c00f2488 \ No newline at end of file Propchange: dev/curator/5.0.0/apache-curator-5.0.0-source-release.zip.sha512 -- svn:executable = *
[curator] annotated tag apache-curator-5.0.0 updated (e0bb2fb -> b34ea9e)
This is an automated email from the ASF dual-hosted git repository. cammckenzie pushed a change to annotated tag apache-curator-5.0.0 in repository https://gitbox.apache.org/repos/asf/curator.git. *** WARNING: tag apache-curator-5.0.0 was modified! *** from e0bb2fb (commit) to b34ea9e (tag) tagging e0bb2fb251dd0ad3a75d829ad94d6f9e02c5461c (commit) replaces apache-curator-4.2.0 by Cameron McKenzie on Mon May 18 12:43:58 2020 +1000 - Log - [maven-release-plugin] copy for tag apache-curator-5.0.0 --- No new revisions were added by this update. Summary of changes:
[curator] 01/01: [maven-release-plugin] prepare release apache-curator-4.3.0-SNAPSHOT
This is an automated email from the ASF dual-hosted git repository. cammckenzie pushed a commit to annotated tag apache-curator-4.3.0 in repository https://gitbox.apache.org/repos/asf/curator.git commit b78d28bdaf15553a850849352324feae7218f99c Author: Cam McKenzie AuthorDate: Mon Feb 24 10:00:07 2020 +1100 [maven-release-plugin] prepare release apache-curator-4.3.0-SNAPSHOT --- 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(-) diff --git a/curator-client/pom.xml b/curator-client/pom.xml index 27238e7..b511dbe 100644 --- a/curator-client/pom.xml +++ b/curator-client/pom.xml @@ -23,11 +23,11 @@ org.apache.curator apache-curator -4.2.1-SNAPSHOT +4.3.0 curator-client -4.2.1-SNAPSHOT +4.3.0 bundle Curator Client diff --git a/curator-examples/pom.xml b/curator-examples/pom.xml index 7d6ffb9..3ff58ea 100644 --- a/curator-examples/pom.xml +++ b/curator-examples/pom.xml @@ -24,7 +24,7 @@ org.apache.curator apache-curator -4.2.1-SNAPSHOT +4.3.0 curator-examples diff --git a/curator-framework/pom.xml b/curator-framework/pom.xml index 86bbe5f..74e7ad7 100644 --- a/curator-framework/pom.xml +++ b/curator-framework/pom.xml @@ -24,11 +24,11 @@ org.apache.curator apache-curator -4.2.1-SNAPSHOT +4.3.0 curator-framework -4.2.1-SNAPSHOT +4.3.0 bundle Curator Framework diff --git a/curator-recipes/pom.xml b/curator-recipes/pom.xml index 937cdab..b89af16 100644 --- a/curator-recipes/pom.xml +++ b/curator-recipes/pom.xml @@ -24,11 +24,11 @@ org.apache.curator apache-curator -4.2.1-SNAPSHOT +4.3.0 curator-recipes -4.2.1-SNAPSHOT +4.3.0 bundle Curator Recipes diff --git a/curator-test-zk34/pom.xml b/curator-test-zk34/pom.xml index 3d06cb0..4057067 100644 --- a/curator-test-zk34/pom.xml +++ b/curator-test-zk34/pom.xml @@ -3,7 +3,7 @@ apache-curator org.apache.curator -4.2.1-SNAPSHOT +4.3.0 4.0.0 diff --git a/curator-test/pom.xml b/curator-test/pom.xml index 3683b7d..b41b73f 100644 --- a/curator-test/pom.xml +++ b/curator-test/pom.xml @@ -24,11 +24,11 @@ org.apache.curator apache-curator -4.2.1-SNAPSHOT +4.3.0 curator-test -4.2.1-SNAPSHOT +4.3.0 Curator Testing Unit testing utilities. diff --git a/curator-x-async/pom.xml b/curator-x-async/pom.xml index 5ffd774..fc501bf 100644 --- a/curator-x-async/pom.xml +++ b/curator-x-async/pom.xml @@ -3,7 +3,7 @@ org.apache.curator apache-curator -4.2.1-SNAPSHOT +4.3.0 4.0.0 diff --git a/curator-x-discovery-server/pom.xml b/curator-x-discovery-server/pom.xml index 27a0f83..546e798 100644 --- a/curator-x-discovery-server/pom.xml +++ b/curator-x-discovery-server/pom.xml @@ -24,11 +24,11 @@ org.apache.curator apache-curator -4.2.1-SNAPSHOT +4.3.0 curator-x-discovery-server -4.2.1-SNAPSHOT +4.3.0 bundle Curator Service Discovery Server diff --git a/curator-x-discovery/pom.xml b/curator-x-discovery/pom.xml index 824231d..21ff6eb 100644 --- a/curator-x-discovery/pom.xml +++ b/curator-x-discovery/pom.xml @@ -24,11 +24,11 @@ org.apache.curator apache-curator -4.2.1-SNAPSHOT +4.3.0 curator-x-discovery -4.2.1-SNAPSHOT +4.3.0 bundle Curator Service Discovery diff --git a/pom.xml b/pom.xml index 66ae839..2aa4d7d 100644 --- a/pom.xml +++ b/pom.xml @@ -28,7 +28,7 @@ org.apache.curator apache-curator -4.2.1-SNAPSHOT +4.3.0 pom Apache Curator @@ -104,7 +104,7 @@ https://github.com/apache/curator.git scm:git:https://gitbox.apache.org/repos/asf/curator.git scm:git:https://gitbox.apache.org/repos/asf/curator.git -apache-curator-3.2.0 +apache-curator-4.3.0-SNAPSHOT
[curator] annotated tag apache-curator-4.3.0 created (now 5c51746)
This is an automated email from the ASF dual-hosted git repository. cammckenzie pushed a change to annotated tag apache-curator-4.3.0 in repository https://gitbox.apache.org/repos/asf/curator.git. at 5c51746 (tag) tagging b78d28bdaf15553a850849352324feae7218f99c (commit) replaces apache-curator-4.2.0 by Cam McKenzie on Mon Feb 24 10:00:17 2020 +1100 - Log - [maven-release-plugin] copy for tag apache-curator-4.3.0-SNAPSHOT --- This annotated tag includes the following new commits: new b78d28b [maven-release-plugin] prepare release apache-curator-4.3.0-SNAPSHOT The 1 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference.
[curator] annotated tag apache-curator-4.3.0-SNAPSHOT deleted (was 5c51746)
This is an automated email from the ASF dual-hosted git repository. cammckenzie pushed a change to annotated tag apache-curator-4.3.0-SNAPSHOT in repository https://gitbox.apache.org/repos/asf/curator.git. *** WARNING: tag apache-curator-4.3.0-SNAPSHOT was deleted! *** tag was 5c51746 This change permanently discards the following revisions: discard b78d28b [maven-release-plugin] prepare release apache-curator-4.3.0-SNAPSHOT
svn commit: r38329 - in /release/curator: 4.2.0/ 4.3.0/ 4.3.0/apache-curator-4.3.0-source-release.zip 4.3.0/apache-curator-4.3.0-source-release.zip.asc 4.3.0/apache-curator-4.3.0-source-release.zip.sh
Author: cammckenzie Date: Sat Feb 29 08:41:48 2020 New Revision: 38329 Log: Apache Curator 4.3.0 Added: release/curator/4.3.0/ release/curator/4.3.0/apache-curator-4.3.0-source-release.zip (with props) release/curator/4.3.0/apache-curator-4.3.0-source-release.zip.asc (with props) release/curator/4.3.0/apache-curator-4.3.0-source-release.zip.sha512 (with props) Removed: release/curator/4.2.0/ Added: release/curator/4.3.0/apache-curator-4.3.0-source-release.zip == Binary file - no diff available. Propchange: release/curator/4.3.0/apache-curator-4.3.0-source-release.zip -- svn:executable = * Propchange: release/curator/4.3.0/apache-curator-4.3.0-source-release.zip -- svn:mime-type = application/octet-stream Added: release/curator/4.3.0/apache-curator-4.3.0-source-release.zip.asc == --- release/curator/4.3.0/apache-curator-4.3.0-source-release.zip.asc (added) +++ release/curator/4.3.0/apache-curator-4.3.0-source-release.zip.asc Sat Feb 29 08:41:48 2020 @@ -0,0 +1,18 @@ +-BEGIN PGP SIGNATURE- +Version: GnuPG v1 +Comment: GPGTools - https://gpgtools.org + +iQIcBAABCgAGBQJeUwPAAAoJEG17iHfZHfuJjJgP/09y57Pj6E8w27/gu5eokvp/ +QVx75xXJwQ9gscoXQHJa55IQcPl2wGcz0+O3ZmPIPhzlvtGig6QHqZQVWPuwcyos +O5i5C7uWHVRGK2ceqJ/FfClvrJav/aKLtFvXVVvX4k3ESQvCAgCrUH0BuqPsRRX5 +Yy/0cJY2vmfPvYGr61dJZUVzele9dKv+cRTfAUHMdP+cjyJfuwPtdG/lMbvuUWEA +g55j74kn/A2Z5WNoNFTgQbkh5w+cibxln5Rt04hHU9iG9qhUeuUK4CdnvlkvNc6B +FuqMoTxFu6kukMNt2NiCzemyMgR1tBsx80kHPeXhhuVG592tJMaVCXm58nx35d2w +X5wYlOwY2OjUsO2IKRD/TRvaf7xNLUbdPFJHOBXIKiMCrgqiBpL1Oga9bEKreaA4 +0RIQxnFG+rAdJz1tY6RvxsorckAFV5x4YSEzCMQXDQI8BNfkddnZpWxdExu/i8mz +boCVi5YjRoVjPHp5221ySQy6i3w1RZ+XF95MRxIehpLK8tZxTuS91CepV+jSJ7BX +SohJ7Pjp4DYracj3fdU4UhCl9+oWYSTqVVdFW8YMYtPwmlQ+iWGBphCl2jWDSdFB +sGgPlIqJhPZOz+KlinJidXhrDf6Sh4VjyB6AtMUP+Y/MgoQxaawboBwSnAlpPgTd +tgftdbTv55EOokO2nUzw +=MEqL +-END PGP SIGNATURE- Propchange: release/curator/4.3.0/apache-curator-4.3.0-source-release.zip.asc -- svn:executable = * Added: release/curator/4.3.0/apache-curator-4.3.0-source-release.zip.sha512 == --- release/curator/4.3.0/apache-curator-4.3.0-source-release.zip.sha512 (added) +++ release/curator/4.3.0/apache-curator-4.3.0-source-release.zip.sha512 Sat Feb 29 08:41:48 2020 @@ -0,0 +1 @@ +4a1fa19a09d97cd2bbcea3b9d3a7dbc2ca29a0887aa9b0aa52331402827efd3cecd6161fb71bc18881ca9c5538561309534aba3e221856f91b2d1db662d69c19 \ No newline at end of file Propchange: release/curator/4.3.0/apache-curator-4.3.0-source-release.zip.sha512 -- svn:executable = *
svn commit: r38224 - in /dev/curator: 2.13.0/ 4.1.0/ 4.2.0/ 4.3.0/ 4.3.0/apache-curator-4.3.0-source-release.zip 4.3.0/apache-curator-4.3.0-source-release.zip.asc 4.3.0/apache-curator-4.3.0-source-rel
Author: cammckenzie Date: Mon Feb 24 00:48:34 2020 New Revision: 38224 Log: Curator 4.3.0 release binaries Added: dev/curator/4.3.0/ dev/curator/4.3.0/apache-curator-4.3.0-source-release.zip (with props) dev/curator/4.3.0/apache-curator-4.3.0-source-release.zip.asc (with props) dev/curator/4.3.0/apache-curator-4.3.0-source-release.zip.sha512 (with props) Removed: dev/curator/2.13.0/ dev/curator/4.1.0/ dev/curator/4.2.0/ Added: dev/curator/4.3.0/apache-curator-4.3.0-source-release.zip == Binary file - no diff available. Propchange: dev/curator/4.3.0/apache-curator-4.3.0-source-release.zip -- svn:executable = * Propchange: dev/curator/4.3.0/apache-curator-4.3.0-source-release.zip -- svn:mime-type = application/octet-stream Added: dev/curator/4.3.0/apache-curator-4.3.0-source-release.zip.asc == --- dev/curator/4.3.0/apache-curator-4.3.0-source-release.zip.asc (added) +++ dev/curator/4.3.0/apache-curator-4.3.0-source-release.zip.asc Mon Feb 24 00:48:34 2020 @@ -0,0 +1,18 @@ +-BEGIN PGP SIGNATURE- +Version: GnuPG v1 +Comment: GPGTools - https://gpgtools.org + +iQIcBAABCgAGBQJeUwPAAAoJEG17iHfZHfuJjJgP/09y57Pj6E8w27/gu5eokvp/ +QVx75xXJwQ9gscoXQHJa55IQcPl2wGcz0+O3ZmPIPhzlvtGig6QHqZQVWPuwcyos +O5i5C7uWHVRGK2ceqJ/FfClvrJav/aKLtFvXVVvX4k3ESQvCAgCrUH0BuqPsRRX5 +Yy/0cJY2vmfPvYGr61dJZUVzele9dKv+cRTfAUHMdP+cjyJfuwPtdG/lMbvuUWEA +g55j74kn/A2Z5WNoNFTgQbkh5w+cibxln5Rt04hHU9iG9qhUeuUK4CdnvlkvNc6B +FuqMoTxFu6kukMNt2NiCzemyMgR1tBsx80kHPeXhhuVG592tJMaVCXm58nx35d2w +X5wYlOwY2OjUsO2IKRD/TRvaf7xNLUbdPFJHOBXIKiMCrgqiBpL1Oga9bEKreaA4 +0RIQxnFG+rAdJz1tY6RvxsorckAFV5x4YSEzCMQXDQI8BNfkddnZpWxdExu/i8mz +boCVi5YjRoVjPHp5221ySQy6i3w1RZ+XF95MRxIehpLK8tZxTuS91CepV+jSJ7BX +SohJ7Pjp4DYracj3fdU4UhCl9+oWYSTqVVdFW8YMYtPwmlQ+iWGBphCl2jWDSdFB +sGgPlIqJhPZOz+KlinJidXhrDf6Sh4VjyB6AtMUP+Y/MgoQxaawboBwSnAlpPgTd +tgftdbTv55EOokO2nUzw +=MEqL +-END PGP SIGNATURE- Propchange: dev/curator/4.3.0/apache-curator-4.3.0-source-release.zip.asc -- svn:executable = * Added: dev/curator/4.3.0/apache-curator-4.3.0-source-release.zip.sha512 == --- dev/curator/4.3.0/apache-curator-4.3.0-source-release.zip.sha512 (added) +++ dev/curator/4.3.0/apache-curator-4.3.0-source-release.zip.sha512 Mon Feb 24 00:48:34 2020 @@ -0,0 +1 @@ +4a1fa19a09d97cd2bbcea3b9d3a7dbc2ca29a0887aa9b0aa52331402827efd3cecd6161fb71bc18881ca9c5538561309534aba3e221856f91b2d1db662d69c19 \ No newline at end of file Propchange: dev/curator/4.3.0/apache-curator-4.3.0-source-release.zip.sha512 -- svn:executable = *
[curator] 01/01: [maven-release-plugin] prepare release apache-curator-4.3.0-SNAPSHOT
This is an automated email from the ASF dual-hosted git repository. cammckenzie pushed a commit to annotated tag apache-curator-4.3.0-SNAPSHOT in repository https://gitbox.apache.org/repos/asf/curator.git commit b78d28bdaf15553a850849352324feae7218f99c Author: Cam McKenzie AuthorDate: Mon Feb 24 10:00:07 2020 +1100 [maven-release-plugin] prepare release apache-curator-4.3.0-SNAPSHOT --- 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(-) diff --git a/curator-client/pom.xml b/curator-client/pom.xml index 27238e7..b511dbe 100644 --- a/curator-client/pom.xml +++ b/curator-client/pom.xml @@ -23,11 +23,11 @@ org.apache.curator apache-curator -4.2.1-SNAPSHOT +4.3.0 curator-client -4.2.1-SNAPSHOT +4.3.0 bundle Curator Client diff --git a/curator-examples/pom.xml b/curator-examples/pom.xml index 7d6ffb9..3ff58ea 100644 --- a/curator-examples/pom.xml +++ b/curator-examples/pom.xml @@ -24,7 +24,7 @@ org.apache.curator apache-curator -4.2.1-SNAPSHOT +4.3.0 curator-examples diff --git a/curator-framework/pom.xml b/curator-framework/pom.xml index 86bbe5f..74e7ad7 100644 --- a/curator-framework/pom.xml +++ b/curator-framework/pom.xml @@ -24,11 +24,11 @@ org.apache.curator apache-curator -4.2.1-SNAPSHOT +4.3.0 curator-framework -4.2.1-SNAPSHOT +4.3.0 bundle Curator Framework diff --git a/curator-recipes/pom.xml b/curator-recipes/pom.xml index 937cdab..b89af16 100644 --- a/curator-recipes/pom.xml +++ b/curator-recipes/pom.xml @@ -24,11 +24,11 @@ org.apache.curator apache-curator -4.2.1-SNAPSHOT +4.3.0 curator-recipes -4.2.1-SNAPSHOT +4.3.0 bundle Curator Recipes diff --git a/curator-test-zk34/pom.xml b/curator-test-zk34/pom.xml index 3d06cb0..4057067 100644 --- a/curator-test-zk34/pom.xml +++ b/curator-test-zk34/pom.xml @@ -3,7 +3,7 @@ apache-curator org.apache.curator -4.2.1-SNAPSHOT +4.3.0 4.0.0 diff --git a/curator-test/pom.xml b/curator-test/pom.xml index 3683b7d..b41b73f 100644 --- a/curator-test/pom.xml +++ b/curator-test/pom.xml @@ -24,11 +24,11 @@ org.apache.curator apache-curator -4.2.1-SNAPSHOT +4.3.0 curator-test -4.2.1-SNAPSHOT +4.3.0 Curator Testing Unit testing utilities. diff --git a/curator-x-async/pom.xml b/curator-x-async/pom.xml index 5ffd774..fc501bf 100644 --- a/curator-x-async/pom.xml +++ b/curator-x-async/pom.xml @@ -3,7 +3,7 @@ org.apache.curator apache-curator -4.2.1-SNAPSHOT +4.3.0 4.0.0 diff --git a/curator-x-discovery-server/pom.xml b/curator-x-discovery-server/pom.xml index 27a0f83..546e798 100644 --- a/curator-x-discovery-server/pom.xml +++ b/curator-x-discovery-server/pom.xml @@ -24,11 +24,11 @@ org.apache.curator apache-curator -4.2.1-SNAPSHOT +4.3.0 curator-x-discovery-server -4.2.1-SNAPSHOT +4.3.0 bundle Curator Service Discovery Server diff --git a/curator-x-discovery/pom.xml b/curator-x-discovery/pom.xml index 824231d..21ff6eb 100644 --- a/curator-x-discovery/pom.xml +++ b/curator-x-discovery/pom.xml @@ -24,11 +24,11 @@ org.apache.curator apache-curator -4.2.1-SNAPSHOT +4.3.0 curator-x-discovery -4.2.1-SNAPSHOT +4.3.0 bundle Curator Service Discovery diff --git a/pom.xml b/pom.xml index 66ae839..2aa4d7d 100644 --- a/pom.xml +++ b/pom.xml @@ -28,7 +28,7 @@ org.apache.curator apache-curator -4.2.1-SNAPSHOT +4.3.0 pom Apache Curator @@ -104,7 +104,7 @@ https://github.com/apache/curator.git scm:git:https://gitbox.apache.org/repos/asf/curator.git scm:git:https://gitbox.apache.org/repos/asf/curator.git -apache-curator-3.2.0 +apache-curator-4.3.0-SNAPSHOT
[curator] annotated tag apache-curator-4.3.0-SNAPSHOT created (now 5c51746)
This is an automated email from the ASF dual-hosted git repository. cammckenzie pushed a change to annotated tag apache-curator-4.3.0-SNAPSHOT in repository https://gitbox.apache.org/repos/asf/curator.git. at 5c51746 (tag) tagging b78d28bdaf15553a850849352324feae7218f99c (commit) replaces apache-curator-4.2.0 by Cam McKenzie on Mon Feb 24 10:00:17 2020 +1100 - Log - [maven-release-plugin] copy for tag apache-curator-4.3.0-SNAPSHOT --- This annotated tag includes the following new commits: new b78d28b [maven-release-plugin] prepare release apache-curator-4.3.0-SNAPSHOT The 1 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference.
[curator] branch master updated: Fix typo
This is an automated email from the ASF dual-hosted git repository. cammckenzie pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/curator.git The following commit(s) were added to refs/heads/master by this push: new c05a61b Fix typo c05a61b is described below commit c05a61bb58e5625fa3ca29871d0d9971271fcf49 Author: 康智冬 AuthorDate: Sun Jan 19 08:44:22 2020 +0800 Fix typo fix typo --- .../java/org/apache/curator/framework/recipes/cache/NodeCache.java| 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/curator-recipes/src/main/java/org/apache/curator/framework/recipes/cache/NodeCache.java b/curator-recipes/src/main/java/org/apache/curator/framework/recipes/cache/NodeCache.java index 9687e1b..e7778ff 100644 --- a/curator-recipes/src/main/java/org/apache/curator/framework/recipes/cache/NodeCache.java +++ b/curator-recipes/src/main/java/org/apache/curator/framework/recipes/cache/NodeCache.java @@ -125,7 +125,7 @@ public class NodeCache implements Closeable }; /** - * @param client curztor client + * @param client curator client * @param path the full path to the node to cache */ public NodeCache(CuratorFramework client, String path) @@ -134,7 +134,7 @@ public class NodeCache implements Closeable } /** - * @param client curztor client + * @param client curator client * @param path the full path to the node to cache * @param dataIsCompressed if true, data in the path is compressed */
[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]; -
[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
svn commit: r31328 - in /release/curator/2.13.0: ./ apache-curator-2.13.0-source-release.zip apache-curator-2.13.0-source-release.zip.asc apache-curator-2.13.0-source-release.zip.md5 apache-curator-2.
Author: cammckenzie Date: Mon Dec 3 21:12:27 2018 New Revision: 31328 Log: Adding 2.13.0 release binaries Added: release/curator/2.13.0/ release/curator/2.13.0/apache-curator-2.13.0-source-release.zip (with props) release/curator/2.13.0/apache-curator-2.13.0-source-release.zip.asc (with props) release/curator/2.13.0/apache-curator-2.13.0-source-release.zip.md5 (with props) release/curator/2.13.0/apache-curator-2.13.0-source-release.zip.sha1 (with props) Added: release/curator/2.13.0/apache-curator-2.13.0-source-release.zip == Binary file - no diff available. Propchange: release/curator/2.13.0/apache-curator-2.13.0-source-release.zip -- svn:executable = * Propchange: release/curator/2.13.0/apache-curator-2.13.0-source-release.zip -- svn:mime-type = application/octet-stream Added: release/curator/2.13.0/apache-curator-2.13.0-source-release.zip.asc == --- release/curator/2.13.0/apache-curator-2.13.0-source-release.zip.asc (added) +++ release/curator/2.13.0/apache-curator-2.13.0-source-release.zip.asc Mon Dec 3 21:12:27 2018 @@ -0,0 +1,18 @@ +-BEGIN PGP SIGNATURE- +Version: GnuPG v1 +Comment: GPGTools - https://gpgtools.org + +iQIcBAABCgAGBQJcBJZtAAoJEG17iHfZHfuJNmIP/irfGvHAbx9sZHXRQx1LA5/A +ecOANfU0n7r/x3m6ZOh508BR212xqPAQijDLGLDB3LlH8g4n+wl1zMqk0f8Ltnli +YjMW3cmBS8wmlM311SHCgvsK7+IzlfWjvinU+gO4F+QC9cWLAbw51Zu95lCh3MuE +d33q08JtxfNEXe9XMmdh2cz+zDXr++ZBwnvabGKOiVBhWC9GfJ6O+JZf3tkwtaBZ +a5UD23AvfmTJN3w6/+7zd5MBkdShFTQdxMvAEElymDNvasRJReizT0YhVkwTYXt2 +nNatwCIdEfvxxcAzaRogtd4BRgOwv24G2PFObJNhmxXBz3mvOtW8k19XVKkRLvuu +pblLTNFo+ux2t+MITyxPdZ8ZEzXQ9b9WSPrhdKo0zg68enIB5aN5HzXET0t9kwd6 +bosNOAvxEvQsKYcCO+7SDqIvChlescxbkVpzb7L7HUgnohiw0aU3eCYUAahV0nea +iKOIK6Bg1FQcVKNeg0b30/5GEny3ZwnJc9F20ibz18/qTeVsuxloA79hIFDHGPmN +6ilNavFliK9JqZQgLFCiwCWurdDJQEJxbGXE8BHDH44xv8IacG3C738nLbn7KvFS +8uDRL7s4G+Jro/4KCdSufPphIFMwDClg1+Ri+GJETmsDTl4C9HhS7BzZXBpZE/M0 +YdifHHXO7TI3ZBaDIYyw +=yXsZ +-END PGP SIGNATURE- Propchange: release/curator/2.13.0/apache-curator-2.13.0-source-release.zip.asc -- svn:executable = * Added: release/curator/2.13.0/apache-curator-2.13.0-source-release.zip.md5 == --- release/curator/2.13.0/apache-curator-2.13.0-source-release.zip.md5 (added) +++ release/curator/2.13.0/apache-curator-2.13.0-source-release.zip.md5 Mon Dec 3 21:12:27 2018 @@ -0,0 +1 @@ +9a79abbaefd0a30cf60c62bbc3569771 \ No newline at end of file Propchange: release/curator/2.13.0/apache-curator-2.13.0-source-release.zip.md5 -- svn:executable = * Added: release/curator/2.13.0/apache-curator-2.13.0-source-release.zip.sha1 == --- release/curator/2.13.0/apache-curator-2.13.0-source-release.zip.sha1 (added) +++ release/curator/2.13.0/apache-curator-2.13.0-source-release.zip.sha1 Mon Dec 3 21:12:27 2018 @@ -0,0 +1 @@ +2eef5c47268c1ee7ea9d439949a052b02c5c9fab \ No newline at end of file Propchange: release/curator/2.13.0/apache-curator-2.13.0-source-release.zip.sha1 -- svn:executable = *
svn commit: r31313 - in /dev/curator/2.13.0: ./ apache-curator-2.13.0-source-release.zip apache-curator-2.13.0-source-release.zip.asc apache-curator-2.13.0-source-release.zip.md5 apache-curator-2.13.0
Author: cammckenzie Date: Mon Dec 3 02:50:52 2018 New Revision: 31313 Log: 2.13 release Added: dev/curator/2.13.0/ dev/curator/2.13.0/apache-curator-2.13.0-source-release.zip (with props) dev/curator/2.13.0/apache-curator-2.13.0-source-release.zip.asc (with props) dev/curator/2.13.0/apache-curator-2.13.0-source-release.zip.md5 (with props) dev/curator/2.13.0/apache-curator-2.13.0-source-release.zip.sha1 (with props) Added: dev/curator/2.13.0/apache-curator-2.13.0-source-release.zip == Binary file - no diff available. Propchange: dev/curator/2.13.0/apache-curator-2.13.0-source-release.zip -- svn:executable = * Propchange: dev/curator/2.13.0/apache-curator-2.13.0-source-release.zip -- svn:mime-type = application/octet-stream Added: dev/curator/2.13.0/apache-curator-2.13.0-source-release.zip.asc == --- dev/curator/2.13.0/apache-curator-2.13.0-source-release.zip.asc (added) +++ dev/curator/2.13.0/apache-curator-2.13.0-source-release.zip.asc Mon Dec 3 02:50:52 2018 @@ -0,0 +1,18 @@ +-BEGIN PGP SIGNATURE- +Version: GnuPG v1 +Comment: GPGTools - https://gpgtools.org + +iQIcBAABCgAGBQJcBJZtAAoJEG17iHfZHfuJNmIP/irfGvHAbx9sZHXRQx1LA5/A +ecOANfU0n7r/x3m6ZOh508BR212xqPAQijDLGLDB3LlH8g4n+wl1zMqk0f8Ltnli +YjMW3cmBS8wmlM311SHCgvsK7+IzlfWjvinU+gO4F+QC9cWLAbw51Zu95lCh3MuE +d33q08JtxfNEXe9XMmdh2cz+zDXr++ZBwnvabGKOiVBhWC9GfJ6O+JZf3tkwtaBZ +a5UD23AvfmTJN3w6/+7zd5MBkdShFTQdxMvAEElymDNvasRJReizT0YhVkwTYXt2 +nNatwCIdEfvxxcAzaRogtd4BRgOwv24G2PFObJNhmxXBz3mvOtW8k19XVKkRLvuu +pblLTNFo+ux2t+MITyxPdZ8ZEzXQ9b9WSPrhdKo0zg68enIB5aN5HzXET0t9kwd6 +bosNOAvxEvQsKYcCO+7SDqIvChlescxbkVpzb7L7HUgnohiw0aU3eCYUAahV0nea +iKOIK6Bg1FQcVKNeg0b30/5GEny3ZwnJc9F20ibz18/qTeVsuxloA79hIFDHGPmN +6ilNavFliK9JqZQgLFCiwCWurdDJQEJxbGXE8BHDH44xv8IacG3C738nLbn7KvFS +8uDRL7s4G+Jro/4KCdSufPphIFMwDClg1+Ri+GJETmsDTl4C9HhS7BzZXBpZE/M0 +YdifHHXO7TI3ZBaDIYyw +=yXsZ +-END PGP SIGNATURE- Propchange: dev/curator/2.13.0/apache-curator-2.13.0-source-release.zip.asc -- svn:executable = * Added: dev/curator/2.13.0/apache-curator-2.13.0-source-release.zip.md5 == --- dev/curator/2.13.0/apache-curator-2.13.0-source-release.zip.md5 (added) +++ dev/curator/2.13.0/apache-curator-2.13.0-source-release.zip.md5 Mon Dec 3 02:50:52 2018 @@ -0,0 +1 @@ +9a79abbaefd0a30cf60c62bbc3569771 \ No newline at end of file Propchange: dev/curator/2.13.0/apache-curator-2.13.0-source-release.zip.md5 -- svn:executable = * Added: dev/curator/2.13.0/apache-curator-2.13.0-source-release.zip.sha1 == --- dev/curator/2.13.0/apache-curator-2.13.0-source-release.zip.sha1 (added) +++ dev/curator/2.13.0/apache-curator-2.13.0-source-release.zip.sha1 Mon Dec 3 02:50:52 2018 @@ -0,0 +1 @@ +2eef5c47268c1ee7ea9d439949a052b02c5c9fab \ No newline at end of file Propchange: dev/curator/2.13.0/apache-curator-2.13.0-source-release.zip.sha1 -- svn:executable = *
[curator] Git Push Summary
Repository: curator Updated Tags: refs/tags/apache-curator-2.13.0 [created] 58c025aba refs/tags/temp [created] 9b81582da
curator git commit: CURATOR-472 - Fixed unit test
Repository: curator Updated Branches: refs/heads/CURATOR-472 90a3e4c57 -> 26ffdfb89 CURATOR-472 - Fixed unit test -Added setup of zookeeper.extednedTypesEnabled system property. Project: http://git-wip-us.apache.org/repos/asf/curator/repo Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/26ffdfb8 Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/26ffdfb8 Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/26ffdfb8 Branch: refs/heads/CURATOR-472 Commit: 26ffdfb89c685873b5592db29c541f92c22a06cd Parents: 90a3e4c Author: Cam McKenzie Authored: Mon Dec 3 10:35:46 2018 +1100 Committer: Cam McKenzie Committed: Mon Dec 3 10:35:46 2018 +1100 -- .../java/org/apache/curator/framework/imps/TestTtlNodes.java | 6 ++ 1 file changed, 6 insertions(+) -- http://git-wip-us.apache.org/repos/asf/curator/blob/26ffdfb8/curator-framework/src/test/java/org/apache/curator/framework/imps/TestTtlNodes.java -- diff --git a/curator-framework/src/test/java/org/apache/curator/framework/imps/TestTtlNodes.java b/curator-framework/src/test/java/org/apache/curator/framework/imps/TestTtlNodes.java index f253d96..e2156df 100644 --- a/curator-framework/src/test/java/org/apache/curator/framework/imps/TestTtlNodes.java +++ b/curator-framework/src/test/java/org/apache/curator/framework/imps/TestTtlNodes.java @@ -29,6 +29,7 @@ import org.apache.curator.test.compatibility.Zk35MethodInterceptor; import org.apache.zookeeper.CreateMode; import org.testng.Assert; import org.testng.annotations.AfterMethod; +import org.testng.annotations.BeforeClass; import org.testng.annotations.BeforeMethod; import org.testng.annotations.Test; import java.util.concurrent.CountDownLatch; @@ -36,6 +37,11 @@ import java.util.concurrent.CountDownLatch; @Test(groups = Zk35MethodInterceptor.zk35Group) public class TestTtlNodes extends CuratorTestBase { +@BeforeClass +public static void setUpClass() { +System.setProperty("zookeeper.extendedTypesEnabled", "true"); +} + @BeforeMethod @Override public void setup() throws Exception
[5/5] curator git commit: Move sequential suffix extraction logic into ZKPaths helper method
Move sequential suffix extraction logic into ZKPaths helper method Project: http://git-wip-us.apache.org/repos/asf/curator/repo Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/eebff920 Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/eebff920 Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/eebff920 Branch: refs/heads/master Commit: eebff920c99f1d8d3d7527deed9958bb4595e59a Parents: 4d6069a Author: nickhill Authored: Thu Nov 15 10:19:51 2018 -0800 Committer: nickhill Committed: Thu Nov 15 10:19:51 2018 -0800 -- .../main/java/org/apache/curator/utils/ZKPaths.java | 15 +++ .../framework/recipes/nodes/PersistentNode.java | 10 -- 2 files changed, 19 insertions(+), 6 deletions(-) -- http://git-wip-us.apache.org/repos/asf/curator/blob/eebff920/curator-client/src/main/java/org/apache/curator/utils/ZKPaths.java -- diff --git a/curator-client/src/main/java/org/apache/curator/utils/ZKPaths.java b/curator-client/src/main/java/org/apache/curator/utils/ZKPaths.java index 9d6ea9d..8e94d2b 100644 --- a/curator-client/src/main/java/org/apache/curator/utils/ZKPaths.java +++ b/curator-client/src/main/java/org/apache/curator/utils/ZKPaths.java @@ -177,6 +177,21 @@ public class ZKPaths return new PathAndNode(parentPath, node); } +// Hardcoded in {@link org.apache.zookeeper.server.PrepRequestProcessor} +static final int SEQUENTIAL_SUFFIX_DIGITS = 10; + +/** + * Extracts the ten-digit suffix from a sequential znode path. Does not currently perform validation on the + * provided path; it will just return a string comprising the last ten characters. + * + * @param path the path of a sequential znodes + * @return the sequential suffix + */ +public static String extractSequentialSuffix(String path) { +int length = path.length(); +return length > SEQUENTIAL_SUFFIX_DIGITS ? path.substring(length - SEQUENTIAL_SUFFIX_DIGITS) : path; +} + private static final Splitter PATH_SPLITTER = Splitter.on(PATH_SEPARATOR).omitEmptyStrings(); /** http://git-wip-us.apache.org/repos/asf/curator/blob/eebff920/curator-recipes/src/main/java/org/apache/curator/framework/recipes/nodes/PersistentNode.java -- diff --git a/curator-recipes/src/main/java/org/apache/curator/framework/recipes/nodes/PersistentNode.java b/curator-recipes/src/main/java/org/apache/curator/framework/recipes/nodes/PersistentNode.java index 80b07e8..81e8dd9 100644 --- a/curator-recipes/src/main/java/org/apache/curator/framework/recipes/nodes/PersistentNode.java +++ b/curator-recipes/src/main/java/org/apache/curator/framework/recipes/nodes/PersistentNode.java @@ -37,6 +37,7 @@ import org.apache.curator.framework.state.ConnectionState; import org.apache.curator.framework.state.ConnectionStateListener; import org.apache.curator.utils.PathUtils; import org.apache.curator.utils.ThreadUtils; +import org.apache.curator.utils.ZKPaths; import org.apache.zookeeper.CreateMode; import org.apache.zookeeper.KeeperException; import org.apache.zookeeper.WatchedEvent; @@ -422,9 +423,6 @@ public class PersistentNode implements Closeable } } -// Hardcoded in {@link org.apache.zookeeper.server.PrepRequestProcessor} -static final int SEQUENTIAL_SUFFIX_DIGITS = 10; - private void createNode() { if ( !isActive() ) @@ -452,13 +450,13 @@ public class PersistentNode implements Closeable { createPath = existingPath; } -else if ( existingPath == null || !mode.isSequential() ) +else if ( existingPath != null && mode.isSequential() ) { -createPath = basePath; +createPath = basePath + ZKPaths.extractSequentialSuffix(existingPath); } else { -createPath = basePath + existingPath.substring(existingPath.length() - SEQUENTIAL_SUFFIX_DIGITS); +createPath = basePath; } CreateModable> localCreateMethod = createMethod.get();
[1/5] curator git commit: fix path used when re-creating sequential PersistentNode with protection
Repository: curator Updated Branches: refs/heads/master 26fcc3cf2 -> eebff920c fix path used when re-creating sequential PersistentNode with protection would previously result in creation of a second non-sequential znode Project: http://git-wip-us.apache.org/repos/asf/curator/repo Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/91e3a643 Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/91e3a643 Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/91e3a643 Branch: refs/heads/master Commit: 91e3a643ff6c562d30e75a61ed2d626befbcc40c Parents: 26fcc3c Author: nickhill Authored: Fri Nov 2 16:51:15 2018 -0700 Committer: nickhill Committed: Fri Nov 2 16:51:15 2018 -0700 -- .../curator/framework/recipes/nodes/PersistentNode.java | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/curator/blob/91e3a643/curator-recipes/src/main/java/org/apache/curator/framework/recipes/nodes/PersistentNode.java -- diff --git a/curator-recipes/src/main/java/org/apache/curator/framework/recipes/nodes/PersistentNode.java b/curator-recipes/src/main/java/org/apache/curator/framework/recipes/nodes/PersistentNode.java index bdf607c..9c9b527 100644 --- a/curator-recipes/src/main/java/org/apache/curator/framework/recipes/nodes/PersistentNode.java +++ b/curator-recipes/src/main/java/org/apache/curator/framework/recipes/nodes/PersistentNode.java @@ -445,7 +445,8 @@ public class PersistentNode implements Closeable try { String existingPath = nodePath.get(); -String createPath = (existingPath != null && !useProtection) ? existingPath : basePath; +String createPath = existingPath == null || (useProtection && !isSequential(mode)) ? basePath +: (useProtection ? basePath + existingPath.substring(existingPath.length()-10) : existingPath); CreateModable> localCreateMethod = createMethod.get(); if ( localCreateMethod == null ) @@ -463,6 +464,10 @@ public class PersistentNode implements Closeable throw new RuntimeException("Creating node. BasePath: " + basePath, e); // should never happen unless there's a programming error - so throw RuntimeException } } + +private static boolean isSequential(CreateMode mode) { +return mode == CreateMode.EPHEMERAL_SEQUENTIAL || mode == CreateMode.PERSISTENT_SEQUENTIAL; +} private CreateMode getCreateMode(boolean pathIsSet) {
[2/5] curator git commit: add targeted unit test for bug/fix
add targeted unit test for bug/fix Project: http://git-wip-us.apache.org/repos/asf/curator/repo Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/8e4dba7a Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/8e4dba7a Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/8e4dba7a Branch: refs/heads/master Commit: 8e4dba7a070beaf110267843ba0611ee7cae25fc Parents: 91e3a64 Author: nickhill Authored: Mon Nov 5 09:57:29 2018 -0800 Committer: nickhill Committed: Mon Nov 5 09:57:29 2018 -0800 -- .../recipes/nodes/TestPersistentNode.java | 33 1 file changed, 33 insertions(+) -- http://git-wip-us.apache.org/repos/asf/curator/blob/8e4dba7a/curator-recipes/src/test/java/org/apache/curator/framework/recipes/nodes/TestPersistentNode.java -- diff --git a/curator-recipes/src/test/java/org/apache/curator/framework/recipes/nodes/TestPersistentNode.java b/curator-recipes/src/test/java/org/apache/curator/framework/recipes/nodes/TestPersistentNode.java index 0fdd7c8..b157000 100644 --- a/curator-recipes/src/test/java/org/apache/curator/framework/recipes/nodes/TestPersistentNode.java +++ b/curator-recipes/src/test/java/org/apache/curator/framework/recipes/nodes/TestPersistentNode.java @@ -28,6 +28,8 @@ import org.apache.curator.utils.CloseableUtils; import org.apache.zookeeper.CreateMode; import org.testng.Assert; import org.testng.annotations.Test; + +import java.util.List; import java.util.concurrent.TimeUnit; public class TestPersistentNode extends BaseClassForTests @@ -138,4 +140,35 @@ public class TestPersistentNode extends BaseClassForTests CloseableUtils.closeQuietly(client); } } + +@Test +public void testEphemeralSequentialWithProtectionReconnection() throws Exception +{ +Timing timing = new Timing(); +PersistentNode pen = null; +CuratorFramework client = CuratorFrameworkFactory.newClient(server.getConnectString(), timing.session(), timing.connection(), new RetryOneTime(1)); +try +{ +client.start(); +client.create().creatingParentsIfNeeded().forPath("/test/one"); + +pen = new PersistentNode(client, CreateMode.EPHEMERAL_SEQUENTIAL, true, "/test/one/two", new byte[0]); +pen.start(); +List children = client.getChildren().forPath("/test/one"); +System.out.println("children before restart: "+children); +Assert.assertEquals(1, children.size()); +server.stop(); +timing.sleepABit(); +server.restart(); +timing.sleepABit(); +List childrenAfter = client.getChildren().forPath("/test/one"); +System.out.println("children after restart: "+childrenAfter); +Assert.assertEquals(children, childrenAfter, "unexpected znodes: "+childrenAfter); +} +finally +{ +CloseableUtils.closeQuietly(pen); +CloseableUtils.closeQuietly(client); +} +} }
curator git commit: CURATOR-476 PathChildrenCache should check resultCode=-101 for getData(...) done on non-existent child and remove it from it's initialSet
Repository: curator Updated Branches: refs/heads/master 8a75db877 -> 895015165 CURATOR-476 PathChildrenCache should check resultCode=-101 for getData(...) done on non-existent child and remove it from it's initialSet Project: http://git-wip-us.apache.org/repos/asf/curator/repo Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/89501516 Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/89501516 Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/89501516 Branch: refs/heads/master Commit: 895015165dca24fb58aa23a1949bed0476761910 Parents: 8a75db8 Author: rsouhrain Authored: Fri Aug 10 14:10:18 2018 +0100 Committer: rsouhrain Committed: Fri Aug 10 14:10:18 2018 +0100 -- .../recipes/cache/PathChildrenCache.java| 7 ++- .../recipes/cache/TestPathChildrenCache.java| 51 2 files changed, 57 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/curator/blob/89501516/curator-recipes/src/main/java/org/apache/curator/framework/recipes/cache/PathChildrenCache.java -- diff --git a/curator-recipes/src/main/java/org/apache/curator/framework/recipes/cache/PathChildrenCache.java b/curator-recipes/src/main/java/org/apache/curator/framework/recipes/cache/PathChildrenCache.java index 5d418c6..f8c4e93 100644 --- a/curator-recipes/src/main/java/org/apache/curator/framework/recipes/cache/PathChildrenCache.java +++ b/curator-recipes/src/main/java/org/apache/curator/framework/recipes/cache/PathChildrenCache.java @@ -601,7 +601,7 @@ public class PathChildrenCache implements Closeable Map localInitialSet = initialSet.get(); if ( localInitialSet != null ) { -localInitialSet.remove(fullPath); +localInitialSet.remove(ZKPaths.getNodeFromPath(fullPath)); maybeOfferInitializedEvent(localInitialSet); } } @@ -713,6 +713,11 @@ public class PathChildrenCache implements Closeable } updateInitialSet(ZKPaths.getNodeFromPath(fullPath), data); } +else if ( resultCode == KeeperException.Code.NONODE.intValue() ) +{ +log.debug("NoNode at path {}, removing child from initialSet", fullPath); +remove(fullPath); +} } private void updateInitialSet(String name, ChildData data) http://git-wip-us.apache.org/repos/asf/curator/blob/89501516/curator-recipes/src/test/java/org/apache/curator/framework/recipes/cache/TestPathChildrenCache.java -- diff --git a/curator-recipes/src/test/java/org/apache/curator/framework/recipes/cache/TestPathChildrenCache.java b/curator-recipes/src/test/java/org/apache/curator/framework/recipes/cache/TestPathChildrenCache.java index da294c8..d2f8cc0 100644 --- a/curator-recipes/src/test/java/org/apache/curator/framework/recipes/cache/TestPathChildrenCache.java +++ b/curator-recipes/src/test/java/org/apache/curator/framework/recipes/cache/TestPathChildrenCache.java @@ -95,6 +95,57 @@ public class TestPathChildrenCache extends BaseClassForTests } @Test +public void testInitializedEvenIfChildDeleted() throws Exception +{ +final CuratorFramework client = CuratorFrameworkFactory.newClient(server.getConnectString(), new RetryOneTime(1)); + +PathChildrenCache cache = new PathChildrenCache(client, "/a/b/test", true) +{ +@Override +void getDataAndStat(final String fullPath) throws Exception +{ +// before installing a data watcher on the child, let's delete this child +client.delete().forPath("/a/b/test/one"); +super.getDataAndStat(fullPath); +} +}; + +Timing timing = new Timing(); + +try +{ +client.start(); + +final CountDownLatch cacheInitialized = new CountDownLatch(1); + +PathChildrenCacheListener listener = new PathChildrenCacheListener() +{ +@Override +public void childEvent(CuratorFramework client, PathChildrenCacheEvent event) throws Exception +{ +if ( event.getType() == PathChildrenCacheEvent.Type.INITIALIZED ) +{ +cacheInitialized.countDown(); +} +} +}; +cache.getListenable().addListener(listener); + +client.create().creatingParentsIfNeeded().forPath("/a/b/test/one"); + +cache.start(PathChildrenCache.StartMode.POST_INITIALIZED_EVENT); + +Assert.assertTrue(timing.awaitLatch(cacheInitialized)); +Assert.assertEquals(cache.getCurrentData().size(), 0); +} +
curator git commit: CURATOR-476 PathChildrenCache should check resultCode=-101 for getData(...) done on non-existent child and remove it from it's initialSet
Repository: curator Updated Branches: refs/heads/CURATOR-476 [created] 895015165 CURATOR-476 PathChildrenCache should check resultCode=-101 for getData(...) done on non-existent child and remove it from it's initialSet Project: http://git-wip-us.apache.org/repos/asf/curator/repo Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/89501516 Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/89501516 Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/89501516 Branch: refs/heads/CURATOR-476 Commit: 895015165dca24fb58aa23a1949bed0476761910 Parents: 8a75db8 Author: rsouhrain Authored: Fri Aug 10 14:10:18 2018 +0100 Committer: rsouhrain Committed: Fri Aug 10 14:10:18 2018 +0100 -- .../recipes/cache/PathChildrenCache.java| 7 ++- .../recipes/cache/TestPathChildrenCache.java| 51 2 files changed, 57 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/curator/blob/89501516/curator-recipes/src/main/java/org/apache/curator/framework/recipes/cache/PathChildrenCache.java -- diff --git a/curator-recipes/src/main/java/org/apache/curator/framework/recipes/cache/PathChildrenCache.java b/curator-recipes/src/main/java/org/apache/curator/framework/recipes/cache/PathChildrenCache.java index 5d418c6..f8c4e93 100644 --- a/curator-recipes/src/main/java/org/apache/curator/framework/recipes/cache/PathChildrenCache.java +++ b/curator-recipes/src/main/java/org/apache/curator/framework/recipes/cache/PathChildrenCache.java @@ -601,7 +601,7 @@ public class PathChildrenCache implements Closeable Map localInitialSet = initialSet.get(); if ( localInitialSet != null ) { -localInitialSet.remove(fullPath); +localInitialSet.remove(ZKPaths.getNodeFromPath(fullPath)); maybeOfferInitializedEvent(localInitialSet); } } @@ -713,6 +713,11 @@ public class PathChildrenCache implements Closeable } updateInitialSet(ZKPaths.getNodeFromPath(fullPath), data); } +else if ( resultCode == KeeperException.Code.NONODE.intValue() ) +{ +log.debug("NoNode at path {}, removing child from initialSet", fullPath); +remove(fullPath); +} } private void updateInitialSet(String name, ChildData data) http://git-wip-us.apache.org/repos/asf/curator/blob/89501516/curator-recipes/src/test/java/org/apache/curator/framework/recipes/cache/TestPathChildrenCache.java -- diff --git a/curator-recipes/src/test/java/org/apache/curator/framework/recipes/cache/TestPathChildrenCache.java b/curator-recipes/src/test/java/org/apache/curator/framework/recipes/cache/TestPathChildrenCache.java index da294c8..d2f8cc0 100644 --- a/curator-recipes/src/test/java/org/apache/curator/framework/recipes/cache/TestPathChildrenCache.java +++ b/curator-recipes/src/test/java/org/apache/curator/framework/recipes/cache/TestPathChildrenCache.java @@ -95,6 +95,57 @@ public class TestPathChildrenCache extends BaseClassForTests } @Test +public void testInitializedEvenIfChildDeleted() throws Exception +{ +final CuratorFramework client = CuratorFrameworkFactory.newClient(server.getConnectString(), new RetryOneTime(1)); + +PathChildrenCache cache = new PathChildrenCache(client, "/a/b/test", true) +{ +@Override +void getDataAndStat(final String fullPath) throws Exception +{ +// before installing a data watcher on the child, let's delete this child +client.delete().forPath("/a/b/test/one"); +super.getDataAndStat(fullPath); +} +}; + +Timing timing = new Timing(); + +try +{ +client.start(); + +final CountDownLatch cacheInitialized = new CountDownLatch(1); + +PathChildrenCacheListener listener = new PathChildrenCacheListener() +{ +@Override +public void childEvent(CuratorFramework client, PathChildrenCacheEvent event) throws Exception +{ +if ( event.getType() == PathChildrenCacheEvent.Type.INITIALIZED ) +{ +cacheInitialized.countDown(); +} +} +}; +cache.getListenable().addListener(listener); + +client.create().creatingParentsIfNeeded().forPath("/a/b/test/one"); + +cache.start(PathChildrenCache.StartMode.POST_INITIALIZED_EVENT); + +Assert.assertTrue(timing.awaitLatch(cacheInitialized)); +Assert.assertEquals(cache.getCurrentData().size(), 0); +
[2/2] curator git commit: Merge branch 'CURATOR-462' of https://github.com/krajcsovszkig-ms/curator into CURATOR-462
Merge branch 'CURATOR-462' of https://github.com/krajcsovszkig-ms/curator into CURATOR-462 Project: http://git-wip-us.apache.org/repos/asf/curator/repo Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/3ce29489 Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/3ce29489 Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/3ce29489 Branch: refs/heads/master Commit: 3ce2948908e9ba9e5401de0cc86562914dfb877b Parents: 5920c74 f9128a8 Author: Cam McKenzieAuthored: Mon Apr 30 09:49:58 2018 +1000 Committer: Cam McKenzie Committed: Mon Apr 30 09:49:58 2018 +1000 -- .../recipes/locks/InterProcessSemaphoreV2.java | 18 +-- .../locks/TestInterProcessSemaphore.java| 49 2 files changed, 64 insertions(+), 3 deletions(-) --
[1/2] curator git commit: Fix CURATOR-462 -- return lease created in org.apache.curator.framework.recipes.locks.InterProcessSemaphoreV2.internalAcquire1Lease(Builder, long, boolean, long) when
Repository: curator Updated Branches: refs/heads/master 5920c7445 -> 3ce294890 Fix CURATOR-462 -- return lease created in org.apache.curator.framework.recipes.locks.InterProcessSemaphoreV2.internalAcquire1Lease(Builder, long, boolean, long) when the wait for it to become active is interrupted; test for the fix Project: http://git-wip-us.apache.org/repos/asf/curator/repo Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/f9128a87 Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/f9128a87 Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/f9128a87 Branch: refs/heads/master Commit: f9128a87c837fd4a687c3d54c73ea779e46085fc Parents: eb6ad40 Author: krajcsovszkig-msAuthored: Tue Apr 10 14:08:45 2018 +0200 Committer: krajcsovszkig-ms Committed: Tue Apr 10 14:08:45 2018 +0200 -- .../recipes/locks/InterProcessSemaphoreV2.java | 18 +-- .../locks/TestInterProcessSemaphore.java| 49 2 files changed, 64 insertions(+), 3 deletions(-) -- http://git-wip-us.apache.org/repos/asf/curator/blob/f9128a87/curator-recipes/src/main/java/org/apache/curator/framework/recipes/locks/InterProcessSemaphoreV2.java -- diff --git a/curator-recipes/src/main/java/org/apache/curator/framework/recipes/locks/InterProcessSemaphoreV2.java b/curator-recipes/src/main/java/org/apache/curator/framework/recipes/locks/InterProcessSemaphoreV2.java index 7bc98f5..03e1088 100644 --- a/curator-recipes/src/main/java/org/apache/curator/framework/recipes/locks/InterProcessSemaphoreV2.java +++ b/curator-recipes/src/main/java/org/apache/curator/framework/recipes/locks/InterProcessSemaphoreV2.java @@ -331,6 +331,7 @@ public class InterProcessSemaphoreV2 static volatile CountDownLatch debugAcquireLatch = null; static volatile CountDownLatch debugFailedGetChildrenLatch = null; +volatile CountDownLatch debugWaitLatch = null; private InternalAcquireResult internalAcquire1Lease(ImmutableList.Builder builder, long startMs, boolean hasWait, long waitMs) throws Exception { @@ -353,6 +354,7 @@ public class InterProcessSemaphoreV2 } Lease lease = null; +boolean success = false; try { @@ -383,13 +385,11 @@ public class InterProcessSemaphoreV2 { debugFailedGetChildrenLatch.countDown(); } -returnLease(lease); // otherwise the just created ZNode will be orphaned causing a dead lock throw e; } if ( !children.contains(nodeName) ) { log.error("Sequential path not found: " + path); -returnLease(lease); return InternalAcquireResult.RETRY_DUE_TO_MISSING_NODE; } @@ -402,20 +402,32 @@ public class InterProcessSemaphoreV2 long thisWaitMs = getThisWaitMs(startMs, waitMs); if ( thisWaitMs <= 0 ) { -returnLease(lease); return InternalAcquireResult.RETURN_NULL; } +if ( debugWaitLatch != null ) +{ +debugWaitLatch.countDown(); +} wait(thisWaitMs); } else { +if ( debugWaitLatch != null ) +{ +debugWaitLatch.countDown(); +} wait(); } } +success = true; } } finally { +if ( !success ) +{ +returnLease(lease); +} client.removeWatchers(); } } http://git-wip-us.apache.org/repos/asf/curator/blob/f9128a87/curator-recipes/src/test/java/org/apache/curator/framework/recipes/locks/TestInterProcessSemaphore.java -- diff --git a/curator-recipes/src/test/java/org/apache/curator/framework/recipes/locks/TestInterProcessSemaphore.java b/curator-recipes/src/test/java/org/apache/curator/framework/recipes/locks/TestInterProcessSemaphore.java index 73c76e8..50f6bce 100644 ---
[2/2] curator git commit: Merge branch 'CURATOR-462' of https://github.com/krajcsovszkig-ms/curator into CURATOR-462
Merge branch 'CURATOR-462' of https://github.com/krajcsovszkig-ms/curator into CURATOR-462 Project: http://git-wip-us.apache.org/repos/asf/curator/repo Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/3ce29489 Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/3ce29489 Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/3ce29489 Branch: refs/heads/CURATOR-462 Commit: 3ce2948908e9ba9e5401de0cc86562914dfb877b Parents: 5920c74 f9128a8 Author: Cam McKenzieAuthored: Mon Apr 30 09:49:58 2018 +1000 Committer: Cam McKenzie Committed: Mon Apr 30 09:49:58 2018 +1000 -- .../recipes/locks/InterProcessSemaphoreV2.java | 18 +-- .../locks/TestInterProcessSemaphore.java| 49 2 files changed, 64 insertions(+), 3 deletions(-) --
[1/2] curator git commit: Fix CURATOR-462 -- return lease created in org.apache.curator.framework.recipes.locks.InterProcessSemaphoreV2.internalAcquire1Lease(Builder, long, boolean, long) when
Repository: curator Updated Branches: refs/heads/CURATOR-462 [created] 3ce294890 Fix CURATOR-462 -- return lease created in org.apache.curator.framework.recipes.locks.InterProcessSemaphoreV2.internalAcquire1Lease(Builder, long, boolean, long) when the wait for it to become active is interrupted; test for the fix Project: http://git-wip-us.apache.org/repos/asf/curator/repo Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/f9128a87 Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/f9128a87 Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/f9128a87 Branch: refs/heads/CURATOR-462 Commit: f9128a87c837fd4a687c3d54c73ea779e46085fc Parents: eb6ad40 Author: krajcsovszkig-msAuthored: Tue Apr 10 14:08:45 2018 +0200 Committer: krajcsovszkig-ms Committed: Tue Apr 10 14:08:45 2018 +0200 -- .../recipes/locks/InterProcessSemaphoreV2.java | 18 +-- .../locks/TestInterProcessSemaphore.java| 49 2 files changed, 64 insertions(+), 3 deletions(-) -- http://git-wip-us.apache.org/repos/asf/curator/blob/f9128a87/curator-recipes/src/main/java/org/apache/curator/framework/recipes/locks/InterProcessSemaphoreV2.java -- diff --git a/curator-recipes/src/main/java/org/apache/curator/framework/recipes/locks/InterProcessSemaphoreV2.java b/curator-recipes/src/main/java/org/apache/curator/framework/recipes/locks/InterProcessSemaphoreV2.java index 7bc98f5..03e1088 100644 --- a/curator-recipes/src/main/java/org/apache/curator/framework/recipes/locks/InterProcessSemaphoreV2.java +++ b/curator-recipes/src/main/java/org/apache/curator/framework/recipes/locks/InterProcessSemaphoreV2.java @@ -331,6 +331,7 @@ public class InterProcessSemaphoreV2 static volatile CountDownLatch debugAcquireLatch = null; static volatile CountDownLatch debugFailedGetChildrenLatch = null; +volatile CountDownLatch debugWaitLatch = null; private InternalAcquireResult internalAcquire1Lease(ImmutableList.Builder builder, long startMs, boolean hasWait, long waitMs) throws Exception { @@ -353,6 +354,7 @@ public class InterProcessSemaphoreV2 } Lease lease = null; +boolean success = false; try { @@ -383,13 +385,11 @@ public class InterProcessSemaphoreV2 { debugFailedGetChildrenLatch.countDown(); } -returnLease(lease); // otherwise the just created ZNode will be orphaned causing a dead lock throw e; } if ( !children.contains(nodeName) ) { log.error("Sequential path not found: " + path); -returnLease(lease); return InternalAcquireResult.RETRY_DUE_TO_MISSING_NODE; } @@ -402,20 +402,32 @@ public class InterProcessSemaphoreV2 long thisWaitMs = getThisWaitMs(startMs, waitMs); if ( thisWaitMs <= 0 ) { -returnLease(lease); return InternalAcquireResult.RETURN_NULL; } +if ( debugWaitLatch != null ) +{ +debugWaitLatch.countDown(); +} wait(thisWaitMs); } else { +if ( debugWaitLatch != null ) +{ +debugWaitLatch.countDown(); +} wait(); } } +success = true; } } finally { +if ( !success ) +{ +returnLease(lease); +} client.removeWatchers(); } } http://git-wip-us.apache.org/repos/asf/curator/blob/f9128a87/curator-recipes/src/test/java/org/apache/curator/framework/recipes/locks/TestInterProcessSemaphore.java -- diff --git a/curator-recipes/src/test/java/org/apache/curator/framework/recipes/locks/TestInterProcessSemaphore.java b/curator-recipes/src/test/java/org/apache/curator/framework/recipes/locks/TestInterProcessSemaphore.java index 73c76e8..50f6bce 100644 ---
[5/6] curator git commit: CURATOR-460 Abstraction of getUseSessionTimeoutMs and readability improvements
CURATOR-460 Abstraction of getUseSessionTimeoutMs and readability improvements Project: http://git-wip-us.apache.org/repos/asf/curator/repo Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/b6af8fda Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/b6af8fda Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/b6af8fda Branch: refs/heads/master Commit: b6af8fdabbb620d6f01ce9453efba1fe1ef60205 Parents: 9123e04 Author: javandoAuthored: Thu Apr 5 23:56:32 2018 -0300 Committer: javando Committed: Thu Apr 5 23:56:32 2018 -0300 -- .../framework/state/ConnectionStateManager.java | 24 1 file changed, 15 insertions(+), 9 deletions(-) -- http://git-wip-us.apache.org/repos/asf/curator/blob/b6af8fda/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 609bfa0..b66ca7e 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 @@ -252,14 +252,14 @@ public class ConnectionStateManager implements Closeable try { -long localStartOfSuspendedEpoch; +int useSessionTimeoutMs; +long elapsedMs; + synchronized (this) { -localStartOfSuspendedEpoch = this.startOfSuspendedEpoch; +useSessionTimeoutMs = getUseSessionTimeoutMs(); +elapsedMs = this.startOfSuspendedEpoch == 0 ? useSessionTimeoutMs / 2 : System.currentTimeMillis() - this.startOfSuspendedEpoch; } -int lastNegotiatedSessionTimeoutMs = client.getZookeeperClient().getLastNegotiatedSessionTimeoutMs(); -int useSessionTimeoutMs = (lastNegotiatedSessionTimeoutMs > 0) ? lastNegotiatedSessionTimeoutMs : sessionTimeoutMs; -useSessionTimeoutMs = sessionExpirationPercent > 0 && localStartOfSuspendedEpoch != 0 ? (useSessionTimeoutMs * sessionExpirationPercent) / 100 : useSessionTimeoutMs; -long elapsedMs = localStartOfSuspendedEpoch == 0 ? useSessionTimeoutMs / 2 : System.currentTimeMillis() - localStartOfSuspendedEpoch; + long pollMaxMs = useSessionTimeoutMs - elapsedMs; final ConnectionState newState = eventQueue.poll(pollMaxMs, TimeUnit.MILLISECONDS); @@ -305,9 +305,7 @@ public class ConnectionStateManager implements Closeable if ( (currentConnectionState == ConnectionState.SUSPENDED) && (startOfSuspendedEpoch != 0) ) { long elapsedMs = System.currentTimeMillis() - startOfSuspendedEpoch; -int lastNegotiatedSessionTimeoutMs = client.getZookeeperClient().getLastNegotiatedSessionTimeoutMs(); -int useSessionTimeoutMs = (lastNegotiatedSessionTimeoutMs > 0) ? lastNegotiatedSessionTimeoutMs : sessionTimeoutMs; -useSessionTimeoutMs = (useSessionTimeoutMs * sessionExpirationPercent) / 100; +int useSessionTimeoutMs = getUseSessionTimeoutMs(); if ( elapsedMs >= useSessionTimeoutMs ) { log.warn(String.format("Session timeout has elapsed while SUSPENDED. Injecting a session expiration. Elapsed ms: %d. Adjusted session timeout ms: %d", elapsedMs, useSessionTimeoutMs)); @@ -340,4 +338,12 @@ public class ConnectionStateManager implements Closeable currentConnectionState = newConnectionState; startOfSuspendedEpoch = (currentConnectionState == ConnectionState.SUSPENDED) ? System.currentTimeMillis() : 0; } + +private synchronized int getUseSessionTimeoutMs() { +int lastNegotiatedSessionTimeoutMs = client.getZookeeperClient().getLastNegotiatedSessionTimeoutMs(); +int useSessionTimeoutMs = (lastNegotiatedSessionTimeoutMs > 0) ? lastNegotiatedSessionTimeoutMs : sessionTimeoutMs; +useSessionTimeoutMs = sessionExpirationPercent > 0 && startOfSuspendedEpoch != 0 ? (useSessionTimeoutMs * sessionExpirationPercent) / 100 : useSessionTimeoutMs; +return useSessionTimeoutMs; +} + }
[2/6] curator git commit: CURATOR-460 Synchronize access to startOfSuspendedEpoch
CURATOR-460 Synchronize access to startOfSuspendedEpoch Project: http://git-wip-us.apache.org/repos/asf/curator/repo Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/6e854670 Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/6e854670 Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/6e854670 Branch: refs/heads/master Commit: 6e8546706b1bdc267126c37601ac646584461c12 Parents: 72b7b87 Author: javandoAuthored: Wed Apr 4 23:09:10 2018 -0300 Committer: javando Committed: Wed Apr 4 23:09:10 2018 -0300 -- .../curator/framework/state/ConnectionStateManager.java | 12 ++-- 1 file changed, 10 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/curator/blob/6e854670/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 fedcedf..76c5636 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 @@ -251,10 +251,18 @@ public class ConnectionStateManager implements Closeable { try { + +long localStartOfSuspendedEpoch; + +synchronized (this) { +localStartOfSuspendedEpoch = this.startOfSuspendedEpoch; +} + int lastNegotiatedSessionTimeoutMs = client.getZookeeperClient().getLastNegotiatedSessionTimeoutMs(); int useSessionTimeoutMs = (lastNegotiatedSessionTimeoutMs > 0) ? lastNegotiatedSessionTimeoutMs : sessionTimeoutMs; -useSessionTimeoutMs = sessionExpirationPercent > 0 && startOfSuspendedEpoch != 0 ? (useSessionTimeoutMs * sessionExpirationPercent) / 100 : useSessionTimeoutMs; -long elapsedMs = startOfSuspendedEpoch == 0 ? useSessionTimeoutMs / 2 : System.currentTimeMillis() - startOfSuspendedEpoch; +useSessionTimeoutMs = sessionExpirationPercent > 0 && localStartOfSuspendedEpoch != 0 ? (useSessionTimeoutMs * sessionExpirationPercent) / 100 : useSessionTimeoutMs; +long elapsedMs = localStartOfSuspendedEpoch == 0 ? useSessionTimeoutMs / 2 : System.currentTimeMillis() - localStartOfSuspendedEpoch; + long pollMaxMs = useSessionTimeoutMs - elapsedMs; final ConnectionState newState = eventQueue.poll(pollMaxMs, TimeUnit.MILLISECONDS);
[3/6] curator git commit: CURATOR-460 Move test from TestLeaderLatch to TestConnectionStateManager
CURATOR-460 Move test from TestLeaderLatch to TestConnectionStateManager Project: http://git-wip-us.apache.org/repos/asf/curator/repo Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/0a5b29d5 Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/0a5b29d5 Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/0a5b29d5 Branch: refs/heads/master Commit: 0a5b29d588800d7eeabf66f23ea2e3ad0fa0416c Parents: 6e85467 Author: javandoAuthored: Wed Apr 4 23:10:12 2018 -0300 Committer: javando Committed: Wed Apr 4 23:10:12 2018 -0300 -- .../state/TestConnectionStateManager.java | 54 .../recipes/leader/TestLeaderLatch.java | 30 --- 2 files changed, 54 insertions(+), 30 deletions(-) -- http://git-wip-us.apache.org/repos/asf/curator/blob/0a5b29d5/curator-framework/src/test/java/org/apache/curator/framework/state/TestConnectionStateManager.java -- diff --git a/curator-framework/src/test/java/org/apache/curator/framework/state/TestConnectionStateManager.java b/curator-framework/src/test/java/org/apache/curator/framework/state/TestConnectionStateManager.java new file mode 100644 index 000..e313c56 --- /dev/null +++ b/curator-framework/src/test/java/org/apache/curator/framework/state/TestConnectionStateManager.java @@ -0,0 +1,54 @@ +package org.apache.curator.framework.state; + +import com.google.common.collect.Queues; +import org.apache.curator.connection.StandardConnectionHandlingPolicy; +import org.apache.curator.framework.CuratorFramework; +import org.apache.curator.framework.CuratorFrameworkFactory; +import org.apache.curator.retry.RetryOneTime; +import org.apache.curator.test.BaseClassForTests; +import org.apache.curator.test.compatibility.Timing2; +import org.apache.curator.utils.CloseableUtils; +import org.testng.Assert; +import org.testng.annotations.Test; + +import java.util.concurrent.BlockingQueue; +import java.util.concurrent.TimeUnit; + +public class TestConnectionStateManager extends BaseClassForTests { + +@Test +public void testSessionConnectionStateErrorPolicyWithExpirationPercent30() throws Exception { +Timing2 timing = new Timing2(); +CuratorFramework client = CuratorFrameworkFactory.builder() +.connectString(server.getConnectString()) +.connectionTimeoutMs(1000) +.sessionTimeoutMs(timing.session()) +.retryPolicy(new RetryOneTime(1)) +.connectionStateErrorPolicy(new SessionConnectionStateErrorPolicy()) +.connectionHandlingPolicy(new StandardConnectionHandlingPolicy(30)) +.build(); + +try { +final BlockingQueue states = Queues.newLinkedBlockingQueue(); +ConnectionStateListener stateListener = new ConnectionStateListener() { +@Override +public void stateChanged(CuratorFramework client, ConnectionState newState) { +states.add(newState.name()); +} +}; + +timing.sleepABit(); + +client.getConnectionStateListenable().addListener(stateListener); +client.start(); + Assert.assertEquals(states.poll(timing.forWaiting().milliseconds(), TimeUnit.MILLISECONDS), ConnectionState.CONNECTED.name()); +server.close(); + + Assert.assertEquals(states.poll(timing.forWaiting().milliseconds(), TimeUnit.MILLISECONDS), ConnectionState.SUSPENDED.name()); +Assert.assertEquals(states.poll(timing.session() / 3, TimeUnit.MILLISECONDS), ConnectionState.LOST.name()); +} +finally { +CloseableUtils.closeQuietly(client); +} +} +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/curator/blob/0a5b29d5/curator-recipes/src/test/java/org/apache/curator/framework/recipes/leader/TestLeaderLatch.java -- diff --git a/curator-recipes/src/test/java/org/apache/curator/framework/recipes/leader/TestLeaderLatch.java b/curator-recipes/src/test/java/org/apache/curator/framework/recipes/leader/TestLeaderLatch.java index af1475d..011e4a0 100644 --- a/curator-recipes/src/test/java/org/apache/curator/framework/recipes/leader/TestLeaderLatch.java +++ b/curator-recipes/src/test/java/org/apache/curator/framework/recipes/leader/TestLeaderLatch.java @@ -23,7 +23,6 @@ import com.google.common.base.Throwables; import com.google.common.collect.Lists; import com.google.common.collect.Queues; import com.google.common.util.concurrent.ThreadFactoryBuilder; -import org.apache.curator.connection.StandardConnectionHandlingPolicy; import org.apache.curator.framework.CuratorFramework; import
[1/6] curator git commit: CURATOR-460 Adjust to obey sessionExpirationPercent value
Repository: curator Updated Branches: refs/heads/master eb6ad402b -> 5920c7445 CURATOR-460 Adjust to obey sessionExpirationPercent value Project: http://git-wip-us.apache.org/repos/asf/curator/repo Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/72b7b870 Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/72b7b870 Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/72b7b870 Branch: refs/heads/master Commit: 72b7b8709c822b9170d8d7beb2814c4c36b89e58 Parents: eb6ad40 Author: javandoAuthored: Mon Apr 2 23:27:13 2018 -0300 Committer: javando Committed: Mon Apr 2 23:27:13 2018 -0300 -- .../framework/state/ConnectionStateManager.java | 1 + .../recipes/leader/TestLeaderLatch.java | 30 2 files changed, 31 insertions(+) -- http://git-wip-us.apache.org/repos/asf/curator/blob/72b7b870/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 0c8ddf8..fedcedf 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 @@ -253,6 +253,7 @@ public class ConnectionStateManager implements Closeable { int lastNegotiatedSessionTimeoutMs = client.getZookeeperClient().getLastNegotiatedSessionTimeoutMs(); int useSessionTimeoutMs = (lastNegotiatedSessionTimeoutMs > 0) ? lastNegotiatedSessionTimeoutMs : sessionTimeoutMs; +useSessionTimeoutMs = sessionExpirationPercent > 0 && startOfSuspendedEpoch != 0 ? (useSessionTimeoutMs * sessionExpirationPercent) / 100 : useSessionTimeoutMs; long elapsedMs = startOfSuspendedEpoch == 0 ? useSessionTimeoutMs / 2 : System.currentTimeMillis() - startOfSuspendedEpoch; long pollMaxMs = useSessionTimeoutMs - elapsedMs; http://git-wip-us.apache.org/repos/asf/curator/blob/72b7b870/curator-recipes/src/test/java/org/apache/curator/framework/recipes/leader/TestLeaderLatch.java -- diff --git a/curator-recipes/src/test/java/org/apache/curator/framework/recipes/leader/TestLeaderLatch.java b/curator-recipes/src/test/java/org/apache/curator/framework/recipes/leader/TestLeaderLatch.java index 011e4a0..af1475d 100644 --- a/curator-recipes/src/test/java/org/apache/curator/framework/recipes/leader/TestLeaderLatch.java +++ b/curator-recipes/src/test/java/org/apache/curator/framework/recipes/leader/TestLeaderLatch.java @@ -23,6 +23,7 @@ import com.google.common.base.Throwables; import com.google.common.collect.Lists; import com.google.common.collect.Queues; import com.google.common.util.concurrent.ThreadFactoryBuilder; +import org.apache.curator.connection.StandardConnectionHandlingPolicy; import org.apache.curator.framework.CuratorFramework; import org.apache.curator.framework.CuratorFrameworkFactory; import org.apache.curator.framework.imps.TestCleanState; @@ -222,6 +223,35 @@ public class TestLeaderLatch extends BaseClassForTests next.add(states.poll(timing.forSessionSleep().milliseconds(), TimeUnit.MILLISECONDS)); next.add(states.poll(timing.forSessionSleep().milliseconds(), TimeUnit.MILLISECONDS)); Assert.assertTrue(next.equals(Arrays.asList(ConnectionState.LOST.name(), "false")) || next.equals(Arrays.asList("false", ConnectionState.LOST.name())), next.toString()); + +latch.close(); +client.close(); + +timing.sleepABit(); +states.clear(); +server = new TestingServer(); +client = CuratorFrameworkFactory.builder() +.connectString(server.getConnectString()) +.connectionTimeoutMs(1000) +.sessionTimeoutMs(timing.session()) +.retryPolicy(new RetryOneTime(1)) +.connectionStateErrorPolicy(new SessionConnectionStateErrorPolicy()) +.connectionHandlingPolicy(new StandardConnectionHandlingPolicy(30)) +.build(); +client.getConnectionStateListenable().addListener(stateListener); +client.start(); +latch = new LeaderLatch(client, "/test"); +latch.addListener(listener); +latch.start(); + Assert.assertEquals(states.poll(timing.forWaiting().milliseconds(), TimeUnit.MILLISECONDS),
[4/6] curator git commit: CURATOR-460 Removing unnecessary empty lines
CURATOR-460 Removing unnecessary empty lines Project: http://git-wip-us.apache.org/repos/asf/curator/repo Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/9123e04c Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/9123e04c Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/9123e04c Branch: refs/heads/master Commit: 9123e04c2e1410877c29d3db125ebedffb9e912e Parents: 0a5b29d Author: javandoAuthored: Wed Apr 4 23:17:39 2018 -0300 Committer: javando Committed: Wed Apr 4 23:17:39 2018 -0300 -- .../apache/curator/framework/state/ConnectionStateManager.java| 3 --- 1 file changed, 3 deletions(-) -- http://git-wip-us.apache.org/repos/asf/curator/blob/9123e04c/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 76c5636..609bfa0 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 @@ -253,16 +253,13 @@ public class ConnectionStateManager implements Closeable { long localStartOfSuspendedEpoch; - synchronized (this) { localStartOfSuspendedEpoch = this.startOfSuspendedEpoch; } - int lastNegotiatedSessionTimeoutMs = client.getZookeeperClient().getLastNegotiatedSessionTimeoutMs(); int useSessionTimeoutMs = (lastNegotiatedSessionTimeoutMs > 0) ? lastNegotiatedSessionTimeoutMs : sessionTimeoutMs; useSessionTimeoutMs = sessionExpirationPercent > 0 && localStartOfSuspendedEpoch != 0 ? (useSessionTimeoutMs * sessionExpirationPercent) / 100 : useSessionTimeoutMs; long elapsedMs = localStartOfSuspendedEpoch == 0 ? useSessionTimeoutMs / 2 : System.currentTimeMillis() - localStartOfSuspendedEpoch; - long pollMaxMs = useSessionTimeoutMs - elapsedMs; final ConnectionState newState = eventQueue.poll(pollMaxMs, TimeUnit.MILLISECONDS);
[6/6] curator git commit: CURATOR-460 Make startOfSuspendedEpoch volatile
CURATOR-460 Make startOfSuspendedEpoch volatile Project: http://git-wip-us.apache.org/repos/asf/curator/repo Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/5920c744 Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/5920c744 Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/5920c744 Branch: refs/heads/CURATOR-460 Commit: 5920c744508afd678a20309313e1b8d78baac0c4 Parents: b6af8fd Author: javandoAuthored: Fri Apr 6 00:39:21 2018 -0300 Committer: javando Committed: Fri Apr 6 00:39:21 2018 -0300 -- .../framework/state/ConnectionStateManager.java| 17 + 1 file changed, 5 insertions(+), 12 deletions(-) -- http://git-wip-us.apache.org/repos/asf/curator/blob/5920c744/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 b66ca7e..b9384d2 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 @@ -75,8 +75,8 @@ public class ConnectionStateManager implements Closeable // guarded by sync private ConnectionState currentConnectionState; -// guarded by sync -private long startOfSuspendedEpoch = 0; + +private volatile long startOfSuspendedEpoch = 0; private enum State { @@ -251,15 +251,8 @@ public class ConnectionStateManager implements Closeable { try { - -int useSessionTimeoutMs; -long elapsedMs; - -synchronized (this) { -useSessionTimeoutMs = getUseSessionTimeoutMs(); -elapsedMs = this.startOfSuspendedEpoch == 0 ? useSessionTimeoutMs / 2 : System.currentTimeMillis() - this.startOfSuspendedEpoch; -} - +int useSessionTimeoutMs = getUseSessionTimeoutMs(); +long elapsedMs = startOfSuspendedEpoch == 0 ? useSessionTimeoutMs / 2 : System.currentTimeMillis() - startOfSuspendedEpoch; long pollMaxMs = useSessionTimeoutMs - elapsedMs; final ConnectionState newState = eventQueue.poll(pollMaxMs, TimeUnit.MILLISECONDS); @@ -339,7 +332,7 @@ public class ConnectionStateManager implements Closeable startOfSuspendedEpoch = (currentConnectionState == ConnectionState.SUSPENDED) ? System.currentTimeMillis() : 0; } -private synchronized int getUseSessionTimeoutMs() { +private int getUseSessionTimeoutMs() { int lastNegotiatedSessionTimeoutMs = client.getZookeeperClient().getLastNegotiatedSessionTimeoutMs(); int useSessionTimeoutMs = (lastNegotiatedSessionTimeoutMs > 0) ? lastNegotiatedSessionTimeoutMs : sessionTimeoutMs; useSessionTimeoutMs = sessionExpirationPercent > 0 && startOfSuspendedEpoch != 0 ? (useSessionTimeoutMs * sessionExpirationPercent) / 100 : useSessionTimeoutMs;
[5/6] curator git commit: CURATOR-460 Abstraction of getUseSessionTimeoutMs and readability improvements
CURATOR-460 Abstraction of getUseSessionTimeoutMs and readability improvements Project: http://git-wip-us.apache.org/repos/asf/curator/repo Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/b6af8fda Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/b6af8fda Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/b6af8fda Branch: refs/heads/CURATOR-460 Commit: b6af8fdabbb620d6f01ce9453efba1fe1ef60205 Parents: 9123e04 Author: javandoAuthored: Thu Apr 5 23:56:32 2018 -0300 Committer: javando Committed: Thu Apr 5 23:56:32 2018 -0300 -- .../framework/state/ConnectionStateManager.java | 24 1 file changed, 15 insertions(+), 9 deletions(-) -- http://git-wip-us.apache.org/repos/asf/curator/blob/b6af8fda/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 609bfa0..b66ca7e 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 @@ -252,14 +252,14 @@ public class ConnectionStateManager implements Closeable try { -long localStartOfSuspendedEpoch; +int useSessionTimeoutMs; +long elapsedMs; + synchronized (this) { -localStartOfSuspendedEpoch = this.startOfSuspendedEpoch; +useSessionTimeoutMs = getUseSessionTimeoutMs(); +elapsedMs = this.startOfSuspendedEpoch == 0 ? useSessionTimeoutMs / 2 : System.currentTimeMillis() - this.startOfSuspendedEpoch; } -int lastNegotiatedSessionTimeoutMs = client.getZookeeperClient().getLastNegotiatedSessionTimeoutMs(); -int useSessionTimeoutMs = (lastNegotiatedSessionTimeoutMs > 0) ? lastNegotiatedSessionTimeoutMs : sessionTimeoutMs; -useSessionTimeoutMs = sessionExpirationPercent > 0 && localStartOfSuspendedEpoch != 0 ? (useSessionTimeoutMs * sessionExpirationPercent) / 100 : useSessionTimeoutMs; -long elapsedMs = localStartOfSuspendedEpoch == 0 ? useSessionTimeoutMs / 2 : System.currentTimeMillis() - localStartOfSuspendedEpoch; + long pollMaxMs = useSessionTimeoutMs - elapsedMs; final ConnectionState newState = eventQueue.poll(pollMaxMs, TimeUnit.MILLISECONDS); @@ -305,9 +305,7 @@ public class ConnectionStateManager implements Closeable if ( (currentConnectionState == ConnectionState.SUSPENDED) && (startOfSuspendedEpoch != 0) ) { long elapsedMs = System.currentTimeMillis() - startOfSuspendedEpoch; -int lastNegotiatedSessionTimeoutMs = client.getZookeeperClient().getLastNegotiatedSessionTimeoutMs(); -int useSessionTimeoutMs = (lastNegotiatedSessionTimeoutMs > 0) ? lastNegotiatedSessionTimeoutMs : sessionTimeoutMs; -useSessionTimeoutMs = (useSessionTimeoutMs * sessionExpirationPercent) / 100; +int useSessionTimeoutMs = getUseSessionTimeoutMs(); if ( elapsedMs >= useSessionTimeoutMs ) { log.warn(String.format("Session timeout has elapsed while SUSPENDED. Injecting a session expiration. Elapsed ms: %d. Adjusted session timeout ms: %d", elapsedMs, useSessionTimeoutMs)); @@ -340,4 +338,12 @@ public class ConnectionStateManager implements Closeable currentConnectionState = newConnectionState; startOfSuspendedEpoch = (currentConnectionState == ConnectionState.SUSPENDED) ? System.currentTimeMillis() : 0; } + +private synchronized int getUseSessionTimeoutMs() { +int lastNegotiatedSessionTimeoutMs = client.getZookeeperClient().getLastNegotiatedSessionTimeoutMs(); +int useSessionTimeoutMs = (lastNegotiatedSessionTimeoutMs > 0) ? lastNegotiatedSessionTimeoutMs : sessionTimeoutMs; +useSessionTimeoutMs = sessionExpirationPercent > 0 && startOfSuspendedEpoch != 0 ? (useSessionTimeoutMs * sessionExpirationPercent) / 100 : useSessionTimeoutMs; +return useSessionTimeoutMs; +} + }
[2/6] curator git commit: CURATOR-460 Synchronize access to startOfSuspendedEpoch
CURATOR-460 Synchronize access to startOfSuspendedEpoch Project: http://git-wip-us.apache.org/repos/asf/curator/repo Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/6e854670 Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/6e854670 Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/6e854670 Branch: refs/heads/CURATOR-460 Commit: 6e8546706b1bdc267126c37601ac646584461c12 Parents: 72b7b87 Author: javandoAuthored: Wed Apr 4 23:09:10 2018 -0300 Committer: javando Committed: Wed Apr 4 23:09:10 2018 -0300 -- .../curator/framework/state/ConnectionStateManager.java | 12 ++-- 1 file changed, 10 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/curator/blob/6e854670/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 fedcedf..76c5636 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 @@ -251,10 +251,18 @@ public class ConnectionStateManager implements Closeable { try { + +long localStartOfSuspendedEpoch; + +synchronized (this) { +localStartOfSuspendedEpoch = this.startOfSuspendedEpoch; +} + int lastNegotiatedSessionTimeoutMs = client.getZookeeperClient().getLastNegotiatedSessionTimeoutMs(); int useSessionTimeoutMs = (lastNegotiatedSessionTimeoutMs > 0) ? lastNegotiatedSessionTimeoutMs : sessionTimeoutMs; -useSessionTimeoutMs = sessionExpirationPercent > 0 && startOfSuspendedEpoch != 0 ? (useSessionTimeoutMs * sessionExpirationPercent) / 100 : useSessionTimeoutMs; -long elapsedMs = startOfSuspendedEpoch == 0 ? useSessionTimeoutMs / 2 : System.currentTimeMillis() - startOfSuspendedEpoch; +useSessionTimeoutMs = sessionExpirationPercent > 0 && localStartOfSuspendedEpoch != 0 ? (useSessionTimeoutMs * sessionExpirationPercent) / 100 : useSessionTimeoutMs; +long elapsedMs = localStartOfSuspendedEpoch == 0 ? useSessionTimeoutMs / 2 : System.currentTimeMillis() - localStartOfSuspendedEpoch; + long pollMaxMs = useSessionTimeoutMs - elapsedMs; final ConnectionState newState = eventQueue.poll(pollMaxMs, TimeUnit.MILLISECONDS);
[4/6] curator git commit: CURATOR-460 Removing unnecessary empty lines
CURATOR-460 Removing unnecessary empty lines Project: http://git-wip-us.apache.org/repos/asf/curator/repo Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/9123e04c Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/9123e04c Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/9123e04c Branch: refs/heads/CURATOR-460 Commit: 9123e04c2e1410877c29d3db125ebedffb9e912e Parents: 0a5b29d Author: javandoAuthored: Wed Apr 4 23:17:39 2018 -0300 Committer: javando Committed: Wed Apr 4 23:17:39 2018 -0300 -- .../apache/curator/framework/state/ConnectionStateManager.java| 3 --- 1 file changed, 3 deletions(-) -- http://git-wip-us.apache.org/repos/asf/curator/blob/9123e04c/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 76c5636..609bfa0 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 @@ -253,16 +253,13 @@ public class ConnectionStateManager implements Closeable { long localStartOfSuspendedEpoch; - synchronized (this) { localStartOfSuspendedEpoch = this.startOfSuspendedEpoch; } - int lastNegotiatedSessionTimeoutMs = client.getZookeeperClient().getLastNegotiatedSessionTimeoutMs(); int useSessionTimeoutMs = (lastNegotiatedSessionTimeoutMs > 0) ? lastNegotiatedSessionTimeoutMs : sessionTimeoutMs; useSessionTimeoutMs = sessionExpirationPercent > 0 && localStartOfSuspendedEpoch != 0 ? (useSessionTimeoutMs * sessionExpirationPercent) / 100 : useSessionTimeoutMs; long elapsedMs = localStartOfSuspendedEpoch == 0 ? useSessionTimeoutMs / 2 : System.currentTimeMillis() - localStartOfSuspendedEpoch; - long pollMaxMs = useSessionTimeoutMs - elapsedMs; final ConnectionState newState = eventQueue.poll(pollMaxMs, TimeUnit.MILLISECONDS);
curator git commit: Remove calls to deprecated MoreExecutors.sameThreadExecutor
Repository: curator Updated Branches: refs/heads/master d502dde1c -> 6d36a4793 Remove calls to deprecated MoreExecutors.sameThreadExecutor Project: http://git-wip-us.apache.org/repos/asf/curator/repo Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/6d36a479 Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/6d36a479 Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/6d36a479 Branch: refs/heads/master Commit: 6d36a4793b31cdacaf4bbf6554e05d68bc680001 Parents: d502dde Author: Kenneth McFarlandAuthored: Fri Oct 20 21:05:12 2017 -0700 Committer: Kenneth McFarland Committed: Fri Oct 20 21:05:12 2017 -0700 -- .../org/apache/curator/framework/listen/ListenerContainer.java | 2 +- .../curator/framework/recipes/locks/InterProcessMutex.java | 2 +- .../org/apache/curator/framework/recipes/queue/QueueBuilder.java | 4 ++-- .../org/apache/curator/framework/recipes/shared/SharedCount.java | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) -- http://git-wip-us.apache.org/repos/asf/curator/blob/6d36a479/curator-framework/src/main/java/org/apache/curator/framework/listen/ListenerContainer.java -- diff --git a/curator-framework/src/main/java/org/apache/curator/framework/listen/ListenerContainer.java b/curator-framework/src/main/java/org/apache/curator/framework/listen/ListenerContainer.java index 549ed81..fd4497a 100644 --- a/curator-framework/src/main/java/org/apache/curator/framework/listen/ListenerContainer.java +++ b/curator-framework/src/main/java/org/apache/curator/framework/listen/ListenerContainer.java @@ -38,7 +38,7 @@ public class ListenerContainer implements Listenable @Override public void addListener(T listener) { -addListener(listener, MoreExecutors.sameThreadExecutor()); +addListener(listener, MoreExecutors.directExecutor()); } @Override http://git-wip-us.apache.org/repos/asf/curator/blob/6d36a479/curator-recipes/src/main/java/org/apache/curator/framework/recipes/locks/InterProcessMutex.java -- diff --git a/curator-recipes/src/main/java/org/apache/curator/framework/recipes/locks/InterProcessMutex.java b/curator-recipes/src/main/java/org/apache/curator/framework/recipes/locks/InterProcessMutex.java index 08b8ba1..77ef685 100644 --- a/curator-recipes/src/main/java/org/apache/curator/framework/recipes/locks/InterProcessMutex.java +++ b/curator-recipes/src/main/java/org/apache/curator/framework/recipes/locks/InterProcessMutex.java @@ -173,7 +173,7 @@ public class InterProcessMutex implements InterProcessLock, Revocable listener) { -makeRevocable(listener, MoreExecutors.sameThreadExecutor()); +makeRevocable(listener, MoreExecutors.directExecutor()); } @Override http://git-wip-us.apache.org/repos/asf/curator/blob/6d36a479/curator-recipes/src/main/java/org/apache/curator/framework/recipes/queue/QueueBuilder.java -- diff --git a/curator-recipes/src/main/java/org/apache/curator/framework/recipes/queue/QueueBuilder.java b/curator-recipes/src/main/java/org/apache/curator/framework/recipes/queue/QueueBuilder.java index a571578..39ba192 100644 --- a/curator-recipes/src/main/java/org/apache/curator/framework/recipes/queue/QueueBuilder.java +++ b/curator-recipes/src/main/java/org/apache/curator/framework/recipes/queue/QueueBuilder.java @@ -187,7 +187,7 @@ public class QueueBuilder } /** - * Change the executor used. The default is {@link MoreExecutors#sameThreadExecutor()} + * Change the executor used. The default is {@link MoreExecutors#directExectutor()} * * @param executor new executor to use * @return this @@ -269,6 +269,6 @@ public class QueueBuilder this.queuePath = PathUtils.validatePath(queuePath); factory = defaultThreadFactory; -executor = MoreExecutors.sameThreadExecutor(); +executor = MoreExecutors.directExecutor(); } } http://git-wip-us.apache.org/repos/asf/curator/blob/6d36a479/curator-recipes/src/main/java/org/apache/curator/framework/recipes/shared/SharedCount.java -- diff --git a/curator-recipes/src/main/java/org/apache/curator/framework/recipes/shared/SharedCount.java b/curator-recipes/src/main/java/org/apache/curator/framework/recipes/shared/SharedCount.java index 6375bdf..8ae9072 100644 --- a/curator-recipes/src/main/java/org/apache/curator/framework/recipes/shared/SharedCount.java +++ b/curator-recipes/src/main/java/org/apache/curator/framework/recipes/shared/SharedCount.java @@ -119,7 +119,7 @@ public
[1/2] curator git commit: CURATOR-431 - Fixed stat population during create
Repository: curator Updated Branches: refs/heads/master 15eb063fa -> c86ca9732 CURATOR-431 - Fixed stat population during create -The stat object was not being populated if the create failed due to the node already existing. Project: http://git-wip-us.apache.org/repos/asf/curator/repo Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/931f1de5 Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/931f1de5 Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/931f1de5 Branch: refs/heads/master Commit: 931f1de5c4f72b71e96ea2071add297194e053bd Parents: 15eb063 Author: Cam McKenzieAuthored: Tue Sep 12 08:58:47 2017 +1000 Committer: Cam McKenzie Committed: Tue Sep 12 08:58:47 2017 +1000 -- .../framework/imps/CreateBuilderImpl.java | 16 ++- .../framework/imps/TestCreateReturningStat.java | 30 2 files changed, 45 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/curator/blob/931f1de5/curator-framework/src/main/java/org/apache/curator/framework/imps/CreateBuilderImpl.java -- diff --git a/curator-framework/src/main/java/org/apache/curator/framework/imps/CreateBuilderImpl.java b/curator-framework/src/main/java/org/apache/curator/framework/imps/CreateBuilderImpl.java index 11050f3..f796584 100644 --- a/curator-framework/src/main/java/org/apache/curator/framework/imps/CreateBuilderImpl.java +++ b/curator-framework/src/main/java/org/apache/curator/framework/imps/CreateBuilderImpl.java @@ -1212,7 +1212,21 @@ public class CreateBuilderImpl implements CreateBuilder, CreateBuilder2, Backgro { if ( setDataIfExists ) { -client.getZooKeeper().setData(path, data, setDataIfExistsVersion); +Stat setStat = client.getZooKeeper().setData(path, data, setDataIfExistsVersion); +if(storingStat != null) +{ + storingStat.setAversion(setStat.getAversion()); + storingStat.setCtime(setStat.getCtime()); + storingStat.setCversion(setStat.getCversion()); + storingStat.setCzxid(setStat.getCzxid()); + storingStat.setDataLength(setStat.getDataLength()); + storingStat.setEphemeralOwner(setStat.getEphemeralOwner()); + storingStat.setMtime(setStat.getMtime()); + storingStat.setMzxid(setStat.getMzxid()); + storingStat.setNumChildren(setStat.getNumChildren()); + storingStat.setPzxid(setStat.getPzxid()); + storingStat.setVersion(setStat.getVersion()); +} createdPath = path; } else http://git-wip-us.apache.org/repos/asf/curator/blob/931f1de5/curator-framework/src/test/java/org/apache/curator/framework/imps/TestCreateReturningStat.java -- diff --git a/curator-framework/src/test/java/org/apache/curator/framework/imps/TestCreateReturningStat.java b/curator-framework/src/test/java/org/apache/curator/framework/imps/TestCreateReturningStat.java index 67a960f..034791d 100755 --- a/curator-framework/src/test/java/org/apache/curator/framework/imps/TestCreateReturningStat.java +++ b/curator-framework/src/test/java/org/apache/curator/framework/imps/TestCreateReturningStat.java @@ -54,6 +54,36 @@ public class TestCreateReturningStat extends CuratorTestBase } @Test +public void testOrSetDataStoringStatIn() throws Exception { +try (CuratorFramework client = createClient()) +{ +client.start(); +client.getZookeeperClient().blockUntilConnectedOrTimedOut(); + +final String path = "/test"; + +final Stat versionZeroStat = new Stat(); + client.create().orSetData().storingStatIn(versionZeroStat).forPath(path); +Assert.assertEquals(0, versionZeroStat.getVersion()); + +final Stat versionOneStat = new Stat(); + client.create().orSetData().storingStatIn(versionOneStat).forPath(path); + +Assert.assertEquals(versionZeroStat.getAversion(), versionOneStat.getAversion()); +
curator git commit: CURATOR-431 - Clean up stat population
Repository: curator Updated Branches: refs/heads/CURATOR-431 931f1de5c -> c86ca9732 CURATOR-431 - Clean up stat population -Modified the population of the stat object to use DataTree#copyStat() Project: http://git-wip-us.apache.org/repos/asf/curator/repo Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/c86ca973 Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/c86ca973 Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/c86ca973 Branch: refs/heads/CURATOR-431 Commit: c86ca97326bc68e63b6b10c913cd8e73c0d57d7e Parents: 931f1de Author: Cam McKenzieAuthored: Wed Sep 13 09:48:18 2017 +1000 Committer: Cam McKenzie Committed: Wed Sep 13 09:48:18 2017 +1000 -- .../framework/imps/CreateBuilderImpl.java | 26 +++- 1 file changed, 4 insertions(+), 22 deletions(-) -- http://git-wip-us.apache.org/repos/asf/curator/blob/c86ca973/curator-framework/src/main/java/org/apache/curator/framework/imps/CreateBuilderImpl.java -- diff --git a/curator-framework/src/main/java/org/apache/curator/framework/imps/CreateBuilderImpl.java b/curator-framework/src/main/java/org/apache/curator/framework/imps/CreateBuilderImpl.java index f796584..b2a3fbc 100644 --- a/curator-framework/src/main/java/org/apache/curator/framework/imps/CreateBuilderImpl.java +++ b/curator-framework/src/main/java/org/apache/curator/framework/imps/CreateBuilderImpl.java @@ -38,6 +38,8 @@ import org.apache.zookeeper.KeeperException; import org.apache.zookeeper.Op; import org.apache.zookeeper.data.ACL; import org.apache.zookeeper.data.Stat; +import org.apache.zookeeper.server.DataTree; + import java.util.List; import java.util.UUID; import java.util.concurrent.Callable; @@ -640,17 +642,7 @@ public class CreateBuilderImpl implements CreateBuilder, CreateBuilder2, Backgro if ( (stat != null) && (storingStat != null) ) { -storingStat.setAversion(stat.getAversion()); -storingStat.setCtime(stat.getCtime()); -storingStat.setCversion(stat.getCversion()); -storingStat.setCzxid(stat.getCzxid()); -storingStat.setDataLength(stat.getDataLength()); - storingStat.setEphemeralOwner(stat.getEphemeralOwner()); -storingStat.setMtime(stat.getMtime()); -storingStat.setMzxid(stat.getMzxid()); -storingStat.setNumChildren(stat.getNumChildren()); -storingStat.setPzxid(stat.getPzxid()); -storingStat.setVersion(stat.getVersion()); +DataTree.copyStat(stat, storingStat); } if ( (rc == KeeperException.Code.NONODE.intValue()) && createParentsIfNeeded ) @@ -1215,17 +1207,7 @@ public class CreateBuilderImpl implements CreateBuilder, CreateBuilder2, Backgro Stat setStat = client.getZooKeeper().setData(path, data, setDataIfExistsVersion); if(storingStat != null) { - storingStat.setAversion(setStat.getAversion()); - storingStat.setCtime(setStat.getCtime()); - storingStat.setCversion(setStat.getCversion()); - storingStat.setCzxid(setStat.getCzxid()); - storingStat.setDataLength(setStat.getDataLength()); - storingStat.setEphemeralOwner(setStat.getEphemeralOwner()); - storingStat.setMtime(setStat.getMtime()); - storingStat.setMzxid(setStat.getMzxid()); - storingStat.setNumChildren(setStat.getNumChildren()); - storingStat.setPzxid(setStat.getPzxid()); - storingStat.setVersion(setStat.getVersion()); +DataTree.copyStat(setStat, storingStat); } createdPath = path; }
curator git commit: CURATOR-431 - Fixed stat population during create
Repository: curator Updated Branches: refs/heads/CURATOR-431 [created] 931f1de5c CURATOR-431 - Fixed stat population during create -The stat object was not being populated if the create failed due to the node already existing. Project: http://git-wip-us.apache.org/repos/asf/curator/repo Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/931f1de5 Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/931f1de5 Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/931f1de5 Branch: refs/heads/CURATOR-431 Commit: 931f1de5c4f72b71e96ea2071add297194e053bd Parents: 15eb063 Author: Cam McKenzieAuthored: Tue Sep 12 08:58:47 2017 +1000 Committer: Cam McKenzie Committed: Tue Sep 12 08:58:47 2017 +1000 -- .../framework/imps/CreateBuilderImpl.java | 16 ++- .../framework/imps/TestCreateReturningStat.java | 30 2 files changed, 45 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/curator/blob/931f1de5/curator-framework/src/main/java/org/apache/curator/framework/imps/CreateBuilderImpl.java -- diff --git a/curator-framework/src/main/java/org/apache/curator/framework/imps/CreateBuilderImpl.java b/curator-framework/src/main/java/org/apache/curator/framework/imps/CreateBuilderImpl.java index 11050f3..f796584 100644 --- a/curator-framework/src/main/java/org/apache/curator/framework/imps/CreateBuilderImpl.java +++ b/curator-framework/src/main/java/org/apache/curator/framework/imps/CreateBuilderImpl.java @@ -1212,7 +1212,21 @@ public class CreateBuilderImpl implements CreateBuilder, CreateBuilder2, Backgro { if ( setDataIfExists ) { -client.getZooKeeper().setData(path, data, setDataIfExistsVersion); +Stat setStat = client.getZooKeeper().setData(path, data, setDataIfExistsVersion); +if(storingStat != null) +{ + storingStat.setAversion(setStat.getAversion()); + storingStat.setCtime(setStat.getCtime()); + storingStat.setCversion(setStat.getCversion()); + storingStat.setCzxid(setStat.getCzxid()); + storingStat.setDataLength(setStat.getDataLength()); + storingStat.setEphemeralOwner(setStat.getEphemeralOwner()); + storingStat.setMtime(setStat.getMtime()); + storingStat.setMzxid(setStat.getMzxid()); + storingStat.setNumChildren(setStat.getNumChildren()); + storingStat.setPzxid(setStat.getPzxid()); + storingStat.setVersion(setStat.getVersion()); +} createdPath = path; } else http://git-wip-us.apache.org/repos/asf/curator/blob/931f1de5/curator-framework/src/test/java/org/apache/curator/framework/imps/TestCreateReturningStat.java -- diff --git a/curator-framework/src/test/java/org/apache/curator/framework/imps/TestCreateReturningStat.java b/curator-framework/src/test/java/org/apache/curator/framework/imps/TestCreateReturningStat.java index 67a960f..034791d 100755 --- a/curator-framework/src/test/java/org/apache/curator/framework/imps/TestCreateReturningStat.java +++ b/curator-framework/src/test/java/org/apache/curator/framework/imps/TestCreateReturningStat.java @@ -54,6 +54,36 @@ public class TestCreateReturningStat extends CuratorTestBase } @Test +public void testOrSetDataStoringStatIn() throws Exception { +try (CuratorFramework client = createClient()) +{ +client.start(); +client.getZookeeperClient().blockUntilConnectedOrTimedOut(); + +final String path = "/test"; + +final Stat versionZeroStat = new Stat(); + client.create().orSetData().storingStatIn(versionZeroStat).forPath(path); +Assert.assertEquals(0, versionZeroStat.getVersion()); + +final Stat versionOneStat = new Stat(); + client.create().orSetData().storingStatIn(versionOneStat).forPath(path); + +Assert.assertEquals(versionZeroStat.getAversion(), versionOneStat.getAversion()); +
svn commit: r18582 - in /dev/curator: 2.11.1/ 3.2.1/
Author: cammckenzie Date: Mon Mar 6 22:10:07 2017 New Revision: 18582 Log: Removing old releases Removed: dev/curator/2.11.1/ dev/curator/3.2.1/
[2/2] 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/87a145ca Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/87a145ca Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/87a145ca Branch: refs/heads/CURATOR-3.0 Commit: 87a145ca3346cd1bab8a4fbdc3b1d3d9fe237dc7 Parents: 8b9f7d5 Author: Cam McKenzieAuthored: Wed Mar 1 15:27:44 2017 +1100 Committer: Cam McKenzie Committed: Wed Mar 1 15:27:44 2017 +1100 -- curator-client/pom.xml | 4 ++-- curator-examples/pom.xml | 2 +- curator-framework/pom.xml | 4 ++-- curator-recipes/pom.xml| 4 ++-- curator-test/pom.xml | 4 ++-- curator-x-async/pom.xml| 2 +- curator-x-discovery-server/pom.xml | 4 ++-- curator-x-discovery/pom.xml| 4 ++-- curator-x-rpc/pom.xml | 4 ++-- pom.xml| 4 ++-- 10 files changed, 18 insertions(+), 18 deletions(-) -- http://git-wip-us.apache.org/repos/asf/curator/blob/87a145ca/curator-client/pom.xml -- diff --git a/curator-client/pom.xml b/curator-client/pom.xml index dd7c719..13c1551 100644 --- a/curator-client/pom.xml +++ b/curator-client/pom.xml @@ -23,11 +23,11 @@ org.apache.curator apache-curator -3.3.0 +3.3.1-SNAPSHOT curator-client -3.3.0 +3.3.1-SNAPSHOT bundle Curator Client http://git-wip-us.apache.org/repos/asf/curator/blob/87a145ca/curator-examples/pom.xml -- diff --git a/curator-examples/pom.xml b/curator-examples/pom.xml index fbbd271..f612cc2 100644 --- a/curator-examples/pom.xml +++ b/curator-examples/pom.xml @@ -24,7 +24,7 @@ org.apache.curator apache-curator -3.3.0 +3.3.1-SNAPSHOT curator-examples http://git-wip-us.apache.org/repos/asf/curator/blob/87a145ca/curator-framework/pom.xml -- diff --git a/curator-framework/pom.xml b/curator-framework/pom.xml index 5e1507a..2f36e73 100644 --- a/curator-framework/pom.xml +++ b/curator-framework/pom.xml @@ -24,11 +24,11 @@ org.apache.curator apache-curator -3.3.0 +3.3.1-SNAPSHOT curator-framework -3.3.0 +3.3.1-SNAPSHOT bundle Curator Framework http://git-wip-us.apache.org/repos/asf/curator/blob/87a145ca/curator-recipes/pom.xml -- diff --git a/curator-recipes/pom.xml b/curator-recipes/pom.xml index 370a468..77f2a51 100644 --- a/curator-recipes/pom.xml +++ b/curator-recipes/pom.xml @@ -24,11 +24,11 @@ org.apache.curator apache-curator -3.3.0 +3.3.1-SNAPSHOT curator-recipes -3.3.0 +3.3.1-SNAPSHOT bundle Curator Recipes http://git-wip-us.apache.org/repos/asf/curator/blob/87a145ca/curator-test/pom.xml -- diff --git a/curator-test/pom.xml b/curator-test/pom.xml index e62a542..fb28d53 100644 --- a/curator-test/pom.xml +++ b/curator-test/pom.xml @@ -24,11 +24,11 @@ org.apache.curator apache-curator -3.3.0 +3.3.1-SNAPSHOT curator-test -3.3.0 +3.3.1-SNAPSHOT Curator Testing Unit testing utilities. http://git-wip-us.apache.org/repos/asf/curator/blob/87a145ca/curator-x-async/pom.xml -- diff --git a/curator-x-async/pom.xml b/curator-x-async/pom.xml index f7cf81a..a7fdcd5 100644 --- a/curator-x-async/pom.xml +++ b/curator-x-async/pom.xml @@ -3,7 +3,7 @@ org.apache.curator apache-curator -3.3.0 +3.3.1-SNAPSHOT 4.0.0 http://git-wip-us.apache.org/repos/asf/curator/blob/87a145ca/curator-x-discovery-server/pom.xml -- diff --git a/curator-x-discovery-server/pom.xml b/curator-x-discovery-server/pom.xml index 3060651..b23e2cf 100644 --- a/curator-x-discovery-server/pom.xml +++ b/curator-x-discovery-server/pom.xml @@ -24,11 +24,11 @@ org.apache.curator apache-curator -3.3.0 +3.3.1-SNAPSHOT curator-x-discovery-server -3.3.0 +3.3.1-SNAPSHOT bundle Curator Service Discovery Server http://git-wip-us.apache.org/repos/asf/curator/blob/87a145ca/curator-x-discovery/pom.xml
[curator] Git Push Summary
Repository: curator Updated Tags: refs/tags/apache-curator-3.3.0 [created] 4c065fbd2
[1/2] curator git commit: [maven-release-plugin] prepare release apache-curator-3.3.0
Repository: curator Updated Branches: refs/heads/CURATOR-3.0 753142a76 -> 87a145ca3 [maven-release-plugin] prepare release apache-curator-3.3.0 Project: http://git-wip-us.apache.org/repos/asf/curator/repo Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/8b9f7d5c Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/8b9f7d5c Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/8b9f7d5c Branch: refs/heads/CURATOR-3.0 Commit: 8b9f7d5ce0369976f766745069be62e2b126ef22 Parents: 753142a Author: Cam McKenzieAuthored: Wed Mar 1 15:27:33 2017 +1100 Committer: Cam McKenzie Committed: Wed Mar 1 15:27:33 2017 +1100 -- curator-client/pom.xml | 4 ++-- curator-examples/pom.xml | 2 +- curator-framework/pom.xml | 4 ++-- curator-recipes/pom.xml| 4 ++-- curator-test/pom.xml | 4 ++-- curator-x-async/pom.xml| 2 +- curator-x-discovery-server/pom.xml | 4 ++-- curator-x-discovery/pom.xml| 4 ++-- curator-x-rpc/pom.xml | 4 ++-- pom.xml| 4 ++-- 10 files changed, 18 insertions(+), 18 deletions(-) -- http://git-wip-us.apache.org/repos/asf/curator/blob/8b9f7d5c/curator-client/pom.xml -- diff --git a/curator-client/pom.xml b/curator-client/pom.xml index 7bf373f..dd7c719 100644 --- a/curator-client/pom.xml +++ b/curator-client/pom.xml @@ -23,11 +23,11 @@ org.apache.curator apache-curator -3.2.2-SNAPSHOT +3.3.0 curator-client -3.2.2-SNAPSHOT +3.3.0 bundle Curator Client http://git-wip-us.apache.org/repos/asf/curator/blob/8b9f7d5c/curator-examples/pom.xml -- diff --git a/curator-examples/pom.xml b/curator-examples/pom.xml index ffa54af..fbbd271 100644 --- a/curator-examples/pom.xml +++ b/curator-examples/pom.xml @@ -24,7 +24,7 @@ org.apache.curator apache-curator -3.2.2-SNAPSHOT +3.3.0 curator-examples http://git-wip-us.apache.org/repos/asf/curator/blob/8b9f7d5c/curator-framework/pom.xml -- diff --git a/curator-framework/pom.xml b/curator-framework/pom.xml index 8167b0d..5e1507a 100644 --- a/curator-framework/pom.xml +++ b/curator-framework/pom.xml @@ -24,11 +24,11 @@ org.apache.curator apache-curator -3.2.2-SNAPSHOT +3.3.0 curator-framework -3.2.2-SNAPSHOT +3.3.0 bundle Curator Framework http://git-wip-us.apache.org/repos/asf/curator/blob/8b9f7d5c/curator-recipes/pom.xml -- diff --git a/curator-recipes/pom.xml b/curator-recipes/pom.xml index 0df0e8b..370a468 100644 --- a/curator-recipes/pom.xml +++ b/curator-recipes/pom.xml @@ -24,11 +24,11 @@ org.apache.curator apache-curator -3.2.2-SNAPSHOT +3.3.0 curator-recipes -3.2.2-SNAPSHOT +3.3.0 bundle Curator Recipes http://git-wip-us.apache.org/repos/asf/curator/blob/8b9f7d5c/curator-test/pom.xml -- diff --git a/curator-test/pom.xml b/curator-test/pom.xml index afc9f36..e62a542 100644 --- a/curator-test/pom.xml +++ b/curator-test/pom.xml @@ -24,11 +24,11 @@ org.apache.curator apache-curator -3.2.2-SNAPSHOT +3.3.0 curator-test -3.2.2-SNAPSHOT +3.3.0 Curator Testing Unit testing utilities. http://git-wip-us.apache.org/repos/asf/curator/blob/8b9f7d5c/curator-x-async/pom.xml -- diff --git a/curator-x-async/pom.xml b/curator-x-async/pom.xml index 8821a47..f7cf81a 100644 --- a/curator-x-async/pom.xml +++ b/curator-x-async/pom.xml @@ -3,7 +3,7 @@ org.apache.curator apache-curator -3.2.2-SNAPSHOT +3.3.0 4.0.0 http://git-wip-us.apache.org/repos/asf/curator/blob/8b9f7d5c/curator-x-discovery-server/pom.xml -- diff --git a/curator-x-discovery-server/pom.xml b/curator-x-discovery-server/pom.xml index 22aacf9..3060651 100644 --- a/curator-x-discovery-server/pom.xml +++ b/curator-x-discovery-server/pom.xml @@ -24,11 +24,11 @@ org.apache.curator apache-curator -3.2.2-SNAPSHOT +3.3.0 curator-x-discovery-server -3.2.2-SNAPSHOT +3.3.0 bundle Curator Service Discovery Server
svn commit: r18516 - in /dev/curator/3.3.0: ./ apache-curator-3.3.0-source-release.zip apache-curator-3.3.0-source-release.zip.asc apache-curator-3.3.0-source-release.zip.md5 apache-curator-3.3.0-sour
Author: cammckenzie Date: Wed Mar 1 09:23:46 2017 New Revision: 18516 Log: Adding 3.3.0 binaries Added: dev/curator/3.3.0/ dev/curator/3.3.0/apache-curator-3.3.0-source-release.zip (with props) dev/curator/3.3.0/apache-curator-3.3.0-source-release.zip.asc (with props) dev/curator/3.3.0/apache-curator-3.3.0-source-release.zip.md5 (with props) dev/curator/3.3.0/apache-curator-3.3.0-source-release.zip.sha1 (with props) Added: dev/curator/3.3.0/apache-curator-3.3.0-source-release.zip == Binary file - no diff available. Propchange: dev/curator/3.3.0/apache-curator-3.3.0-source-release.zip -- svn:executable = * Propchange: dev/curator/3.3.0/apache-curator-3.3.0-source-release.zip -- svn:mime-type = application/octet-stream Added: dev/curator/3.3.0/apache-curator-3.3.0-source-release.zip.asc == --- dev/curator/3.3.0/apache-curator-3.3.0-source-release.zip.asc (added) +++ dev/curator/3.3.0/apache-curator-3.3.0-source-release.zip.asc Wed Mar 1 09:23:46 2017 @@ -0,0 +1,18 @@ +-BEGIN PGP SIGNATURE- +Version: GnuPG v1 +Comment: GPGTools - https://gpgtools.org + +iQIcBAABCgAGBQJYtk9AAAoJEG17iHfZHfuJui4P/AwTAVvmpUWumwiwxebgu2QP +d3k3n9pFR8Fq0OAjKktNGkOTDBYU+K1wCY08qp9UPFv4HU2Un5tg3ceJzyNjQV5u +3URq3Xgmo2aqyVFsDVE6XROkIu+RSF2uoXRApnu5Sove8czZMPJ8jO/VPTrGytro +94rCNc/XiAtkMH3PjLgcMZUqBzNPFGNceQh+Uch3jyIn+J2eRHFl2okOiA0FeY01 +mbDZ6+yTOjNn3LeBnNKms2Us/3ggNa3w6jJyWAmu83DsD1r6gNynPEar8S8ZYXU+ +Nkmn991uNs82iX9eWvaZMSOsFq7vp/sFgVUiip3M5SMRidutYvBLmXjomogLZAYi +4QdOzRh8ySKIoXsSIowQLVWw0fhvmNH4TxH2+eihjFSwXurFdRgXPf80+3xILG+Z +bb+FBOAgscA5o7LePDaJY3FmrDZrT3EGcS2a/ant9kScwH7rLh8e7IGbOEO13vXj +NgLitOsaOJYpRHzStgvg1h6Bl5CVvQ20CFDRmJuwAw+YPVPEa/bcyIhllQ31dkAf +9mqv7rpKNeYHKJKg5V6O978a68WpV+GaCjYOGBh5GRYE6vuIcqgUjKqSYRBC5Tn7 +6IzZ4Tx4E1SNhTKq7TaSG3hApUsui5n6Kze9LbwnGU1obd+eC7nFE/f7+s9+ez7Y +UTzdf2L7UmeCXqzyI0XN +=ZYA0 +-END PGP SIGNATURE- Propchange: dev/curator/3.3.0/apache-curator-3.3.0-source-release.zip.asc -- svn:executable = * Added: dev/curator/3.3.0/apache-curator-3.3.0-source-release.zip.md5 == --- dev/curator/3.3.0/apache-curator-3.3.0-source-release.zip.md5 (added) +++ dev/curator/3.3.0/apache-curator-3.3.0-source-release.zip.md5 Wed Mar 1 09:23:46 2017 @@ -0,0 +1 @@ +3d3fd1e50b088e9d3f9bc522326ebb64 \ No newline at end of file Propchange: dev/curator/3.3.0/apache-curator-3.3.0-source-release.zip.md5 -- svn:executable = * Added: dev/curator/3.3.0/apache-curator-3.3.0-source-release.zip.sha1 == --- dev/curator/3.3.0/apache-curator-3.3.0-source-release.zip.sha1 (added) +++ dev/curator/3.3.0/apache-curator-3.3.0-source-release.zip.sha1 Wed Mar 1 09:23:46 2017 @@ -0,0 +1 @@ +be06c3ebc1b05d68b49d81073f72d252388a4959 \ No newline at end of file Propchange: dev/curator/3.3.0/apache-curator-3.3.0-source-release.zip.sha1 -- svn:executable = *
svn commit: r18513 - in /dev/curator/2.12.0: ./ apache-curator-2.12.0-source-release.zip apache-curator-2.12.0-source-release.zip.asc apache-curator-2.12.0-source-release.zip.md5 apache-curator-2.12.0
Author: cammckenzie Date: Wed Mar 1 04:24:49 2017 New Revision: 18513 Log: 2.12.0 binaries Added: dev/curator/2.12.0/ dev/curator/2.12.0/apache-curator-2.12.0-source-release.zip (with props) dev/curator/2.12.0/apache-curator-2.12.0-source-release.zip.asc (with props) dev/curator/2.12.0/apache-curator-2.12.0-source-release.zip.md5 (with props) dev/curator/2.12.0/apache-curator-2.12.0-source-release.zip.sha1 (with props) Added: dev/curator/2.12.0/apache-curator-2.12.0-source-release.zip == Binary file - no diff available. Propchange: dev/curator/2.12.0/apache-curator-2.12.0-source-release.zip -- svn:executable = * Propchange: dev/curator/2.12.0/apache-curator-2.12.0-source-release.zip -- svn:mime-type = application/octet-stream Added: dev/curator/2.12.0/apache-curator-2.12.0-source-release.zip.asc == --- dev/curator/2.12.0/apache-curator-2.12.0-source-release.zip.asc (added) +++ dev/curator/2.12.0/apache-curator-2.12.0-source-release.zip.asc Wed Mar 1 04:24:49 2017 @@ -0,0 +1,18 @@ +-BEGIN PGP SIGNATURE- +Version: GnuPG v1 +Comment: GPGTools - https://gpgtools.org + +iQIcBAABCgAGBQJYtkAGAAoJEG17iHfZHfuJcVYP/2Q/BpfVu5VJHUWgh/JNxU4H +MrQTg/E1nXPY3I7tRkWQt7KPTXxpO3HZRfbJpsdfIWnzTlip4w/Br46HIZLY5/O0 +j76mOQKzsTDwH0cYHBC3u1H26W99oO9pc3ix4Bya7ohhajKkHNLeMLhU67rNDKvJ +sakriOYR4msb40sfUErqCqeG3tuwtz9gR7GfXULYHHZKXaRfjqXzmrTDZWcPfx20 +08rGeAa96PbwX8jeQ2a3M8RxaYXPESnlfIUIdbmxa2mQrmO+f4AtsZPyLvDZOhRY +wIFT6yLnJSwmq+EQ1UOmn1kEx8v4NO37ehq5TN2Vn0+t8x0cnxpa/Bku4dUH3cD5 +7wedx4rJaJRtQv0Z48kbFoVz12nvOlgF/w61R920YoGA74cIvTEPdjMyOOAjaxyB +BqfNX84YQJZaVxPj1eDU4docc/Kv9F5Kgt3kR27+d3LZ1LygDEHx8RtjIMaSUWny +H/hksPlPGLPlgJrvQXPtYPqglYjLuW4WHsRIcDbj7N+/N3u2UjYebs8JdSBiKdz+ +nwghLLYOpb8M0cPAG5UJo42PbwAGmHwAPI8AcPmdM14gGUHPLqXQ+fcQkybNVUcf +APU25CxGTUBkd7KnotxQdMtQon7BhY3Yeu6hfw8kWMtUfWI/PTZaBtyD7X2JuD/n +pnvAV1XJeuCXsjDTln7r +=jPA5 +-END PGP SIGNATURE- Propchange: dev/curator/2.12.0/apache-curator-2.12.0-source-release.zip.asc -- svn:executable = * Added: dev/curator/2.12.0/apache-curator-2.12.0-source-release.zip.md5 == --- dev/curator/2.12.0/apache-curator-2.12.0-source-release.zip.md5 (added) +++ dev/curator/2.12.0/apache-curator-2.12.0-source-release.zip.md5 Wed Mar 1 04:24:49 2017 @@ -0,0 +1 @@ +5966d2f710abf67f28a2770faf45ec37 \ No newline at end of file Propchange: dev/curator/2.12.0/apache-curator-2.12.0-source-release.zip.md5 -- svn:executable = * Added: dev/curator/2.12.0/apache-curator-2.12.0-source-release.zip.sha1 == --- dev/curator/2.12.0/apache-curator-2.12.0-source-release.zip.sha1 (added) +++ dev/curator/2.12.0/apache-curator-2.12.0-source-release.zip.sha1 Wed Mar 1 04:24:49 2017 @@ -0,0 +1 @@ +58f263e006c1b076fbca746734ff46d968c8ee3c \ No newline at end of file Propchange: dev/curator/2.12.0/apache-curator-2.12.0-source-release.zip.sha1 -- svn:executable = *
[curator] Git Push Summary
Repository: curator Updated Tags: refs/tags/apache-curator-2.12.0 [created] 17caa5923
[2/2] curator git commit: Merge branch 'master' into CURATOR-3.0
Merge branch 'master' into CURATOR-3.0 Project: http://git-wip-us.apache.org/repos/asf/curator/repo Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/adcaf340 Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/adcaf340 Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/adcaf340 Branch: refs/heads/CURATOR-3.0 Commit: adcaf340f32755f063d50eef6baf7b0740eb7e40 Parents: e6ed999 82a8906 Author: Cam McKenzieAuthored: Wed Dec 7 13:49:15 2016 +1100 Committer: Cam McKenzie Committed: Wed Dec 7 13:49:15 2016 +1100 -- .../org/apache/curator/framework/imps/NamespaceImpl.java | 2 +- .../curator/framework/imps/TestNamespaceFacade.java | 10 ++ 2 files changed, 11 insertions(+), 1 deletion(-) --
[1/2] curator git commit: [CURATOR-361] Prevent removal of leading slash from path when empty namespace used
Repository: curator Updated Branches: refs/heads/CURATOR-3.0 e6ed99965 -> adcaf340f [CURATOR-361] Prevent removal of leading slash from path when empty namespace used Project: http://git-wip-us.apache.org/repos/asf/curator/repo Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/82a8906d Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/82a8906d Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/82a8906d Branch: refs/heads/CURATOR-3.0 Commit: 82a8906ddb185e4d405056aeed8abc807f440440 Parents: 0a0a1e7 Author: Charles RuhlandAuthored: Tue Dec 6 17:53:12 2016 -0800 Committer: Charles Ruhland Committed: Tue Dec 6 17:53:12 2016 -0800 -- .../org/apache/curator/framework/imps/NamespaceImpl.java | 2 +- .../curator/framework/imps/TestNamespaceFacade.java | 10 ++ 2 files changed, 11 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/curator/blob/82a8906d/curator-framework/src/main/java/org/apache/curator/framework/imps/NamespaceImpl.java -- diff --git a/curator-framework/src/main/java/org/apache/curator/framework/imps/NamespaceImpl.java b/curator-framework/src/main/java/org/apache/curator/framework/imps/NamespaceImpl.java index 29adbc6..c8dfce7 100644 --- a/curator-framework/src/main/java/org/apache/curator/framework/imps/NamespaceImpl.java +++ b/curator-framework/src/main/java/org/apache/curator/framework/imps/NamespaceImpl.java @@ -64,7 +64,7 @@ class NamespaceImpl if ( (namespace != null) && (path != null) ) { String namespacePath = ZKPaths.makePath(namespace, null); -if ( path.startsWith(namespacePath) ) +if ( !namespacePath.equals("/") && path.startsWith(namespacePath) ) { path = (path.length() > namespacePath.length()) ? path.substring(namespacePath.length()) : "/"; } http://git-wip-us.apache.org/repos/asf/curator/blob/82a8906d/curator-framework/src/test/java/org/apache/curator/framework/imps/TestNamespaceFacade.java -- diff --git a/curator-framework/src/test/java/org/apache/curator/framework/imps/TestNamespaceFacade.java b/curator-framework/src/test/java/org/apache/curator/framework/imps/TestNamespaceFacade.java index d09dd18..9357d00 100644 --- a/curator-framework/src/test/java/org/apache/curator/framework/imps/TestNamespaceFacade.java +++ b/curator-framework/src/test/java/org/apache/curator/framework/imps/TestNamespaceFacade.java @@ -229,4 +229,14 @@ public class TestNamespaceFacade extends BaseClassForTests //Expected } } + +@Test +public void testUnfixForEmptyNamespace() { +CuratorFramework client = CuratorFrameworkFactory.builder().namespace("").retryPolicy(new RetryOneTime(1)).connectString("").build(); +CuratorFrameworkImpl clientImpl = (CuratorFrameworkImpl) client; + +Assert.assertEquals(clientImpl.unfixForNamespace("/foo/bar"), "/foo/bar"); + +CloseableUtils.closeQuietly(client); +} }
[2/2] curator git commit: Merge branch 'master' into CURATOR-3.0
Merge branch 'master' into CURATOR-3.0 Conflicts: curator-test/src/main/java/org/apache/curator/test/QuorumConfigBuilder.java Project: http://git-wip-us.apache.org/repos/asf/curator/repo Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/e6ed9996 Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/e6ed9996 Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/e6ed9996 Branch: refs/heads/CURATOR-3.0 Commit: e6ed99965b6df91607b2505a3784780e51fa8c53 Parents: 60d24c2 0a0a1e7 Author: Cam McKenzieAuthored: Mon Dec 5 13:05:07 2016 +1100 Committer: Cam McKenzie Committed: Mon Dec 5 13:05:07 2016 +1100 -- .../org/apache/curator/test/InstanceSpec.java | 34 +--- .../curator/test/QuorumConfigBuilder.java | 2 +- 2 files changed, 30 insertions(+), 6 deletions(-) -- http://git-wip-us.apache.org/repos/asf/curator/blob/e6ed9996/curator-test/src/main/java/org/apache/curator/test/InstanceSpec.java -- diff --cc curator-test/src/main/java/org/apache/curator/test/InstanceSpec.java index 0a71161,bc0272c..d04e09f --- a/curator-test/src/main/java/org/apache/curator/test/InstanceSpec.java +++ b/curator-test/src/main/java/org/apache/curator/test/InstanceSpec.java @@@ -72,11 -72,8 +72,12 @@@ public class InstanceSpe private final int tickTime; private final int maxClientCnxns; private final Map customProperties; + private final String hostname; +public static void reset() { +nextServerId.set(1); +} + public static InstanceSpec newInstanceSpec() { return new InstanceSpec(null, -1, -1, -1, true, -1, -1, -1); http://git-wip-us.apache.org/repos/asf/curator/blob/e6ed9996/curator-test/src/main/java/org/apache/curator/test/QuorumConfigBuilder.java -- diff --cc curator-test/src/main/java/org/apache/curator/test/QuorumConfigBuilder.java index 5baf5ce,fb4039d..d385103 --- a/curator-test/src/main/java/org/apache/curator/test/QuorumConfigBuilder.java +++ b/curator-test/src/main/java/org/apache/curator/test/QuorumConfigBuilder.java @@@ -124,7 -100,7 +124,7 @@@ public class QuorumConfigBuilder implem { for ( InstanceSpec thisSpec : instanceSpecs ) { - properties.setProperty("server." + thisSpec.getServerId(), String.format("localhost:%d:%d;localhost:%d", thisSpec.getQuorumPort(), thisSpec.getElectionPort(), thisSpec.getPort())); -properties.setProperty("server." + thisSpec.getServerId(), String.format("%s:%d:%d", thisSpec.getHostname(), thisSpec.getQuorumPort(), thisSpec.getElectionPort())); ++properties.setProperty("server." + thisSpec.getServerId(), String.format("%s:%d:%d;%s:%d", thisSpec.getHostname(), thisSpec.getQuorumPort(), thisSpec.getElectionPort(), thisSpec.getHostname(), thisSpec.getPort())); } } Map customProperties = spec.getCustomProperties();
[1/2] curator git commit: CURATOR-360 - Allow Zookeeper servers in TestingCluster to listen on network interfaces other than localhost
Repository: curator Updated Branches: refs/heads/CURATOR-3.0 60d24c2c9 -> e6ed99965 CURATOR-360 - Allow Zookeeper servers in TestingCluster to listen on network interfaces other than localhost Project: http://git-wip-us.apache.org/repos/asf/curator/repo Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/0a0a1e7d Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/0a0a1e7d Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/0a0a1e7d Branch: refs/heads/CURATOR-3.0 Commit: 0a0a1e7d8beac27cd07dd0f445e55e9c6646e10c Parents: ee5d654 Author: ImeshaAuthored: Wed Nov 30 05:25:24 2016 +0530 Committer: Imesha Committed: Wed Nov 30 05:25:24 2016 +0530 -- .../org/apache/curator/test/InstanceSpec.java | 34 +--- .../curator/test/QuorumConfigBuilder.java | 2 +- 2 files changed, 30 insertions(+), 6 deletions(-) -- http://git-wip-us.apache.org/repos/asf/curator/blob/0a0a1e7d/curator-test/src/main/java/org/apache/curator/test/InstanceSpec.java -- diff --git a/curator-test/src/main/java/org/apache/curator/test/InstanceSpec.java b/curator-test/src/main/java/org/apache/curator/test/InstanceSpec.java index 32b1738..bc0272c 100644 --- a/curator-test/src/main/java/org/apache/curator/test/InstanceSpec.java +++ b/curator-test/src/main/java/org/apache/curator/test/InstanceSpec.java @@ -72,6 +72,7 @@ public class InstanceSpec private final int tickTime; private final int maxClientCnxns; private final Map customProperties; +private final String hostname; public static InstanceSpec newInstanceSpec() { @@ -116,7 +117,7 @@ public class InstanceSpec */ public InstanceSpec(File dataDirectory, int port, int electionPort, int quorumPort, boolean deleteDataDirectoryOnClose, int serverId) { -this(dataDirectory, port, electionPort, quorumPort, deleteDataDirectoryOnClose, serverId, -1, -1, null); +this(dataDirectory, port, electionPort, quorumPort, deleteDataDirectoryOnClose, serverId, -1, -1, null, null); } /** @@ -130,7 +131,7 @@ public class InstanceSpec * @param maxClientCnxns max number of client connections from the same IP. Set -1 to use default server configuration */ public InstanceSpec(File dataDirectory, int port, int electionPort, int quorumPort, boolean deleteDataDirectoryOnClose, int serverId, int tickTime, int maxClientCnxns) { -this(dataDirectory, port, electionPort, quorumPort, deleteDataDirectoryOnClose, serverId, tickTime, maxClientCnxns, null); +this(dataDirectory, port, electionPort, quorumPort, deleteDataDirectoryOnClose, serverId, tickTime, maxClientCnxns, null, null); } /** @@ -146,6 +147,23 @@ public class InstanceSpec */ public InstanceSpec(File dataDirectory, int port, int electionPort, int quorumPort, boolean deleteDataDirectoryOnClose, int serverId, int tickTime, int maxClientCnxns, Map customProperties) { +this(dataDirectory, port, electionPort, quorumPort, deleteDataDirectoryOnClose, serverId, tickTime, maxClientCnxns, customProperties, null); +} + +/** + * @param dataDirectory where to store data/logs/etc. + * @param port the port to listen on - each server in the ensemble must use a unique port + * @param electionPort the electionPort to listen on - each server in the ensemble must use a unique electionPort + * @param quorumPort the quorumPort to listen on - each server in the ensemble must use a unique quorumPort + * @param deleteDataDirectoryOnClose if true, the data directory will be deleted when {@link TestingCluster#close()} is called + * @param serverId the server ID for the instance + * @param tickTime tickTime. Set -1 to used fault server configuration + * @param maxClientCnxns max number of client connections from the same IP. Set -1 to use default server configuration + * @param customProperties other properties to be passed to the server + * @param hostname Hostname or IP if the cluster is intending to be bounded into external interfaces + */ +public InstanceSpec(File dataDirectory, int port, int electionPort, int quorumPort, boolean deleteDataDirectoryOnClose, int serverId, int tickTime, int maxClientCnxns, Map customProperties,String hostname) +{ this.dataDirectory = (dataDirectory != null) ? dataDirectory : Files.createTempDir(); this.port = (port >= 0) ? port : getRandomPort(); this.electionPort = (electionPort >= 0) ? electionPort
curator git commit: CURATOR-360 - Allow Zookeeper servers in TestingCluster to listen on network interfaces other than localhost
Repository: curator Updated Branches: refs/heads/master ee5d65463 -> 0a0a1e7d8 CURATOR-360 - Allow Zookeeper servers in TestingCluster to listen on network interfaces other than localhost Project: http://git-wip-us.apache.org/repos/asf/curator/repo Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/0a0a1e7d Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/0a0a1e7d Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/0a0a1e7d Branch: refs/heads/master Commit: 0a0a1e7d8beac27cd07dd0f445e55e9c6646e10c Parents: ee5d654 Author: ImeshaAuthored: Wed Nov 30 05:25:24 2016 +0530 Committer: Imesha Committed: Wed Nov 30 05:25:24 2016 +0530 -- .../org/apache/curator/test/InstanceSpec.java | 34 +--- .../curator/test/QuorumConfigBuilder.java | 2 +- 2 files changed, 30 insertions(+), 6 deletions(-) -- http://git-wip-us.apache.org/repos/asf/curator/blob/0a0a1e7d/curator-test/src/main/java/org/apache/curator/test/InstanceSpec.java -- diff --git a/curator-test/src/main/java/org/apache/curator/test/InstanceSpec.java b/curator-test/src/main/java/org/apache/curator/test/InstanceSpec.java index 32b1738..bc0272c 100644 --- a/curator-test/src/main/java/org/apache/curator/test/InstanceSpec.java +++ b/curator-test/src/main/java/org/apache/curator/test/InstanceSpec.java @@ -72,6 +72,7 @@ public class InstanceSpec private final int tickTime; private final int maxClientCnxns; private final Map customProperties; +private final String hostname; public static InstanceSpec newInstanceSpec() { @@ -116,7 +117,7 @@ public class InstanceSpec */ public InstanceSpec(File dataDirectory, int port, int electionPort, int quorumPort, boolean deleteDataDirectoryOnClose, int serverId) { -this(dataDirectory, port, electionPort, quorumPort, deleteDataDirectoryOnClose, serverId, -1, -1, null); +this(dataDirectory, port, electionPort, quorumPort, deleteDataDirectoryOnClose, serverId, -1, -1, null, null); } /** @@ -130,7 +131,7 @@ public class InstanceSpec * @param maxClientCnxns max number of client connections from the same IP. Set -1 to use default server configuration */ public InstanceSpec(File dataDirectory, int port, int electionPort, int quorumPort, boolean deleteDataDirectoryOnClose, int serverId, int tickTime, int maxClientCnxns) { -this(dataDirectory, port, electionPort, quorumPort, deleteDataDirectoryOnClose, serverId, tickTime, maxClientCnxns, null); +this(dataDirectory, port, electionPort, quorumPort, deleteDataDirectoryOnClose, serverId, tickTime, maxClientCnxns, null, null); } /** @@ -146,6 +147,23 @@ public class InstanceSpec */ public InstanceSpec(File dataDirectory, int port, int electionPort, int quorumPort, boolean deleteDataDirectoryOnClose, int serverId, int tickTime, int maxClientCnxns, Map customProperties) { +this(dataDirectory, port, electionPort, quorumPort, deleteDataDirectoryOnClose, serverId, tickTime, maxClientCnxns, customProperties, null); +} + +/** + * @param dataDirectory where to store data/logs/etc. + * @param port the port to listen on - each server in the ensemble must use a unique port + * @param electionPort the electionPort to listen on - each server in the ensemble must use a unique electionPort + * @param quorumPort the quorumPort to listen on - each server in the ensemble must use a unique quorumPort + * @param deleteDataDirectoryOnClose if true, the data directory will be deleted when {@link TestingCluster#close()} is called + * @param serverId the server ID for the instance + * @param tickTime tickTime. Set -1 to used fault server configuration + * @param maxClientCnxns max number of client connections from the same IP. Set -1 to use default server configuration + * @param customProperties other properties to be passed to the server + * @param hostname Hostname or IP if the cluster is intending to be bounded into external interfaces + */ +public InstanceSpec(File dataDirectory, int port, int electionPort, int quorumPort, boolean deleteDataDirectoryOnClose, int serverId, int tickTime, int maxClientCnxns, Map customProperties,String hostname) +{ this.dataDirectory = (dataDirectory != null) ? dataDirectory : Files.createTempDir(); this.port = (port >= 0) ? port : getRandomPort(); this.electionPort = (electionPort >= 0) ? electionPort :
[1/2] curator git commit: CURATOR-358 - Fixed race condition with getLeader() -If leadership changes between the getParticipantNodes() call and the getLeader() internal call the NoNodeException is now
Repository: curator Updated Branches: refs/heads/master e9bfb4353 -> ee5d65463 CURATOR-358 - Fixed race condition with getLeader() -If leadership changes between the getParticipantNodes() call and the getLeader() internal call the NoNodeException is now handled and the next child in the list is evaluated. Project: http://git-wip-us.apache.org/repos/asf/curator/repo Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/3478aca7 Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/3478aca7 Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/3478aca7 Branch: refs/heads/master Commit: 3478aca7ed6852484b5574a6082f4bb75c04a1e0 Parents: e9bfb43 Author: Cam McKenzieAuthored: Mon Nov 21 10:38:15 2016 +1100 Committer: Cam McKenzie Committed: Mon Nov 21 10:38:15 2016 +1100 -- .../recipes/leader/LeaderSelector.java | 35 ++-- 1 file changed, 33 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/curator/blob/3478aca7/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 c177302..4b4a0b4 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 @@ -34,6 +34,7 @@ import org.slf4j.LoggerFactory; import java.io.Closeable; import java.io.UnsupportedEncodingException; import java.util.Collection; +import java.util.Iterator; import java.util.List; import java.util.concurrent.AbstractExecutorService; import java.util.concurrent.Callable; @@ -341,11 +342,41 @@ public class LeaderSelector implements Closeable static Participant getLeader(CuratorFramework client, Collection participantNodes) throws Exception { +Participant result = null; + if ( participantNodes.size() > 0 ) { -return participantForPath(client, participantNodes.iterator().next(), true); +Iterator iter = participantNodes.iterator(); +while ( iter.hasNext() ) +{ + +try +{ +result = participantForPath(client, iter.next(), true); +} +catch( KeeperException.NoNodeException e ) +{ +//See CURATOR-358 +//There's a race condition between querying the list of +//leader nodes and then determining the content of the +//actual leader node. If the query fails due to the +//node not existing, then just move to the next +//participant node and try again +} + +if ( result != null ) +{ +break; +} +} +} + +if( result == null ) +{ +result = new Participant(); } -return new Participant(); + +return result; } /**
curator git commit: CURATOR-358 - Move NoNode exception handling inside participantsForPath
Repository: curator Updated Branches: refs/heads/CURATOR-358 3478aca7e -> ee5d65463 CURATOR-358 - Move NoNode exception handling inside participantsForPath Project: http://git-wip-us.apache.org/repos/asf/curator/repo Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/ee5d6546 Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/ee5d6546 Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/ee5d6546 Branch: refs/heads/CURATOR-358 Commit: ee5d65463b73abb2a2b732fb02729239b183519d Parents: 3478aca Author: Cam McKenzieAuthored: Mon Nov 21 16:06:17 2016 +1100 Committer: Cam McKenzie Committed: Mon Nov 21 16:06:17 2016 +1100 -- .../recipes/leader/LeaderSelector.java | 41 1 file changed, 16 insertions(+), 25 deletions(-) -- http://git-wip-us.apache.org/repos/asf/curator/blob/ee5d6546/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 4b4a0b4..6ad1053 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 @@ -303,17 +303,14 @@ public class LeaderSelector implements Closeable boolean isLeader = true; for ( String path : participantNodes ) { -try +Participant participant = participantForPath(client, path, isLeader); + +if( participant != null ) { -Participant participant = participantForPath(client, path, isLeader); builder.add(participant); -} -catch ( KeeperException.NoNodeException ignore ) -{ -// ignore -} -isLeader = false; // by definition the first node is the leader +isLeader = false; // by definition the first node is the leader +} } return builder.build(); @@ -349,20 +346,7 @@ public class LeaderSelector implements Closeable Iterator iter = participantNodes.iterator(); while ( iter.hasNext() ) { - -try -{ -result = participantForPath(client, iter.next(), true); -} -catch( KeeperException.NoNodeException e ) -{ -//See CURATOR-358 -//There's a race condition between querying the list of -//leader nodes and then determining the content of the -//actual leader node. If the query fails due to the -//node not existing, then just move to the next -//participant node and try again -} +result = participantForPath(client, iter.next(), true); if ( result != null ) { @@ -403,9 +387,16 @@ public class LeaderSelector implements Closeable private static Participant participantForPath(CuratorFramework client, String path, boolean markAsLeader) throws Exception { -byte[] bytes = client.getData().forPath(path); -String thisId = new String(bytes, "UTF-8"); -return new Participant(thisId, markAsLeader); +try +{ +byte[] bytes = client.getData().forPath(path); +String thisId = new String(bytes, "UTF-8"); +return new Participant(thisId, markAsLeader); +} +catch ( KeeperException.NoNodeException e ) +{ +return null; +} } @VisibleForTesting
curator git commit: CURATOR-358 - Fixed race condition with getLeader() -If leadership changes between the getParticipantNodes() call and the getLeader() internal call the NoNodeException is now handl
Repository: curator Updated Branches: refs/heads/CURATOR-358 [created] 3478aca7e CURATOR-358 - Fixed race condition with getLeader() -If leadership changes between the getParticipantNodes() call and the getLeader() internal call the NoNodeException is now handled and the next child in the list is evaluated. Project: http://git-wip-us.apache.org/repos/asf/curator/repo Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/3478aca7 Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/3478aca7 Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/3478aca7 Branch: refs/heads/CURATOR-358 Commit: 3478aca7ed6852484b5574a6082f4bb75c04a1e0 Parents: e9bfb43 Author: Cam McKenzieAuthored: Mon Nov 21 10:38:15 2016 +1100 Committer: Cam McKenzie Committed: Mon Nov 21 10:38:15 2016 +1100 -- .../recipes/leader/LeaderSelector.java | 35 ++-- 1 file changed, 33 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/curator/blob/3478aca7/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 c177302..4b4a0b4 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 @@ -34,6 +34,7 @@ import org.slf4j.LoggerFactory; import java.io.Closeable; import java.io.UnsupportedEncodingException; import java.util.Collection; +import java.util.Iterator; import java.util.List; import java.util.concurrent.AbstractExecutorService; import java.util.concurrent.Callable; @@ -341,11 +342,41 @@ public class LeaderSelector implements Closeable static Participant getLeader(CuratorFramework client, Collection participantNodes) throws Exception { +Participant result = null; + if ( participantNodes.size() > 0 ) { -return participantForPath(client, participantNodes.iterator().next(), true); +Iterator iter = participantNodes.iterator(); +while ( iter.hasNext() ) +{ + +try +{ +result = participantForPath(client, iter.next(), true); +} +catch( KeeperException.NoNodeException e ) +{ +//See CURATOR-358 +//There's a race condition between querying the list of +//leader nodes and then determining the content of the +//actual leader node. If the query fails due to the +//node not existing, then just move to the next +//participant node and try again +} + +if ( result != null ) +{ +break; +} +} +} + +if( result == null ) +{ +result = new Participant(); } -return new Participant(); + +return result; } /**
[3/4] curator git commit: CURATOR-356 Allow SASL configuration for TestingServer
CURATOR-356 Allow SASL configuration for TestingServer Project: http://git-wip-us.apache.org/repos/asf/curator/repo Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/dd20f1db Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/dd20f1db Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/dd20f1db Branch: refs/heads/CURATOR-3.0 Commit: dd20f1dbed3879372483d7e8f7eb05d920707168 Parents: b51bb01 Author: eolivelliAuthored: Wed Oct 26 13:43:21 2016 +0200 Committer: eolivelli Committed: Wed Oct 26 13:43:21 2016 +0200 -- .../org/apache/curator/test/InstanceSpec.java | 28 ++- .../curator/test/QuorumConfigBuilder.java | 7 +++ .../curator/test/TestQuorumConfigBuilder.java | 49 3 files changed, 82 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/curator/blob/dd20f1db/curator-test/src/main/java/org/apache/curator/test/InstanceSpec.java -- diff --git a/curator-test/src/main/java/org/apache/curator/test/InstanceSpec.java b/curator-test/src/main/java/org/apache/curator/test/InstanceSpec.java index b39a949..32b1738 100644 --- a/curator-test/src/main/java/org/apache/curator/test/InstanceSpec.java +++ b/curator-test/src/main/java/org/apache/curator/test/InstanceSpec.java @@ -25,6 +25,8 @@ import java.io.IOException; import java.net.InetAddress; import java.net.ServerSocket; import java.net.UnknownHostException; +import java.util.Collections; +import java.util.Map; import java.util.concurrent.atomic.AtomicInteger; /** @@ -69,6 +71,7 @@ public class InstanceSpec private final int serverId; private final int tickTime; private final int maxClientCnxns; +private final Map customProperties; public static InstanceSpec newInstanceSpec() { @@ -113,7 +116,7 @@ public class InstanceSpec */ public InstanceSpec(File dataDirectory, int port, int electionPort, int quorumPort, boolean deleteDataDirectoryOnClose, int serverId) { -this(dataDirectory, port, electionPort, quorumPort, deleteDataDirectoryOnClose, serverId, -1, -1); +this(dataDirectory, port, electionPort, quorumPort, deleteDataDirectoryOnClose, serverId, -1, -1, null); } /** @@ -126,7 +129,22 @@ public class InstanceSpec * @param tickTime tickTime. Set -1 to used fault server configuration * @param maxClientCnxns max number of client connections from the same IP. Set -1 to use default server configuration */ -public InstanceSpec(File dataDirectory, int port, int electionPort, int quorumPort, boolean deleteDataDirectoryOnClose, int serverId, int tickTime, int maxClientCnxns) +public InstanceSpec(File dataDirectory, int port, int electionPort, int quorumPort, boolean deleteDataDirectoryOnClose, int serverId, int tickTime, int maxClientCnxns) { +this(dataDirectory, port, electionPort, quorumPort, deleteDataDirectoryOnClose, serverId, tickTime, maxClientCnxns, null); +} + +/** + * @param dataDirectory where to store data/logs/etc. + * @param port the port to listen on - each server in the ensemble must use a unique port + * @param electionPort the electionPort to listen on - each server in the ensemble must use a unique electionPort + * @param quorumPort the quorumPort to listen on - each server in the ensemble must use a unique quorumPort + * @param deleteDataDirectoryOnClose if true, the data directory will be deleted when {@link TestingCluster#close()} is called + * @param serverId the server ID for the instance + * @param tickTime tickTime. Set -1 to used fault server configuration + * @param maxClientCnxns max number of client connections from the same IP. Set -1 to use default server configuration + * @param customProperties other properties to be passed to the server + */ +public InstanceSpec(File dataDirectory, int port, int electionPort, int quorumPort, boolean deleteDataDirectoryOnClose, int serverId, int tickTime, int maxClientCnxns, Map customProperties) { this.dataDirectory = (dataDirectory != null) ? dataDirectory : Files.createTempDir(); this.port = (port >= 0) ? port : getRandomPort(); @@ -136,6 +154,7 @@ public class InstanceSpec this.serverId = (serverId >= 0) ? serverId : nextServerId.getAndIncrement(); this.tickTime = (tickTime > 0 ? tickTime : -1); // -1 to set default value this.maxClientCnxns = (maxClientCnxns >= 0 ? maxClientCnxns : -1); // -1 to set default value +this.customProperties =
[4/4] curator git commit: Merge branch 'master' into CURATOR-3.0
Merge branch 'master' into CURATOR-3.0 Conflicts: curator-client/src/main/java/org/apache/curator/ConnectionState.java curator-client/src/main/java/org/apache/curator/CuratorZookeeperClient.java curator-client/src/main/java/org/apache/curator/RetryLoop.java curator-framework/src/main/java/org/apache/curator/framework/imps/BackgroundSyncImpl.java curator-framework/src/main/java/org/apache/curator/framework/imps/CreateBuilderImpl.java curator-framework/src/main/java/org/apache/curator/framework/imps/ExistsBuilderImpl.java curator-framework/src/main/java/org/apache/curator/framework/imps/GetACLBuilderImpl.java curator-framework/src/main/java/org/apache/curator/framework/imps/GetChildrenBuilderImpl.java curator-framework/src/main/java/org/apache/curator/framework/imps/GetDataBuilderImpl.java curator-framework/src/main/java/org/apache/curator/framework/imps/SetACLBuilderImpl.java curator-framework/src/main/java/org/apache/curator/framework/imps/SetDataBuilderImpl.java curator-framework/src/main/java/org/apache/curator/framework/imps/SyncBuilderImpl.java Project: http://git-wip-us.apache.org/repos/asf/curator/repo Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/d8798c21 Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/d8798c21 Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/d8798c21 Branch: refs/heads/CURATOR-3.0 Commit: d8798c21de10926cecd2ffc11f1ed7ce695c330a Parents: d034aea dd20f1d Author: Cam McKenzieAuthored: Thu Oct 27 09:51:02 2016 +1100 Committer: Cam McKenzie Committed: Thu Oct 27 09:51:02 2016 +1100 -- .../org/apache/curator/test/InstanceSpec.java | 28 ++- .../curator/test/QuorumConfigBuilder.java | 7 +++ .../curator/test/TestQuorumConfigBuilder.java | 49 3 files changed, 82 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/curator/blob/d8798c21/curator-test/src/main/java/org/apache/curator/test/InstanceSpec.java -- diff --cc curator-test/src/main/java/org/apache/curator/test/InstanceSpec.java index 6d495df,32b1738..0a71161 --- a/curator-test/src/main/java/org/apache/curator/test/InstanceSpec.java +++ b/curator-test/src/main/java/org/apache/curator/test/InstanceSpec.java @@@ -69,11 -71,8 +71,12 @@@ public class InstanceSpe private final int serverId; private final int tickTime; private final int maxClientCnxns; + private final Map customProperties; +public static void reset() { +nextServerId.set(1); +} + public static InstanceSpec newInstanceSpec() { return new InstanceSpec(null, -1, -1, -1, true, -1, -1, -1); http://git-wip-us.apache.org/repos/asf/curator/blob/d8798c21/curator-test/src/main/java/org/apache/curator/test/QuorumConfigBuilder.java -- diff --cc curator-test/src/main/java/org/apache/curator/test/QuorumConfigBuilder.java index 17bb185,4e20163..5baf5ce --- a/curator-test/src/main/java/org/apache/curator/test/QuorumConfigBuilder.java +++ b/curator-test/src/main/java/org/apache/curator/test/QuorumConfigBuilder.java @@@ -23,11 -22,10 +23,12 @@@ import com.google.common.base.Throwable import com.google.common.collect.ImmutableList; import com.google.common.io.Files; import org.apache.zookeeper.server.quorum.QuorumPeerConfig; +import java.io.Closeable; import java.io.File; +import java.io.IOException; import java.util.Collection; import java.util.List; + import java.util.Map; import java.util.Properties; @SuppressWarnings("UnusedDeclaration") @@@ -123,19 -100,17 +124,25 @@@ public class QuorumConfigBuilder implem { for ( InstanceSpec thisSpec : instanceSpecs ) { -properties.setProperty("server." + thisSpec.getServerId(), String.format("localhost:%d:%d", thisSpec.getQuorumPort(), thisSpec.getElectionPort())); +properties.setProperty("server." + thisSpec.getServerId(), String.format("localhost:%d:%d;localhost:%d", thisSpec.getQuorumPort(), thisSpec.getElectionPort(), thisSpec.getPort())); } } + Map customProperties = spec.getCustomProperties(); + if (customProperties != null) { + for (Map.Entry property : customProperties.entrySet()) { + properties.put(property.getKey(), property.getValue()); + } + } -QuorumPeerConfig config = new QuorumPeerConfig(); +QuorumPeerConfig config = new QuorumPeerConfig() +{ +{ +if (
[1/4] curator git commit: [CURATOR-349] Expose extra metrics in TracerDriver
Repository: curator Updated Branches: refs/heads/CURATOR-3.0 d034aeaed -> d8798c21d [CURATOR-349] Expose extra metrics in TracerDriver Project: http://git-wip-us.apache.org/repos/asf/curator/repo Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/2f6e2177 Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/2f6e2177 Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/2f6e2177 Branch: refs/heads/CURATOR-3.0 Commit: 2f6e2177e98d0f418b47a664a48c87abf5a72595 Parents: 022de39 Author: allenlyuAuthored: Tue Sep 20 14:56:47 2016 -0700 Committer: lvfangmin Committed: Wed Oct 19 17:38:29 2016 -0700 -- .../org/apache/curator/ConnectionState.java | 37 - .../apache/curator/CuratorZookeeperClient.java | 15 +- .../main/java/org/apache/curator/RetryLoop.java | 7 +- .../curator/drivers/AdvancedTracerDriver.java | 50 ++ .../org/apache/curator/drivers/EventTrace.java | 53 ++ .../apache/curator/drivers/OperationTrace.java | 162 +++ .../framework/imps/BackgroundSyncImpl.java | 11 +- .../framework/imps/CreateBuilderImpl.java | 17 +- .../framework/imps/CuratorFrameworkImpl.java| 4 +- .../framework/imps/DeleteBuilderImpl.java | 10 +- .../framework/imps/ExistsBuilderImpl.java | 14 +- .../FindAndDeleteProtectedNodeInBackground.java | 6 +- .../framework/imps/GetACLBuilderImpl.java | 10 +- .../framework/imps/GetChildrenBuilderImpl.java | 10 +- .../framework/imps/GetDataBuilderImpl.java | 10 +- .../framework/imps/SetACLBuilderImpl.java | 10 +- .../framework/imps/SetDataBuilderImpl.java | 13 +- .../curator/framework/imps/SyncBuilderImpl.java | 6 +- .../framework/imps/TempGetDataBuilderImpl.java | 6 +- src/site/confluence/logging.confluence | 2 +- 20 files changed, 380 insertions(+), 73 deletions(-) -- http://git-wip-us.apache.org/repos/asf/curator/blob/2f6e2177/curator-client/src/main/java/org/apache/curator/ConnectionState.java -- diff --git a/curator-client/src/main/java/org/apache/curator/ConnectionState.java b/curator-client/src/main/java/org/apache/curator/ConnectionState.java index dc6ac53..9712899 100644 --- a/curator-client/src/main/java/org/apache/curator/ConnectionState.java +++ b/curator-client/src/main/java/org/apache/curator/ConnectionState.java @@ -19,6 +19,8 @@ package org.apache.curator; import org.apache.curator.utils.CloseableUtils; +import org.apache.curator.drivers.EventTrace; +import org.apache.curator.drivers.OperationTrace; import org.apache.curator.drivers.TracerDriver; import org.apache.curator.ensemble.EnsembleProvider; import org.apache.curator.utils.DebugUtils; @@ -78,7 +80,7 @@ class ConnectionState implements Watcher, Closeable Exception exception = backgroundExceptions.poll(); if ( exception != null ) { -tracer.get().addCount("background-exceptions", 1); +new EventTrace("background-exceptions", tracer.get()).commit(); throw exception; } @@ -160,9 +162,10 @@ class ConnectionState implements Watcher, Closeable for ( Watcher parentWatcher : parentWatchers ) { -TimeTrace timeTrace = new TimeTrace("connection-state-parent-process", tracer.get()); + +OperationTrace trace = new OperationTrace("connection-state-parent-process", tracer.get()); parentWatcher.process(event); -timeTrace.commit(); +trace.commit(); } } @@ -199,13 +202,31 @@ class ConnectionState implements Watcher, Closeable { log.error(String.format("Connection timed out for connection string (%s) and timeout (%d) / elapsed (%d)", zooKeeper.getConnectionString(), connectionTimeoutMs, elapsed), connectionLossException); } -tracer.get().addCount("connections-timed-out", 1); +new EventTrace("connections-timed-out", tracer.get(), getSessionId()).commit(); throw connectionLossException; } } } } +/** + * Return the current session id + */ +public long getSessionId() { +long sessionId = -1; +if (isConnected()) { +try { +ZooKeeper zk = zooKeeper.getZooKeeper(); +if (zk != null) { +sessionId = zk.getSessionId(); +} +} catch (Exception e) { +// Ignore the exception +} +} +return sessionId; +} + private synchronized void reset() throws Exception { log.debug("reset"); @@ -259,6 +280,10 @@ class
[2/4] curator git commit: Merge branch 'CURATOR-349' of github.com:lvfangmin/curator into CURATOR-349
Merge branch 'CURATOR-349' of github.com:lvfangmin/curator into CURATOR-349 Project: http://git-wip-us.apache.org/repos/asf/curator/repo Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/b51bb011 Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/b51bb011 Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/b51bb011 Branch: refs/heads/CURATOR-3.0 Commit: b51bb01176940896cad5408a453c524fcfe0fc49 Parents: 8c1b4be 2f6e217 Author: randgaltAuthored: Tue Oct 25 10:14:04 2016 -0500 Committer: randgalt Committed: Tue Oct 25 10:14:04 2016 -0500 -- .../org/apache/curator/ConnectionState.java | 37 - .../apache/curator/CuratorZookeeperClient.java | 15 +- .../main/java/org/apache/curator/RetryLoop.java | 7 +- .../curator/drivers/AdvancedTracerDriver.java | 50 ++ .../org/apache/curator/drivers/EventTrace.java | 53 ++ .../apache/curator/drivers/OperationTrace.java | 162 +++ .../framework/imps/BackgroundSyncImpl.java | 11 +- .../framework/imps/CreateBuilderImpl.java | 17 +- .../framework/imps/CuratorFrameworkImpl.java| 4 +- .../framework/imps/DeleteBuilderImpl.java | 10 +- .../framework/imps/ExistsBuilderImpl.java | 14 +- .../FindAndDeleteProtectedNodeInBackground.java | 6 +- .../framework/imps/GetACLBuilderImpl.java | 10 +- .../framework/imps/GetChildrenBuilderImpl.java | 10 +- .../framework/imps/GetDataBuilderImpl.java | 10 +- .../framework/imps/SetACLBuilderImpl.java | 10 +- .../framework/imps/SetDataBuilderImpl.java | 13 +- .../curator/framework/imps/SyncBuilderImpl.java | 6 +- .../framework/imps/TempGetDataBuilderImpl.java | 6 +- src/site/confluence/logging.confluence | 2 +- 20 files changed, 380 insertions(+), 73 deletions(-) --
curator git commit: CURATOR-356 Allow SASL configuration for TestingServer
Repository: curator Updated Branches: refs/heads/master b51bb0117 -> dd20f1dbe CURATOR-356 Allow SASL configuration for TestingServer Project: http://git-wip-us.apache.org/repos/asf/curator/repo Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/dd20f1db Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/dd20f1db Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/dd20f1db Branch: refs/heads/master Commit: dd20f1dbed3879372483d7e8f7eb05d920707168 Parents: b51bb01 Author: eolivelliAuthored: Wed Oct 26 13:43:21 2016 +0200 Committer: eolivelli Committed: Wed Oct 26 13:43:21 2016 +0200 -- .../org/apache/curator/test/InstanceSpec.java | 28 ++- .../curator/test/QuorumConfigBuilder.java | 7 +++ .../curator/test/TestQuorumConfigBuilder.java | 49 3 files changed, 82 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/curator/blob/dd20f1db/curator-test/src/main/java/org/apache/curator/test/InstanceSpec.java -- diff --git a/curator-test/src/main/java/org/apache/curator/test/InstanceSpec.java b/curator-test/src/main/java/org/apache/curator/test/InstanceSpec.java index b39a949..32b1738 100644 --- a/curator-test/src/main/java/org/apache/curator/test/InstanceSpec.java +++ b/curator-test/src/main/java/org/apache/curator/test/InstanceSpec.java @@ -25,6 +25,8 @@ import java.io.IOException; import java.net.InetAddress; import java.net.ServerSocket; import java.net.UnknownHostException; +import java.util.Collections; +import java.util.Map; import java.util.concurrent.atomic.AtomicInteger; /** @@ -69,6 +71,7 @@ public class InstanceSpec private final int serverId; private final int tickTime; private final int maxClientCnxns; +private final Map customProperties; public static InstanceSpec newInstanceSpec() { @@ -113,7 +116,7 @@ public class InstanceSpec */ public InstanceSpec(File dataDirectory, int port, int electionPort, int quorumPort, boolean deleteDataDirectoryOnClose, int serverId) { -this(dataDirectory, port, electionPort, quorumPort, deleteDataDirectoryOnClose, serverId, -1, -1); +this(dataDirectory, port, electionPort, quorumPort, deleteDataDirectoryOnClose, serverId, -1, -1, null); } /** @@ -126,7 +129,22 @@ public class InstanceSpec * @param tickTime tickTime. Set -1 to used fault server configuration * @param maxClientCnxns max number of client connections from the same IP. Set -1 to use default server configuration */ -public InstanceSpec(File dataDirectory, int port, int electionPort, int quorumPort, boolean deleteDataDirectoryOnClose, int serverId, int tickTime, int maxClientCnxns) +public InstanceSpec(File dataDirectory, int port, int electionPort, int quorumPort, boolean deleteDataDirectoryOnClose, int serverId, int tickTime, int maxClientCnxns) { +this(dataDirectory, port, electionPort, quorumPort, deleteDataDirectoryOnClose, serverId, tickTime, maxClientCnxns, null); +} + +/** + * @param dataDirectory where to store data/logs/etc. + * @param port the port to listen on - each server in the ensemble must use a unique port + * @param electionPort the electionPort to listen on - each server in the ensemble must use a unique electionPort + * @param quorumPort the quorumPort to listen on - each server in the ensemble must use a unique quorumPort + * @param deleteDataDirectoryOnClose if true, the data directory will be deleted when {@link TestingCluster#close()} is called + * @param serverId the server ID for the instance + * @param tickTime tickTime. Set -1 to used fault server configuration + * @param maxClientCnxns max number of client connections from the same IP. Set -1 to use default server configuration + * @param customProperties other properties to be passed to the server + */ +public InstanceSpec(File dataDirectory, int port, int electionPort, int quorumPort, boolean deleteDataDirectoryOnClose, int serverId, int tickTime, int maxClientCnxns, Map customProperties) { this.dataDirectory = (dataDirectory != null) ? dataDirectory : Files.createTempDir(); this.port = (port >= 0) ? port : getRandomPort(); @@ -136,6 +154,7 @@ public class InstanceSpec this.serverId = (serverId >= 0) ? serverId : nextServerId.getAndIncrement(); this.tickTime = (tickTime > 0 ? tickTime : -1); // -1 to set default value this.maxClientCnxns = (maxClientCnxns >= 0 ?
[1/2] curator git commit: CURATOR-354: explicitly close GZIP input/output streams in GzipCompressionProvider
Repository: curator Updated Branches: refs/heads/CURATOR-3.0 3735b50ba -> 693211e41 CURATOR-354: explicitly close GZIP input/output streams in GzipCompressionProvider Project: http://git-wip-us.apache.org/repos/asf/curator/repo Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/8c1b4be5 Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/8c1b4be5 Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/8c1b4be5 Branch: refs/heads/CURATOR-3.0 Commit: 8c1b4be57ffaf58ce8708e0e9d3611e4e5955f2e Parents: 022de39 Author: Evan PollanAuthored: Thu Oct 6 15:53:04 2016 -0500 Committer: Evan Pollan Committed: Thu Oct 6 15:53:04 2016 -0500 -- .../framework/imps/GzipCompressionProvider.java | 26 +--- 1 file changed, 17 insertions(+), 9 deletions(-) -- http://git-wip-us.apache.org/repos/asf/curator/blob/8c1b4be5/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 10799bc..7b35c37 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 @@ -31,8 +31,12 @@ public class GzipCompressionProvider implements CompressionProvider { ByteArrayOutputStream bytes = new ByteArrayOutputStream(); GZIPOutputStreamout = new GZIPOutputStream(bytes); -out.write(data); -out.finish(); +try { +out.write(data); +out.finish(); +} finally { +out.close(); +} return bytes.toByteArray(); } @@ -41,15 +45,19 @@ public class GzipCompressionProvider implements CompressionProvider { ByteArrayOutputStream bytes = new ByteArrayOutputStream(compressedData.length); GZIPInputStream in = new GZIPInputStream(new ByteArrayInputStream(compressedData)); -byte[] buffer = new byte[compressedData.length]; -for(;;) -{ -int bytesRead = in.read(buffer, 0, buffer.length); -if ( bytesRead < 0 ) +try { +byte[] buffer = new byte[compressedData.length]; +for(;;) { -break; +int bytesRead = in.read(buffer, 0, buffer.length); +if ( bytesRead < 0 ) +{ +break; +} +bytes.write(buffer, 0, bytesRead); } -bytes.write(buffer, 0, bytesRead); +} finally { +in.close(); } return bytes.toByteArray(); }
[2/2] curator git commit: Merge branch 'master' into CURATOR-3.0
Merge branch 'master' into CURATOR-3.0 Project: http://git-wip-us.apache.org/repos/asf/curator/repo Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/693211e4 Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/693211e4 Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/693211e4 Branch: refs/heads/CURATOR-3.0 Commit: 693211e4141cef1e7f122edf677a60c6c7c5aeec Parents: 3735b50 8c1b4be Author: Cam McKenzieAuthored: Thu Oct 13 13:25:01 2016 +1100 Committer: Cam McKenzie Committed: Thu Oct 13 13:25:01 2016 +1100 -- .../framework/imps/GzipCompressionProvider.java | 26 +--- 1 file changed, 17 insertions(+), 9 deletions(-) --
curator git commit: CURATOR-354: explicitly close GZIP input/output streams in GzipCompressionProvider
Repository: curator Updated Branches: refs/heads/master 022de3921 -> 8c1b4be57 CURATOR-354: explicitly close GZIP input/output streams in GzipCompressionProvider Project: http://git-wip-us.apache.org/repos/asf/curator/repo Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/8c1b4be5 Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/8c1b4be5 Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/8c1b4be5 Branch: refs/heads/master Commit: 8c1b4be57ffaf58ce8708e0e9d3611e4e5955f2e Parents: 022de39 Author: Evan PollanAuthored: Thu Oct 6 15:53:04 2016 -0500 Committer: Evan Pollan Committed: Thu Oct 6 15:53:04 2016 -0500 -- .../framework/imps/GzipCompressionProvider.java | 26 +--- 1 file changed, 17 insertions(+), 9 deletions(-) -- http://git-wip-us.apache.org/repos/asf/curator/blob/8c1b4be5/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 10799bc..7b35c37 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 @@ -31,8 +31,12 @@ public class GzipCompressionProvider implements CompressionProvider { ByteArrayOutputStream bytes = new ByteArrayOutputStream(); GZIPOutputStreamout = new GZIPOutputStream(bytes); -out.write(data); -out.finish(); +try { +out.write(data); +out.finish(); +} finally { +out.close(); +} return bytes.toByteArray(); } @@ -41,15 +45,19 @@ public class GzipCompressionProvider implements CompressionProvider { ByteArrayOutputStream bytes = new ByteArrayOutputStream(compressedData.length); GZIPInputStream in = new GZIPInputStream(new ByteArrayInputStream(compressedData)); -byte[] buffer = new byte[compressedData.length]; -for(;;) -{ -int bytesRead = in.read(buffer, 0, buffer.length); -if ( bytesRead < 0 ) +try { +byte[] buffer = new byte[compressedData.length]; +for(;;) { -break; +int bytesRead = in.read(buffer, 0, buffer.length); +if ( bytesRead < 0 ) +{ +break; +} +bytes.write(buffer, 0, bytesRead); } -bytes.write(buffer, 0, bytesRead); +} finally { +in.close(); } return bytes.toByteArray(); }
curator git commit: CURATOR-354: explicitly close GZIP input/output streams in GzipCompressionProvider
Repository: curator Updated Branches: refs/heads/CURATOR-354 [created] 8c1b4be57 CURATOR-354: explicitly close GZIP input/output streams in GzipCompressionProvider Project: http://git-wip-us.apache.org/repos/asf/curator/repo Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/8c1b4be5 Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/8c1b4be5 Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/8c1b4be5 Branch: refs/heads/CURATOR-354 Commit: 8c1b4be57ffaf58ce8708e0e9d3611e4e5955f2e Parents: 022de39 Author: Evan PollanAuthored: Thu Oct 6 15:53:04 2016 -0500 Committer: Evan Pollan Committed: Thu Oct 6 15:53:04 2016 -0500 -- .../framework/imps/GzipCompressionProvider.java | 26 +--- 1 file changed, 17 insertions(+), 9 deletions(-) -- http://git-wip-us.apache.org/repos/asf/curator/blob/8c1b4be5/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 10799bc..7b35c37 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 @@ -31,8 +31,12 @@ public class GzipCompressionProvider implements CompressionProvider { ByteArrayOutputStream bytes = new ByteArrayOutputStream(); GZIPOutputStreamout = new GZIPOutputStream(bytes); -out.write(data); -out.finish(); +try { +out.write(data); +out.finish(); +} finally { +out.close(); +} return bytes.toByteArray(); } @@ -41,15 +45,19 @@ public class GzipCompressionProvider implements CompressionProvider { ByteArrayOutputStream bytes = new ByteArrayOutputStream(compressedData.length); GZIPInputStream in = new GZIPInputStream(new ByteArrayInputStream(compressedData)); -byte[] buffer = new byte[compressedData.length]; -for(;;) -{ -int bytesRead = in.read(buffer, 0, buffer.length); -if ( bytesRead < 0 ) +try { +byte[] buffer = new byte[compressedData.length]; +for(;;) { -break; +int bytesRead = in.read(buffer, 0, buffer.length); +if ( bytesRead < 0 ) +{ +break; +} +bytes.write(buffer, 0, bytesRead); } -bytes.write(buffer, 0, bytesRead); +} finally { +in.close(); } return bytes.toByteArray(); }
[3/3] curator git commit: Merge branch 'master' into CURATOR-3.0
Merge branch 'master' into CURATOR-3.0 Conflicts: curator-recipes/src/main/java/org/apache/curator/framework/recipes/shared/SharedValue.java curator-recipes/src/test/java/org/apache/curator/framework/recipes/shared/TestSharedCount.java pom.xml Project: http://git-wip-us.apache.org/repos/asf/curator/repo Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/9e400bc8 Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/9e400bc8 Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/9e400bc8 Branch: refs/heads/CURATOR-3.0 Commit: 9e400bc8620430c245db86d08bafafe2ecb8534f Parents: 9612c5f 022de39 Author: Cam McKenzieAuthored: Wed Aug 31 11:01:23 2016 +1000 Committer: Cam McKenzie Committed: Wed Aug 31 11:01:23 2016 +1000 -- .../framework/recipes/shared/SharedValue.java | 24 - .../recipes/shared/TestSharedCount.java | 106 +++ 2 files changed, 127 insertions(+), 3 deletions(-) -- http://git-wip-us.apache.org/repos/asf/curator/blob/9e400bc8/curator-recipes/src/main/java/org/apache/curator/framework/recipes/shared/SharedValue.java -- diff --cc curator-recipes/src/main/java/org/apache/curator/framework/recipes/shared/SharedValue.java index 7c2febd,1f9df37..1a3d889 --- a/curator-recipes/src/main/java/org/apache/curator/framework/recipes/shared/SharedValue.java +++ b/curator-recipes/src/main/java/org/apache/curator/framework/recipes/shared/SharedValue.java @@@ -22,7 -22,8 +22,9 @@@ package org.apache.curator.framework.re import com.google.common.base.Function; import com.google.common.base.Preconditions; 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.CuratorWatcher; import org.apache.curator.framework.listen.ListenerContainer; import org.apache.curator.framework.state.ConnectionState; http://git-wip-us.apache.org/repos/asf/curator/blob/9e400bc8/curator-recipes/src/test/java/org/apache/curator/framework/recipes/shared/TestSharedCount.java -- diff --cc curator-recipes/src/test/java/org/apache/curator/framework/recipes/shared/TestSharedCount.java index 28df3f9,7939f6e..0690d6a --- a/curator-recipes/src/test/java/org/apache/curator/framework/recipes/shared/TestSharedCount.java +++ b/curator-recipes/src/test/java/org/apache/curator/framework/recipes/shared/TestSharedCount.java @@@ -23,8 -23,11 +23,12 @@@ import com.google.common.collect.Lists import com.google.common.util.concurrent.ThreadFactoryBuilder; import org.apache.curator.framework.CuratorFramework; import org.apache.curator.framework.CuratorFrameworkFactory; +import org.apache.curator.framework.imps.TestCleanState; + import org.apache.curator.framework.api.BackgroundCallback; + import org.apache.curator.framework.api.CuratorEvent; import org.apache.curator.framework.state.ConnectionState; + import org.apache.curator.framework.state.ConnectionStateListener; + import org.apache.curator.retry.RetryNTimes; import org.apache.curator.retry.RetryOneTime; import org.apache.curator.test.BaseClassForTests; import org.apache.curator.test.Timing; @@@ -321,4 -288,105 +326,105 @@@ public class TestSharedCount extends Ba CloseableUtils.closeQuietly(client1); } } + + + @Test + public void testDisconnectEventOnWatcherDoesNotRetry() throws Exception + { + final CountDownLatch gotSuspendEvent = new CountDownLatch(1); + + CuratorFramework curatorFramework = CuratorFrameworkFactory.newClient(server.getConnectString(), new RetryNTimes(10, 1000)); + curatorFramework.start(); + curatorFramework.blockUntilConnected(); + + SharedCount sharedCount = new SharedCount(curatorFramework, "/count", 10); + sharedCount.start(); + + curatorFramework.getConnectionStateListenable().addListener(new ConnectionStateListener() { + @Override + public void stateChanged(CuratorFramework client, ConnectionState newState) { + if (newState == ConnectionState.SUSPENDED) { + gotSuspendEvent.countDown(); + } + } + }); + + try + { + server.stop(); + // if watcher goes into 10second retry loop we won't get timely notification + Assert.assertTrue(gotSuspendEvent.await(5, TimeUnit.SECONDS)); + } + finally + { + CloseableUtils.closeQuietly(sharedCount); -
[1/3] curator git commit: CURATOR-340 - Updated Zookeeper version to 3.4.8
Repository: curator Updated Branches: refs/heads/CURATOR-3.0 9612c5fbf -> 9e400bc86 CURATOR-340 - Updated Zookeeper version to 3.4.8 Project: http://git-wip-us.apache.org/repos/asf/curator/repo Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/ef33ccb1 Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/ef33ccb1 Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/ef33ccb1 Branch: refs/heads/CURATOR-3.0 Commit: ef33ccb11a2947d6e6598714d79acad6259df454 Parents: 6cebfc1 Author: Cam McKenzieAuthored: Mon Aug 8 13:42:46 2016 +1000 Committer: Cam McKenzie Committed: Mon Aug 8 13:42:46 2016 +1000 -- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/curator/blob/ef33ccb1/pom.xml -- diff --git a/pom.xml b/pom.xml index 50b7ebd..7e8cf9f 100644 --- a/pom.xml +++ b/pom.xml @@ -61,7 +61,7 @@ 1 -3.4.6 +3.4.8 2.7 2.3.7 2.10.3
[2/3] curator git commit: CURATOR-344 - do watch event processing tasks in the background and limit shared value watcher to valid change events to avoid work on disconnect
CURATOR-344 - do watch event processing tasks in the background and limit shared value watcher to valid change events to avoid work on disconnect Project: http://git-wip-us.apache.org/repos/asf/curator/repo Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/022de392 Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/022de392 Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/022de392 Branch: refs/heads/CURATOR-3.0 Commit: 022de3921a120c6f86cc6e21442327cc04b66cd2 Parents: ef33ccb Author: gtullyAuthored: Thu Aug 18 19:34:10 2016 +0100 Committer: gtully Committed: Tue Aug 30 13:09:56 2016 +0100 -- .../framework/recipes/shared/SharedValue.java | 24 - .../recipes/shared/TestSharedCount.java | 106 +++ 2 files changed, 127 insertions(+), 3 deletions(-) -- http://git-wip-us.apache.org/repos/asf/curator/blob/022de392/curator-recipes/src/main/java/org/apache/curator/framework/recipes/shared/SharedValue.java -- diff --git a/curator-recipes/src/main/java/org/apache/curator/framework/recipes/shared/SharedValue.java b/curator-recipes/src/main/java/org/apache/curator/framework/recipes/shared/SharedValue.java index dddc471..1f9df37 100644 --- a/curator-recipes/src/main/java/org/apache/curator/framework/recipes/shared/SharedValue.java +++ b/curator-recipes/src/main/java/org/apache/curator/framework/recipes/shared/SharedValue.java @@ -22,6 +22,8 @@ package org.apache.curator.framework.recipes.shared; import com.google.common.base.Function; import com.google.common.base.Preconditions; import org.apache.curator.framework.CuratorFramework; +import org.apache.curator.framework.api.BackgroundCallback; +import org.apache.curator.framework.api.CuratorEvent; import org.apache.curator.framework.api.CuratorWatcher; import org.apache.curator.framework.listen.ListenerContainer; import org.apache.curator.framework.state.ConnectionState; @@ -30,6 +32,7 @@ import org.apache.curator.utils.PathUtils; import org.apache.curator.utils.ThreadUtils; 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; @@ -59,10 +62,10 @@ public class SharedValue implements Closeable, SharedValueReader @Override public void process(WatchedEvent event) throws Exception { -if ( state.get() == State.STARTED ) +if ( state.get() == State.STARTED && event.getType() != Watcher.Event.EventType.None ) { -readValue(); -notifyListeners(); +// don't block event thread in possible retry +readValueAndNotifyListenersInBackground(); } } }; @@ -248,6 +251,21 @@ public class SharedValue implements Closeable, SharedValueReader updateValue(localStat.getVersion(), bytes); } +private final BackgroundCallback upadateAndNotifyListenerCallback = new BackgroundCallback() { +@Override +public void processResult(CuratorFramework client, CuratorEvent event) throws Exception { +if (event.getResultCode() == KeeperException.Code.OK.intValue()) { +updateValue(event.getStat().getVersion(), event.getData()); +notifyListeners(); +} +} +}; + +private void readValueAndNotifyListenersInBackground() throws Exception +{ + client.getData().usingWatcher(watcher).inBackground(upadateAndNotifyListenerCallback).forPath(path); +} + private void notifyListeners() { final byte[] localValue = getValue(); http://git-wip-us.apache.org/repos/asf/curator/blob/022de392/curator-recipes/src/test/java/org/apache/curator/framework/recipes/shared/TestSharedCount.java -- diff --git a/curator-recipes/src/test/java/org/apache/curator/framework/recipes/shared/TestSharedCount.java b/curator-recipes/src/test/java/org/apache/curator/framework/recipes/shared/TestSharedCount.java index a1f4d8c..7939f6e 100644 --- a/curator-recipes/src/test/java/org/apache/curator/framework/recipes/shared/TestSharedCount.java +++ b/curator-recipes/src/test/java/org/apache/curator/framework/recipes/shared/TestSharedCount.java @@ -23,7 +23,11 @@ import com.google.common.collect.Lists; import com.google.common.util.concurrent.ThreadFactoryBuilder; import org.apache.curator.framework.CuratorFramework; import org.apache.curator.framework.CuratorFrameworkFactory; +import org.apache.curator.framework.api.BackgroundCallback; +import org.apache.curator.framework.api.CuratorEvent; import
curator git commit: CURATOR-344 - do watch event processing tasks in the background and limit shared value watcher to valid change events to avoid work on disconnect
Repository: curator Updated Branches: refs/heads/master ef33ccb11 -> 022de3921 CURATOR-344 - do watch event processing tasks in the background and limit shared value watcher to valid change events to avoid work on disconnect Project: http://git-wip-us.apache.org/repos/asf/curator/repo Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/022de392 Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/022de392 Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/022de392 Branch: refs/heads/master Commit: 022de3921a120c6f86cc6e21442327cc04b66cd2 Parents: ef33ccb Author: gtullyAuthored: Thu Aug 18 19:34:10 2016 +0100 Committer: gtully Committed: Tue Aug 30 13:09:56 2016 +0100 -- .../framework/recipes/shared/SharedValue.java | 24 - .../recipes/shared/TestSharedCount.java | 106 +++ 2 files changed, 127 insertions(+), 3 deletions(-) -- http://git-wip-us.apache.org/repos/asf/curator/blob/022de392/curator-recipes/src/main/java/org/apache/curator/framework/recipes/shared/SharedValue.java -- diff --git a/curator-recipes/src/main/java/org/apache/curator/framework/recipes/shared/SharedValue.java b/curator-recipes/src/main/java/org/apache/curator/framework/recipes/shared/SharedValue.java index dddc471..1f9df37 100644 --- a/curator-recipes/src/main/java/org/apache/curator/framework/recipes/shared/SharedValue.java +++ b/curator-recipes/src/main/java/org/apache/curator/framework/recipes/shared/SharedValue.java @@ -22,6 +22,8 @@ package org.apache.curator.framework.recipes.shared; import com.google.common.base.Function; import com.google.common.base.Preconditions; import org.apache.curator.framework.CuratorFramework; +import org.apache.curator.framework.api.BackgroundCallback; +import org.apache.curator.framework.api.CuratorEvent; import org.apache.curator.framework.api.CuratorWatcher; import org.apache.curator.framework.listen.ListenerContainer; import org.apache.curator.framework.state.ConnectionState; @@ -30,6 +32,7 @@ import org.apache.curator.utils.PathUtils; import org.apache.curator.utils.ThreadUtils; 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; @@ -59,10 +62,10 @@ public class SharedValue implements Closeable, SharedValueReader @Override public void process(WatchedEvent event) throws Exception { -if ( state.get() == State.STARTED ) +if ( state.get() == State.STARTED && event.getType() != Watcher.Event.EventType.None ) { -readValue(); -notifyListeners(); +// don't block event thread in possible retry +readValueAndNotifyListenersInBackground(); } } }; @@ -248,6 +251,21 @@ public class SharedValue implements Closeable, SharedValueReader updateValue(localStat.getVersion(), bytes); } +private final BackgroundCallback upadateAndNotifyListenerCallback = new BackgroundCallback() { +@Override +public void processResult(CuratorFramework client, CuratorEvent event) throws Exception { +if (event.getResultCode() == KeeperException.Code.OK.intValue()) { +updateValue(event.getStat().getVersion(), event.getData()); +notifyListeners(); +} +} +}; + +private void readValueAndNotifyListenersInBackground() throws Exception +{ + client.getData().usingWatcher(watcher).inBackground(upadateAndNotifyListenerCallback).forPath(path); +} + private void notifyListeners() { final byte[] localValue = getValue(); http://git-wip-us.apache.org/repos/asf/curator/blob/022de392/curator-recipes/src/test/java/org/apache/curator/framework/recipes/shared/TestSharedCount.java -- diff --git a/curator-recipes/src/test/java/org/apache/curator/framework/recipes/shared/TestSharedCount.java b/curator-recipes/src/test/java/org/apache/curator/framework/recipes/shared/TestSharedCount.java index a1f4d8c..7939f6e 100644 --- a/curator-recipes/src/test/java/org/apache/curator/framework/recipes/shared/TestSharedCount.java +++ b/curator-recipes/src/test/java/org/apache/curator/framework/recipes/shared/TestSharedCount.java @@ -23,7 +23,11 @@ import com.google.common.collect.Lists; import com.google.common.util.concurrent.ThreadFactoryBuilder; import org.apache.curator.framework.CuratorFramework; import org.apache.curator.framework.CuratorFrameworkFactory; +import