|
Equalizer
1.3.1-git
|
Classes | |
| struct | Data |
| One cache entry. More... | |
| struct | Item |
Public Member Functions | |
| CO_API | InstanceCache (const uint64_t maxSize=LB_100MB) |
| Construct a new instance cache. | |
| CO_API | ~InstanceCache () |
| Destruct this instance cache. | |
| CO_API bool | add (const ObjectVersion &rev, const uint32_t instanceID, Command &command, const uint32_t usage=0) |
| Add a new command to the instance cache. | |
| void | remove (const NodeID &node) |
| Remove all items from the given node. | |
| CO_API const Data & | operator[] (const UUID &id) |
| Direct access to the cached instance data for the given object id. | |
| CO_API bool | release (const UUID &id, const uint32_t count) |
| Release the retrieved instance data of the given object. | |
| CO_API bool | erase (const UUID &id) |
| Erase all the data for the given object. | |
| uint64_t | getSize () const |
| uint64_t | getMaxSize () const |
| void | expire (const int64_t age) |
| Remove all items which are older than the given time. | |
| bool | isEmpty () |
Definition at line 36 of file instanceCache.h.
| CO_API co::InstanceCache::InstanceCache | ( | const uint64_t | maxSize = LB_100MB | ) |
Construct a new instance cache.
| CO_API co::InstanceCache::~InstanceCache | ( | ) |
Destruct this instance cache.
| CO_API bool co::InstanceCache::add | ( | const ObjectVersion & | rev, |
| const uint32_t | instanceID, | ||
| Command & | command, | ||
| const uint32_t | usage = 0 |
||
| ) |
Add a new command to the instance cache.
| rev | the object identifier and version. |
| instanceID | the master instance ID. |
| command | The command to add. |
| usage | pre-set usage count. |
| CO_API bool co::InstanceCache::erase | ( | const UUID & | id | ) |
Erase all the data for the given object.
The data does not have to be accessed, i.e., release has been called for each previous access.
| void co::InstanceCache::expire | ( | const int64_t | age | ) |
Remove all items which are older than the given time.
| uint64_t co::InstanceCache::getMaxSize | ( | ) | const [inline] |
Definition at line 110 of file instanceCache.h.
| uint64_t co::InstanceCache::getSize | ( | ) | const [inline] |
Definition at line 107 of file instanceCache.h.
Direct access to the cached instance data for the given object id.
The instance data for the given object has to be released by the caller, unless 0 has been returned. Not all returned data stream might be ready.
| id | the identifier of the object to look up. |
| CO_API bool co::InstanceCache::release | ( | const UUID & | id, |
| const uint32_t | count | ||
| ) |
Release the retrieved instance data of the given object.
| id | the identifier of the object to release. |
| count | the number of access operations to release |
| void co::InstanceCache::remove | ( | const NodeID & | node | ) |
Remove all items from the given node.
1.3.1-git by
1.8.0