java.lang.Object
com.yahoo.search.dispatch.searchcluster.Node

public class Node extends Object
A node in a search cluster. This class is multithread safe.
Author:
bratseth, ollivir
  • Constructor Details

    • Node

      public Node(String clusterName, int key, String hostname, int group)
  • Method Details

    • createPingSequenceId

      public long createPingSequenceId()
      Give a monotonically increasing sequence number.
    • isLastReceivedPong

      public boolean isLastReceivedPong(long pingId)
      Checks if this pong is received in line and accepted, or out of band and should be ignored.
    • getLastReceivedPongId

      public long getLastReceivedPongId()
    • key

      public int key()
      Returns the unique and stable distribution key of this node
    • pathIndex

      public int pathIndex()
    • hostname

      public String hostname()
    • group

      public int group()
      Returns the index of the group this node belongs to. This is a 0-base continuous integer id, not necessarily the same as the group id assigned by the application/node repo.
    • setWorking

      public void setWorking(boolean working)
    • isWorking

      public Boolean isWorking()
      Returns whether this node is currently responding to requests, or null if status is not known
    • setActiveDocuments

      public void setActiveDocuments(long documents)
      Updates the active documents on this node
    • setTargetActiveDocuments

      public void setTargetActiveDocuments(long documents)
    • setBlockingWrites

      public void setBlockingWrites(boolean isBlockingWrites)
    • hashCode

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

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

      public String toString()
      Overrides:
      toString in class Object