Class Node


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

      • Node

        public Node​(int key,
                    String hostname,
                    int group)
    • Method Detail

      • 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 id of the group this node belongs to
      • 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 activeDocuments)
        Updates the active documents on this node
      • setBlockingWrites

        public void setBlockingWrites​(boolean isBlockingWrites)
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object