C# Class Enyim.Caching.Memcached.KetamaNodeLocator

Implements Ketama cosistent hashing, compatible with the "spymemcached" Java memcachedClient
Inheritance: IMemcachedNodeLocator
显示文件 Open project: xianrendzw/LightFramework.Net Class Usage Examples

Public Methods

Method Description
KetamaNodeLocator ( ) : System

Initialized a new instance of the KetamaNodeLocator using the default hash algorithm.

KetamaNodeLocator ( string hashName ) : System

Initialized a new instance of the KetamaNodeLocator using a custom hash algorithm.

If the hashName does not match any of the item on the list it will be passed to HashAlgorithm.Create.

Private Methods

Method Description
CreateHash ( ) : HashAlgorithm
GetKeyHash ( string key ) : uint
IMemcachedNodeLocator ( ) : IEnumerable
IMemcachedNodeLocator ( string key ) : IMemcachedNode
IMemcachedNodeLocator ( IList nodes ) : void
LocateNode ( LookupData ld, uint itemKeyHash ) : IMemcachedNode

Method Details

KetamaNodeLocator() public method

Initialized a new instance of the KetamaNodeLocator using the default hash algorithm.
public KetamaNodeLocator ( ) : System
return System

KetamaNodeLocator() public method

Initialized a new instance of the KetamaNodeLocator using a custom hash algorithm.
If the hashName does not match any of the item on the list it will be passed to HashAlgorithm.Create.
public KetamaNodeLocator ( string hashName ) : System
hashName string The name of the hash algorithm to use. /// /// NameDescription /// md5Equivalent of System.Security.Cryptography.MD5 /// sha1Equivalent of System.Security.Cryptography.SHA1 /// tigerTiger Hash /// crcCRC32 /// fnv1_32FNV Hash 32bit /// fnv1_64FNV Hash 64bit /// fnv1a_32Modified FNV Hash 32bit /// fnv1a_64Modified FNV Hash 64bit /// murmurMurmur Hash /// oneatatimeJenkin's "One at A time Hash" /// ///
return System