Class Hasher<T>


  • public class Hasher<T>
    extends java.lang.Object
    A hasher load balances between a set of nodes, represented by object ids.
    Author:
    Arne B Fossaa, bratseth, Prashanth B. Bhat
    • Constructor Summary

      Constructors 
      Constructor Description
      Hasher()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void add​(T node)
      Adds a node with load factor 100
      void add​(T node, int load)
      Adds a code with a load factor.
      Hasher.NodeList<T> getNodes()
      Returns a list of nodes that are up.
      void remove​(T node)
      Removes a node
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Hasher

        public Hasher()
    • Method Detail

      • add

        public void add​(T node)
        Adds a node with load factor 100
      • add

        public void add​(T node,
                        int load)
        Adds a code with a load factor. The load factor is relative to the load of the other added nodes and determines how often this node will be selected compared to the other nodes
      • remove

        public void remove​(T node)
        Removes a node
      • getNodes

        public Hasher.NodeList<T> getNodes()
        Returns a list of nodes that are up.