GraphLab: Distributed Graph-Parallel API  2.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
graphlab::coherent_dht< KeyType, ValueType > Class Template Reference

#include <graphlab/rpc/coherent_dht.hpp>

List of all members.

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.

Detailed Description

template<typename KeyType, typename ValueType>
class graphlab::coherent_dht< KeyType, ValueType >

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).

Warning:
The implementation is extremely experimental. Use at your own risk

Definition at line 77 of file coherent_dht.hpp.


Constructor & Destructor Documentation

template<typename KeyType , typename ValueType >
graphlab::coherent_dht< KeyType, ValueType >::coherent_dht ( distributed_control dc,
size_t  max_cache_size = 1024 
)
inline

Creates a coherent distributed hash table.

Parameters:
dcdistributed control to use for communication
max_cache_sizeSize of cache on local machine

Definition at line 219 of file coherent_dht.hpp.


Member Function Documentation

template<typename KeyType , typename ValueType >
bool graphlab::coherent_dht< KeyType, ValueType >::asynchronous_get ( const KeyType &  key) const
inline

Puts out a prefetch request for this key.

Definition at line 328 of file coherent_dht.hpp.

template<typename KeyType , typename ValueType >
std::pair<bool, ValueType> graphlab::coherent_dht< KeyType, ValueType >::get ( const KeyType &  key) const
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.

template<typename KeyType , typename ValueType >
bool graphlab::coherent_dht< KeyType, ValueType >::in_cache ( const KeyType &  key) const
inline

Returns true of the key is currently in the cache

Definition at line 310 of file coherent_dht.hpp.

template<typename KeyType , typename ValueType >
procid_t graphlab::coherent_dht< KeyType, ValueType >::owning_machine ( const KeyType &  key) const
inline

Returns the machine responsible for storing the key

Definition at line 301 of file coherent_dht.hpp.

template<typename KeyType , typename ValueType >
void graphlab::coherent_dht< KeyType, ValueType >::set ( const KeyType &  key,
const ValueType &  newval 
)
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.

template<typename KeyType , typename ValueType >
void graphlab::coherent_dht< KeyType, ValueType >::subscribe ( const KeyType &  key,
bool  async = false 
) const
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.


The documentation for this class was generated from the following file: