Class Node


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

      Constructors 
      Constructor Description
      Node​(int key, java.lang.String hostname, int group)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      long createPingSequenceId()
      Give a monotonically increasing sequence number.
      boolean equals​(java.lang.Object o)  
      long getLastReceivedPongId()  
      int group()
      Returns the id of this group this node belongs to
      int hashCode()  
      java.lang.String hostname()  
      boolean isLastReceivedPong​(long pingId)
      Checks if this pong is received in line and accepted, or out of band and should be ignored..
      java.lang.Boolean isWorking()
      Returns whether this node is currently responding to requests, or null if status is not known
      int key()
      Returns the unique and stable distribution key of this node
      int pathIndex()  
      void setBlockingWrites​(boolean isBlockingWrites)  
      void setWorking​(boolean working)  
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • Node

        public Node​(int key,
                    java.lang.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 java.lang.String hostname()
      • group

        public int group()
        Returns the id of this group this node belongs to
      • setWorking

        public void setWorking​(boolean working)
      • isWorking

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

        public void setBlockingWrites​(boolean isBlockingWrites)
      • hashCode

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

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object