You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by ro...@apache.org on 2017/10/20 14:37:00 UTC

[sling-org-apache-sling-discovery-api] 35/39: SLING-5683 : moved misleading 'duplicate sling.id' comment of DiscoveryService down to more appropriate ClusterView and TopologyView, changing it to state that each instance must have a unique sling.id - as that is indeed what discovery API wants to ensure/guarantee. Also, added a comment about the fact that no topology assumptions whatsoever can be done between TOPOLOGY_CHANGING and TOPOLOGY_CHANGED. Both aren't meant to change the API really but are rather clarifications to better reflec [...]

This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-discovery-api.git

commit bb13db81960caecf2a6812ed47af85e299ed25d1
Author: Stefan Egli <st...@apache.org>
AuthorDate: Mon Apr 25 09:13:27 2016 +0000

    SLING-5683 : moved misleading 'duplicate sling.id' comment of DiscoveryService down to more appropriate ClusterView and TopologyView, changing it to state that each instance must have a unique sling.id - as that is indeed what discovery API wants to ensure/guarantee. Also, added a comment about the fact that no topology assumptions whatsoever can be done between TOPOLOGY_CHANGING and TOPOLOGY_CHANGED. Both aren't meant to change the API really but are rather clarifications to better r [...]
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1740778 13f79535-47bb-0310-9956-ffa450edef68
---
 src/main/java/org/apache/sling/discovery/ClusterView.java      | 3 +++
 src/main/java/org/apache/sling/discovery/DiscoveryService.java | 3 ---
 src/main/java/org/apache/sling/discovery/TopologyEvent.java    | 5 +++++
 src/main/java/org/apache/sling/discovery/TopologyView.java     | 4 +++-
 4 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/src/main/java/org/apache/sling/discovery/ClusterView.java b/src/main/java/org/apache/sling/discovery/ClusterView.java
index 0e77c48..42f47a1 100644
--- a/src/main/java/org/apache/sling/discovery/ClusterView.java
+++ b/src/main/java/org/apache/sling/discovery/ClusterView.java
@@ -30,6 +30,9 @@ import aQute.bnd.annotation.ProviderType;
  * persistence layer/jcr repository.
  * <p>
  * A ClusterView can also consist of just one single instance.
+ * <p>
+ * All instances in a cluster must and do have a unique sling.id.
+ * @see InstanceDescription#getSlingId()
  */
 @ProviderType
 public interface ClusterView {
diff --git a/src/main/java/org/apache/sling/discovery/DiscoveryService.java b/src/main/java/org/apache/sling/discovery/DiscoveryService.java
index 8ad7fa6..eebf0da 100644
--- a/src/main/java/org/apache/sling/discovery/DiscoveryService.java
+++ b/src/main/java/org/apache/sling/discovery/DiscoveryService.java
@@ -26,9 +26,6 @@ import aQute.bnd.annotation.ProviderType;
  * The discovery service is in charge of managing live instances that
  * have announced themselves as being part of a topology view. The exact
  * details of how this announcement occurs is implementation dependent.
- * <p>
- * Note that the discovery service fails if it detects a situation
- * where more than one instance with the same sling.id exists in a cluster.
  */
 @ProviderType
 public interface DiscoveryService {
diff --git a/src/main/java/org/apache/sling/discovery/TopologyEvent.java b/src/main/java/org/apache/sling/discovery/TopologyEvent.java
index 65dc13f..20180e0 100644
--- a/src/main/java/org/apache/sling/discovery/TopologyEvent.java
+++ b/src/main/java/org/apache/sling/discovery/TopologyEvent.java
@@ -42,6 +42,11 @@ public class TopologyEvent {
          * being discovered. Once the discovery is finished, a TOPOLOGY_CHANGED
          * is sent with the new topology view.
          * <p>
+         * After receiving a TOPOLOGY_CHANGING and before receiving a
+         * TOPOLOGY_CHANGED event a TopologyEventListener cannot make any
+         * assumptions wrt the topology whatsoever, including whether or not 
+         * the local instance is part of it at all (partitioning).
+         * <p>
          * An implementation must always send a TOPOLOGY_CHANGING before a
          * TOPOLOGY_CHANGED.
          */
diff --git a/src/main/java/org/apache/sling/discovery/TopologyView.java b/src/main/java/org/apache/sling/discovery/TopologyView.java
index 0352efb..c1f3acb 100644
--- a/src/main/java/org/apache/sling/discovery/TopologyView.java
+++ b/src/main/java/org/apache/sling/discovery/TopologyView.java
@@ -25,7 +25,9 @@ import aQute.bnd.annotation.ProviderType;
 /**
  * A topology view is a cross-cluster list of instances and clusters
  * that have announced themselves with the DiscoveryService.
- *
+ * <p>
+ * All instances in a topology must and do have a unique sling.id.
+ * @see InstanceDescription#getSlingId()
  */
 @ProviderType
 public interface TopologyView {

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.