Class NodeState

java.lang.Object
com.yahoo.vdslib.state.NodeState
All Implemented Interfaces:
Cloneable

public class NodeState extends Object implements Cloneable
The state of a single node in the cluster state TODO: The config aspects of this should move to ConfiguredNode TODO: The type should be removed, as it is part of the owner. TODO: Monitoring aspects should move to NodeInfo
  • Field Details

  • Constructor Details

  • Method Details

    • getListingBucketsInitProgressLimit

      public static float getListingBucketsInitProgressLimit()
    • clone

      public NodeState clone()
      Overrides:
      clone in class Object
    • above

      public boolean above(NodeState other)
      A state can not be forced to be in a state above its reported state. For instance, a node being down cannot be forced to up, but a node being down can be forced to maintenance.
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • similarTo

      public boolean similarTo(Object o)
      States are similar if the cluster state doesn't need to be updated due to a change. Note that min dist bits may need to alter cluster state, but as we don't know at this point, we ignore it. Cluster state will check for that.
    • similarToIgnoringInitProgress

      public boolean similarToIgnoringInitProgress(NodeState other)
    • getDiff

      public Diff getDiff(NodeState other)
    • getTextualDifference

      public String getTextualDifference(NodeState other)
    • setCapacity

      public NodeState setCapacity(float c)
      Capacity is set by deserializing a node state. This seems odd, as it is config
    • setInitProgress

      public NodeState setInitProgress(float p)
    • setDescription

      public NodeState setDescription(String desc)
    • setMinUsedBits

      public NodeState setMinUsedBits(int u)
    • setState

      public NodeState setState(State state)
    • setStartTimestamp

      public NodeState setStartTimestamp(long ts)
    • getCapacity

      public double getCapacity()
    • getInitProgress

      public double getInitProgress()
    • hasDescription

      public boolean hasDescription()
    • getDescription

      public String getDescription()
    • getState

      public State getState()
    • getMinUsedBits

      public int getMinUsedBits()
    • getStartTimestamp

      public long getStartTimestamp()
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • toString

      public String toString(boolean compact)
    • serialize

      public String serialize()
    • serialize

      public String serialize(boolean verbose)
    • serialize

      public String serialize(int nodeIdx, boolean verbose)
    • deserialize

      public static NodeState deserialize(NodeType type, String serialized) throws ParseException
      Creates an instance from the serialized form produced by serialize
      Throws:
      ParseException
    • verifyValidInSystemState

      public void verifyValidInSystemState(NodeType type)