Package com.yahoo.vdslib.state
Class ClusterState
java.lang.Object
com.yahoo.vdslib.state.ClusterState
- All Implemented Interfaces:
Cloneable
Be careful about changing this class, as it mirrors the ClusterState in C++.
Please update both if you need to change anything.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionclone()static ClusterStatebooleanReturns the state of this cluster state.intgetHtmlDifference(ClusterState other) intgetNodeCount(NodeType type) Take the distributor nodes as an example.getNodeState(Node node) Returns the state of a node.getTextualDifference(ClusterState other) intinthashCode()voidSets the state of this cluster state.voidsetDescription(String description) voidsetDistributionBits(int bits) voidsetNodeState(Node node, NodeState newState) Set the node state of the given node.voidsetVersion(int version) booleanbooleanstatic ClusterStatestateFromString(String stateStr) Parse a given cluster state string into a returned ClusterState instance, wrapping any parse exceptions in a RuntimeException.toString()Returns the serialized form of this cluster statetoString(boolean verbose)
-
Constructor Details
-
ClusterState
- Throws:
ParseException
-
ClusterState
-
-
Method Details
-
stateFromString
Parse a given cluster state string into a returned ClusterState instance, wrapping any parse exceptions in a RuntimeException. -
emptyState
-
clone
-
equals
-
hashCode
public int hashCode() -
similarTo
-
similarToIgnoringInitProgress
-
getTextualDifference
-
getHtmlDifference
-
getVersion
public int getVersion() -
setVersion
public void setVersion(int version) -
getDistributionBitCount
public int getDistributionBitCount() -
setDistributionBits
public void setDistributionBits(int bits) -
getClusterState
Returns the state of this cluster state. In particular, it does not return the cluster state, no matter what the function name says. -
setClusterState
Sets the state of this cluster state. In particular, it does not set the cluster state, no matter what the function name says. -
getNodeCount
Take the distributor nodes as an example. Let X be the highest index of the distributor nodes added through setNodeState(). Let Y be the number of suffix nodes for which the state is down and without description. E.g. if node X is down and without description, but nodex X-1 is up, then Y is 1. The node count for distributors is then X + 1 - Y. -
getNodeState
Returns the state of a node. If the node is not known this returns a node in the state UP (never null) if it has lower index than the max and DOWN otherwise. -
setNodeState
Set the node state of the given node. Automatically adjusts number of nodes of that given type if out of range of current nodes seen. -
getDescription
-
setDescription
-
toString
Returns the serialized form of this cluster state -
toString
-