GraphLab: Distributed Graph-Parallel API
2.1
|
#include <graphlab/rpc/coherent_dht.hpp>
Public Member Functions | |
coherent_dht (distributed_control &dc, size_t max_cache_size=1024) | |
Creates a coherent distributed hash table. | |
void | set (const KeyType &key, const ValueType &newval) |
Sets the value of a key in the background. | |
void | set_synchronous (const KeyType &key, const ValueType &newval) |
Sets the value of a key. | |
std::pair< bool, ValueType > | get (const KeyType &key) const |
procid_t | owning_machine (const KeyType &key) const |
bool | in_cache (const KeyType &key) const |
bool | asynchronous_get (const KeyType &key) const |
double | cache_miss_rate () |
Returns the number of misses divided by the number of requests. | |
size_t | num_gets () const |
Returns the number of requests. | |
size_t | num_misses () const |
Returns the number of cache misses. | |
size_t | cache_size () const |
Returns the current size of the cache. | |
void | subscribe (const KeyType &key, bool async=false) const |
void | invalidate (const KeyType &key) const |
Invalidates the cache entry associated with this key. |
This implements a cache coherent distributed hash table.
Each machine has a part of the hash table as well as a cache. The system implements automatic cache invalidation as well as automatic cache subscription (currently through a rather poor heuristic).
Definition at line 77 of file coherent_dht.hpp.
|
inline |
Creates a coherent distributed hash table.
dc | distributed control to use for communication |
max_cache_size | Size of cache on local machine |
Definition at line 219 of file coherent_dht.hpp.
|
inline |
Puts out a prefetch request for this key.
Definition at line 328 of file coherent_dht.hpp.
|
inline |
Gets the value associated with the key. returns true on success. get will read from the cache if data is already available in the cache. If not, get will obtain the data from across the network
Definition at line 269 of file coherent_dht.hpp.
|
inline |
Returns true of the key is currently in the cache
Definition at line 310 of file coherent_dht.hpp.
|
inline |
Returns the machine responsible for storing the key
Definition at line 301 of file coherent_dht.hpp.
|
inline |
Sets the value of a key in the background.
This function sets the value of a key, but uses background communication to change the key value. When this function returns, it is not guaranteed that all machines have the updated value.
Definition at line 254 of file coherent_dht.hpp.
|
inline |
Subscribes to this key. This key will be a permanent entry in the cache and can not be invalidated. Key modifications are automatically sent to this machine.
Definition at line 361 of file coherent_dht.hpp.