Class Hasher<T>


  • public class Hasher<T>
    extends Object
    A hasher load balances between a set of nodes, represented by object ids.
    Author:
    Arne B Fossaa, bratseth, Prashanth B. Bhat
    • 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.