#include <lazy_dht.hpp>
Public Types | |
|
typedef dc_impl::lru_list < KeyType, ValueType > | lru_entry_type |
|
typedef boost::unordered_map < KeyType, ValueType > | map_type |
| datatype of the data map | |
|
typedef boost::unordered_map < KeyType, lru_entry_type * > | cache_type |
| datatype of the local cache map | |
|
typedef boost::intrusive::member_hook < lru_entry_type, typename lru_entry_type::lru_member_hook_type,&lru_entry_type::member_hook_ > | MemberOption |
|
typedef boost::intrusive::list < lru_entry_type, MemberOption, boost::intrusive::constant_time_size < false > > | lru_list_type |
| datatype of the intrusive LRU list embedded in the cache map | |
Public Member Functions | |
| lazy_dht (distributed_control &dc, size_t max_cache_size=65536) | |
| Constructor. Creates the integer map. | |
| void | set (const KeyType &key, const ValueType &newval) |
| Sets the key to the value. | |
| std::pair< bool, ValueType > | get_owned (const KeyType &key) const |
| void | remote_get_owned (const KeyType &key, procid_t source, size_t ptr) const |
| void | get_reply (size_t ptr, ValueType &val, bool hasvalue) |
| std::pair< bool, ValueType > | get (const KeyType &key) const |
| std::pair< bool, ValueType > | get_cached (const KeyType &key) const |
| void | invalidate (const KeyType &key) const |
| Invalidates the cache entry associated with this key. | |
| double | cache_miss_rate () |
| size_t | num_gets () const |
| size_t | num_misses () const |
| size_t | cache_size () const |
This implements a distributed key -> value map with caching capabilities. It is up to the user to determine cache invalidation policies. User explicitly calls the invalidate() function to clear local cache entries. This is an extremely lazy DHT in that it is up to the user to guarantee that the keys are unique. Any machine can call set on any key, and the result of the key will be stored locally. Reads on any unknown keys will be resolved using a broadcast operation.
Definition at line 50 of file lazy_dht.hpp.
| std::pair<bool, ValueType> graphlab::lazy_dht< KeyType, ValueType >::get | ( | const KeyType & | key | ) | const [inline] |
Gets the value associated with the key. returns true on success..
Definition at line 151 of file lazy_dht.hpp.
| std::pair<bool, ValueType> graphlab::lazy_dht< KeyType, ValueType >::get_cached | ( | const KeyType & | key | ) | const [inline] |
Gets the value associated with the key, reading from cache if available Note that the cache may be out of date.
Definition at line 176 of file lazy_dht.hpp.
1.7.1