Ejemplo n.º 1
0
        /// <summary>
        /// Add a location to HashRing
        /// </summary>
        /// <param name="item">the item to add</param>
        public HashRingLocation <T> AddLocation(T item)
        {
            item.ThrowIfNull();

            UInt32 key = Hashing.HashItem(item);

            HashRingLocation <T> location = new HashRingLocation <T>(key, item);

            location.ReceivedItem += Location_ReceivedItem;

            LocationDictionary.Add(key, location);

            return(location);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Add a HashRingLocation to the HashRing
        /// </summary>
        /// <param name="location">the HashRingLocation</param>
        public void AddLocation(IHashRingLocation <T> location)
        {
            location.ReceivedItem += Location_ReceivedItem;

            LocationDictionary.Add(location.Key, location);
        }