You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by st...@apache.org on 2013/10/31 11:33:58 UTC

svn commit: r1537429 - /sling/trunk/bundles/extensions/discovery/api/src/main/java/org/apache/sling/discovery/ClusterView.java

Author: stefanegli
Date: Thu Oct 31 10:33:58 2013
New Revision: 1537429

URL: http://svn.apache.org/r1537429
Log:
SLING-3164 : reverting deprecation of getId and instead adjusted javadoc to reflect the fact that the cluster id is stable

Modified:
    sling/trunk/bundles/extensions/discovery/api/src/main/java/org/apache/sling/discovery/ClusterView.java

Modified: sling/trunk/bundles/extensions/discovery/api/src/main/java/org/apache/sling/discovery/ClusterView.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/discovery/api/src/main/java/org/apache/sling/discovery/ClusterView.java?rev=1537429&r1=1537428&r2=1537429&view=diff
==============================================================================
--- sling/trunk/bundles/extensions/discovery/api/src/main/java/org/apache/sling/discovery/ClusterView.java (original)
+++ sling/trunk/bundles/extensions/discovery/api/src/main/java/org/apache/sling/discovery/ClusterView.java Thu Oct 31 10:33:58 2013
@@ -32,20 +32,25 @@ import aQute.bnd.annotation.ProviderType
 public interface ClusterView {
 
 	/**
-	 * Returns an id of this cluster view.
+	 * Returns a stable id of the cluster represented by this
+	 * cluster view.
 	 * <p>
-	 * Note that this id is not guaranteed to be stable between
-	 * instances of ClusterViews. The id is identifying only the
-	 * current view of the cluster, not the cluster itself, and 
-	 * thus if the view changes the id might (or might not) change.
+	 * Similar to the SlingID, this id is persisted and thus
+	 * remains stable accross instance/cluster restarts.
+	 * <p>
+	 * When an instance joins a cluster, it will inherit
+	 * the id from the joined cluster (thus incurs a cluster id
+	 * change).
+	 * <p>
+	 * Note: When instances part from a cluster (eg due to a network
+	 * partitioning) the cluster id is retained. This results in
+	 * potentially multiple clusters with the same id. This 
+	 * fact could be used to detect such partitioning/split brain
+	 * situations. It also implies though that the cluster id
+	 * is not guaranteed to be unique in a topology!
 	 * @return an id of this cluster view
-	 * @deprecated due to the unstable nature of this id - it only
-	 * identifies the current view of the cluster, not the cluster
-	 * itself - this id has been deprecated. If an id of the cluster
-	 * itself is needed, this must be dealt with on an application
-	 * level - for example by letting the cluster leader define
-	 * such an id and taking care of special cases like cluster joins.
 	 * @see <a href="http://issues.apache.org/jira/browse/SLING-3164">SLING-3164</a>
+	 * @since exists since 1.0.0 - stable since 1.0.2
 	 */
     String getId();