proxygen
|
#include <ConsistentHash.h>
Public Member Functions | |
virtual | ~ConsistentHash () |
virtual void | build (std::vector< std::pair< std::string, uint64_t > > &)=0 |
virtual size_t | get (const uint64_t key, const size_t rank=0) const =0 |
virtual double | getMaxErrorRate () const =0 |
Definition at line 18 of file ConsistentHash.h.
|
inlinevirtual |
Definition at line 20 of file ConsistentHash.h.
References build(), getMaxErrorRate(), and uint64_t.
|
pure virtual |
build() builds the hashing pool based on a vector of nodes with their keys and weights.
The bevahior of calling build multiple times is undefined.
build() is not thread safe with get(), documented below.
Referenced by ~ConsistentHash().
|
pure virtual |
get(key, N) finds the node ranked N in the consistent hashing space for the given key.
The returning value is the node's index in the input vector of build().
Implemented in proxygen::RendezvousHash.
|
pure virtual |
get max error rate the current hashing space
Implemented in proxygen::RendezvousHash.
Referenced by ~ConsistentHash().