Package com.yahoo.config.provision
Class ClusterMembership
- java.lang.Object
-
- com.yahoo.config.provision.ClusterMembership
-
public class ClusterMembership extends Object
A node's membership in a cluster. This is a value object. The format is "clusterType/clusterId/groupId/index[/exclusive][/retired][/stateful][/combinedId]"- Author:
- bratseth
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
ClusterMembership()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description ClusterSpec
cluster()
Returns the cluster this node is a member ofboolean
equals(Object o)
static ClusterMembership
from(ClusterSpec cluster, int index)
static ClusterMembership
from(String stringValue, com.yahoo.component.Version vespaVersion, Optional<DockerImage> dockerImageRepo)
int
hashCode()
int
index()
Returns the index of this node within the clusterClusterMembership
retire()
Returns a copy of this which is retiredboolean
retired()
Returns whether the cluster should prepare for this node to be removedstatic ClusterMembership
retiredFrom(ClusterSpec cluster, int index)
String
stringValue()
Returns all the information in this as a string which can be used to construct the same ClusterMembership instance usingfrom(java.lang.String, com.yahoo.component.Version, java.util.Optional<com.yahoo.config.provision.DockerImage>)
.String
toString()
protected String
toStringValue()
ClusterMembership
unretire()
Returns a copy of this node which is not retiredClusterMembership
with(ClusterSpec newCluster)
-
-
-
Method Detail
-
toStringValue
protected String toStringValue()
-
cluster
public ClusterSpec cluster()
Returns the cluster this node is a member of
-
index
public int index()
Returns the index of this node within the cluster
-
retired
public boolean retired()
Returns whether the cluster should prepare for this node to be removed
-
retire
public ClusterMembership retire()
Returns a copy of this which is retired
-
unretire
public ClusterMembership unretire()
Returns a copy of this node which is not retired
-
with
public ClusterMembership with(ClusterSpec newCluster)
-
stringValue
public String stringValue()
Returns all the information in this as a string which can be used to construct the same ClusterMembership instance usingfrom(java.lang.String, com.yahoo.component.Version, java.util.Optional<com.yahoo.config.provision.DockerImage>)
. This string is currently stored in ZooKeeper on running instances.
-
from
public static ClusterMembership from(String stringValue, com.yahoo.component.Version vespaVersion, Optional<DockerImage> dockerImageRepo)
-
from
public static ClusterMembership from(ClusterSpec cluster, int index)
-
retiredFrom
public static ClusterMembership retiredFrom(ClusterSpec cluster, int index)
-
-