You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@curator.apache.org by ra...@apache.org on 2016/03/29 00:40:23 UTC
[1/5] curator git commit: Added a new DYNAMIC_SEQUENTIAL ServiceType
which creates an EPHEMERAL_SEQUENTIAL node in Zookeeper
Repository: curator
Updated Branches:
refs/heads/CURATOR-3.0 062a7d750 -> 88da05c03
Added a new DYNAMIC_SEQUENTIAL ServiceType which creates an
EPHEMERAL_SEQUENTIAL node in Zookeeper
Project: http://git-wip-us.apache.org/repos/asf/curator/repo
Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/6ebc6971
Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/6ebc6971
Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/6ebc6971
Branch: refs/heads/CURATOR-3.0
Commit: 6ebc69717570dc39d5f3d6a6b16828b35324356f
Parents: 33c19d6
Author: nirdothan <ni...@amdocs.com>
Authored: Thu Mar 3 11:25:32 2016 +0200
Committer: nirdothan <ni...@amdocs.com>
Committed: Thu Mar 3 11:27:04 2016 +0200
----------------------------------------------------------------------
.../org/apache/curator/x/discovery/ServiceType.java | 3 ++-
.../x/discovery/details/ServiceDiscoveryImpl.java | 12 +++++++++++-
2 files changed, 13 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/curator/blob/6ebc6971/curator-x-discovery/src/main/java/org/apache/curator/x/discovery/ServiceType.java
----------------------------------------------------------------------
diff --git a/curator-x-discovery/src/main/java/org/apache/curator/x/discovery/ServiceType.java b/curator-x-discovery/src/main/java/org/apache/curator/x/discovery/ServiceType.java
index a919ace..3268e62 100644
--- a/curator-x-discovery/src/main/java/org/apache/curator/x/discovery/ServiceType.java
+++ b/curator-x-discovery/src/main/java/org/apache/curator/x/discovery/ServiceType.java
@@ -22,5 +22,6 @@ public enum ServiceType
{
DYNAMIC,
STATIC,
- PERMANENT
+ PERMANENT,
+ DYNAMIC_SEQUENTIAL
}
http://git-wip-us.apache.org/repos/asf/curator/blob/6ebc6971/curator-x-discovery/src/main/java/org/apache/curator/x/discovery/details/ServiceDiscoveryImpl.java
----------------------------------------------------------------------
diff --git a/curator-x-discovery/src/main/java/org/apache/curator/x/discovery/details/ServiceDiscoveryImpl.java b/curator-x-discovery/src/main/java/org/apache/curator/x/discovery/details/ServiceDiscoveryImpl.java
index de81612..dd4d6ce 100644
--- a/curator-x-discovery/src/main/java/org/apache/curator/x/discovery/details/ServiceDiscoveryImpl.java
+++ b/curator-x-discovery/src/main/java/org/apache/curator/x/discovery/details/ServiceDiscoveryImpl.java
@@ -220,7 +220,17 @@ public class ServiceDiscoveryImpl<T> implements ServiceDiscovery<T>
{
try
{
- CreateMode mode = (service.getServiceType() == ServiceType.DYNAMIC) ? CreateMode.EPHEMERAL : CreateMode.PERSISTENT;
+ CreateMode mode;
+ switch (service.getServiceType()){
+ case DYNAMIC:
+ mode = CreateMode.EPHEMERAL;
+ break;
+ case DYNAMIC_SEQUENTIAL:
+ mode = CreateMode.EPHEMERAL_SEQUENTIAL;
+ break;
+ default:
+ mode = CreateMode.PERSISTENT;
+ }
client.create().creatingParentContainersIfNeeded().withMode(mode).forPath(path, bytes);
isDone = true;
}
[5/5] curator git commit: Merge branch 'master' into CURATOR-3.0
Posted by ra...@apache.org.
Merge branch 'master' into CURATOR-3.0
Project: http://git-wip-us.apache.org/repos/asf/curator/repo
Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/88da05c0
Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/88da05c0
Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/88da05c0
Branch: refs/heads/CURATOR-3.0
Commit: 88da05c03caffd022737d382fde07271aedda9df
Parents: 062a7d7 3d1fca2
Author: randgalt <ra...@apache.org>
Authored: Mon Mar 28 17:40:12 2016 -0500
Committer: randgalt <ra...@apache.org>
Committed: Mon Mar 28 17:40:12 2016 -0500
----------------------------------------------------------------------
.../x/discovery/server/rest/DiscoveryResource.java | 2 +-
.../org/apache/curator/x/discovery/ServiceType.java | 7 ++++++-
.../x/discovery/details/ServiceDiscoveryImpl.java | 13 ++++++++++++-
3 files changed, 19 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
[2/5] curator git commit: added validation for DYNAMIC_SEQUENTIAL
service type added a break in switch case
Posted by ra...@apache.org.
added validation for DYNAMIC_SEQUENTIAL service type
added a break in switch case
Project: http://git-wip-us.apache.org/repos/asf/curator/repo
Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/b75f92bf
Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/b75f92bf
Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/b75f92bf
Branch: refs/heads/CURATOR-3.0
Commit: b75f92bf2dbacd755c770373195a8444338041c8
Parents: 6ebc697
Author: nirdothan <ni...@gmail.com>
Authored: Mon Mar 21 12:09:48 2016 +0200
Committer: nirdothan <ni...@gmail.com>
Committed: Mon Mar 21 12:09:48 2016 +0200
----------------------------------------------------------------------
.../apache/curator/x/discovery/server/rest/DiscoveryResource.java | 2 +-
.../apache/curator/x/discovery/details/ServiceDiscoveryImpl.java | 1 +
2 files changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/curator/blob/b75f92bf/curator-x-discovery-server/src/main/java/org/apache/curator/x/discovery/server/rest/DiscoveryResource.java
----------------------------------------------------------------------
diff --git a/curator-x-discovery-server/src/main/java/org/apache/curator/x/discovery/server/rest/DiscoveryResource.java b/curator-x-discovery-server/src/main/java/org/apache/curator/x/discovery/server/rest/DiscoveryResource.java
index b4d9cb7..49c550b 100644
--- a/curator-x-discovery-server/src/main/java/org/apache/curator/x/discovery/server/rest/DiscoveryResource.java
+++ b/curator-x-discovery-server/src/main/java/org/apache/curator/x/discovery/server/rest/DiscoveryResource.java
@@ -90,7 +90,7 @@ public abstract class DiscoveryResource<T>
return Response.status(Response.Status.BAD_REQUEST).build();
}
- if ( instance.getServiceType() == ServiceType.DYNAMIC )
+ if ( instance.getServiceType() == ServiceType.DYNAMIC || instance.getServiceType() == ServiceType.DYNAMIC_SEQUENTIAL )
{
log.info("Service type cannot be dynamic");
return Response.status(Response.Status.BAD_REQUEST).build();
http://git-wip-us.apache.org/repos/asf/curator/blob/b75f92bf/curator-x-discovery/src/main/java/org/apache/curator/x/discovery/details/ServiceDiscoveryImpl.java
----------------------------------------------------------------------
diff --git a/curator-x-discovery/src/main/java/org/apache/curator/x/discovery/details/ServiceDiscoveryImpl.java b/curator-x-discovery/src/main/java/org/apache/curator/x/discovery/details/ServiceDiscoveryImpl.java
index dd4d6ce..d0f21d4 100644
--- a/curator-x-discovery/src/main/java/org/apache/curator/x/discovery/details/ServiceDiscoveryImpl.java
+++ b/curator-x-discovery/src/main/java/org/apache/curator/x/discovery/details/ServiceDiscoveryImpl.java
@@ -230,6 +230,7 @@ public class ServiceDiscoveryImpl<T> implements ServiceDiscovery<T>
break;
default:
mode = CreateMode.PERSISTENT;
+ break;
}
client.create().creatingParentContainersIfNeeded().withMode(mode).forPath(path, bytes);
isDone = true;
[4/5] curator git commit: Merge branch 'CURATOR-304' of
github.com:nirdothan/curator into CURATOR-304
Posted by ra...@apache.org.
Merge branch 'CURATOR-304' of github.com:nirdothan/curator into CURATOR-304
Project: http://git-wip-us.apache.org/repos/asf/curator/repo
Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/3d1fca23
Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/3d1fca23
Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/3d1fca23
Branch: refs/heads/CURATOR-3.0
Commit: 3d1fca23108fbb5840e544c3e68d9af2b71de949
Parents: 8499680 0b088ff
Author: randgalt <ra...@apache.org>
Authored: Mon Mar 28 17:38:54 2016 -0500
Committer: randgalt <ra...@apache.org>
Committed: Mon Mar 28 17:38:54 2016 -0500
----------------------------------------------------------------------
.../x/discovery/server/rest/DiscoveryResource.java | 2 +-
.../org/apache/curator/x/discovery/ServiceType.java | 7 ++++++-
.../x/discovery/details/ServiceDiscoveryImpl.java | 13 ++++++++++++-
3 files changed, 19 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
[3/5] curator git commit: added an enum method to indicate if a
ServiceType.isDynamic()
Posted by ra...@apache.org.
added an enum method to indicate if a ServiceType.isDynamic()
Project: http://git-wip-us.apache.org/repos/asf/curator/repo
Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/0b088ffb
Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/0b088ffb
Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/0b088ffb
Branch: refs/heads/CURATOR-3.0
Commit: 0b088ffba5288da07332ac6df4be89e9b6d6dd36
Parents: b75f92b
Author: nirdothan <ni...@gmail.com>
Authored: Tue Mar 22 12:36:05 2016 +0200
Committer: nirdothan <ni...@gmail.com>
Committed: Tue Mar 22 12:36:05 2016 +0200
----------------------------------------------------------------------
.../server/rest/DiscoveryResource.java | 2 +-
.../apache/curator/x/discovery/ServiceType.java | 6 ++++-
.../discovery/details/ServiceDiscoveryImpl.java | 24 ++++++++++----------
3 files changed, 18 insertions(+), 14 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/curator/blob/0b088ffb/curator-x-discovery-server/src/main/java/org/apache/curator/x/discovery/server/rest/DiscoveryResource.java
----------------------------------------------------------------------
diff --git a/curator-x-discovery-server/src/main/java/org/apache/curator/x/discovery/server/rest/DiscoveryResource.java b/curator-x-discovery-server/src/main/java/org/apache/curator/x/discovery/server/rest/DiscoveryResource.java
index 49c550b..f84a333 100644
--- a/curator-x-discovery-server/src/main/java/org/apache/curator/x/discovery/server/rest/DiscoveryResource.java
+++ b/curator-x-discovery-server/src/main/java/org/apache/curator/x/discovery/server/rest/DiscoveryResource.java
@@ -90,7 +90,7 @@ public abstract class DiscoveryResource<T>
return Response.status(Response.Status.BAD_REQUEST).build();
}
- if ( instance.getServiceType() == ServiceType.DYNAMIC || instance.getServiceType() == ServiceType.DYNAMIC_SEQUENTIAL )
+ if ( instance.getServiceType().isDynamic() )
{
log.info("Service type cannot be dynamic");
return Response.status(Response.Status.BAD_REQUEST).build();
http://git-wip-us.apache.org/repos/asf/curator/blob/0b088ffb/curator-x-discovery/src/main/java/org/apache/curator/x/discovery/ServiceType.java
----------------------------------------------------------------------
diff --git a/curator-x-discovery/src/main/java/org/apache/curator/x/discovery/ServiceType.java b/curator-x-discovery/src/main/java/org/apache/curator/x/discovery/ServiceType.java
index 3268e62..d076cdc 100644
--- a/curator-x-discovery/src/main/java/org/apache/curator/x/discovery/ServiceType.java
+++ b/curator-x-discovery/src/main/java/org/apache/curator/x/discovery/ServiceType.java
@@ -23,5 +23,9 @@ public enum ServiceType
DYNAMIC,
STATIC,
PERMANENT,
- DYNAMIC_SEQUENTIAL
+ DYNAMIC_SEQUENTIAL;
+
+ public boolean isDynamic() {
+ return this == DYNAMIC || this == DYNAMIC_SEQUENTIAL;
+ }
}
http://git-wip-us.apache.org/repos/asf/curator/blob/0b088ffb/curator-x-discovery/src/main/java/org/apache/curator/x/discovery/details/ServiceDiscoveryImpl.java
----------------------------------------------------------------------
diff --git a/curator-x-discovery/src/main/java/org/apache/curator/x/discovery/details/ServiceDiscoveryImpl.java b/curator-x-discovery/src/main/java/org/apache/curator/x/discovery/details/ServiceDiscoveryImpl.java
index d0f21d4..762c9a8 100644
--- a/curator-x-discovery/src/main/java/org/apache/curator/x/discovery/details/ServiceDiscoveryImpl.java
+++ b/curator-x-discovery/src/main/java/org/apache/curator/x/discovery/details/ServiceDiscoveryImpl.java
@@ -220,18 +220,18 @@ public class ServiceDiscoveryImpl<T> implements ServiceDiscovery<T>
{
try
{
- CreateMode mode;
- switch (service.getServiceType()){
- case DYNAMIC:
- mode = CreateMode.EPHEMERAL;
- break;
- case DYNAMIC_SEQUENTIAL:
- mode = CreateMode.EPHEMERAL_SEQUENTIAL;
- break;
- default:
- mode = CreateMode.PERSISTENT;
- break;
- }
+ CreateMode mode;
+ switch (service.getServiceType()) {
+ case DYNAMIC:
+ mode = CreateMode.EPHEMERAL;
+ break;
+ case DYNAMIC_SEQUENTIAL:
+ mode = CreateMode.EPHEMERAL_SEQUENTIAL;
+ break;
+ default:
+ mode = CreateMode.PERSISTENT;
+ break;
+ }
client.create().creatingParentContainersIfNeeded().withMode(mode).forPath(path, bytes);
isDone = true;
}