|
MemCacheClient
|
Maintain the N:1 hash key to server relationship used for consistent hashing. More...
Classes | |
| struct | MatchServer |
Public Member Functions | |
| ConsistentHash (unsigned long aHash, Server *aServer, unsigned aServices, int aEntry) | |
| ConsistentHash (const ConsistentHash &rhs) | |
| ConsistentHash & | operator= (const ConsistentHash &rhs) |
| bool | services (unsigned aService) |
| bool | operator< (const ConsistentHash &rhs) const |
Public Attributes | |
| unsigned long | mHash |
| hash value | |
| Server * | mServer |
| server implementation | |
| unsigned | mServices |
| services this server provides | |
| int | mEntry |
| distinguish same hash and server | |
Private Member Functions | |
| bool | operator== (const ConsistentHash &rhs) const |
Maintain the N:1 hash key to server relationship used for consistent hashing.
Consistent hashing for the servers ensures that even with changes to the server list, many of the data keys will continue to mapped to the same server. This ensures that changes to the server list doesn't invalidate all cached data.
Definition at line 562 of file MemCacheClient.h.
| MemCacheClient::ConsistentHash::ConsistentHash | ( | unsigned long | aHash, |
| Server * | aServer, | ||
| unsigned | aServices, | ||
| int | aEntry | ||
| ) | [inline] |
constructor
Definition at line 569 of file MemCacheClient.h.
| MemCacheClient::ConsistentHash::ConsistentHash | ( | const ConsistentHash & | rhs | ) | [inline] |
copy constructor
Definition at line 572 of file MemCacheClient.h.
| bool MemCacheClient::ConsistentHash::operator< | ( | const ConsistentHash & | rhs | ) | const |
comparison on hash value
Definition at line 213 of file MemCacheClient.cpp.
References MemCacheClient::Server::GetAddress(), mEntry, mHash, mServer, and MemCacheClient::mServer.
| ConsistentHash& MemCacheClient::ConsistentHash::operator= | ( | const ConsistentHash & | rhs | ) | [inline] |
| bool MemCacheClient::ConsistentHash::services | ( | unsigned | aService | ) | [inline] |
does this server handle the required service?
Definition at line 579 of file MemCacheClient.h.
1.7.3