183
Using libvmemcache
Table 10-3 lists the basic functions that libvmemcache provides. For a complete list,
see the libvmemcache man pages (https://pmem.io/vmemcache/manpages/master/
vmemcache.3.html).
Table 10-3. The libvmemcache functions
Function Name
Description
vmemcache_new
Creates an empty unconfigured vmemcache instance with default
values: eviction_policy=VMeMCaChe_replaCeMent_lrU
extent_size = VMeMCahe_Min_eXtent
VMeMCaChe_Min_pool
vmemcache_add
associates the cache with a path.
vmemcache_set_size
sets the size of the cache.
vmemcache_set_extent_size
sets the block size of the cache (256 bytes minimum).
vmemcache_set_eviction_policy sets the eviction policy:
1. VMeMCaChe_replaCeMent_none
2. VMeMCaChe_replaCeMent_lrU
vmemcache_add
associates the cache with a given path on a DaX-enabled file
system or non-DaX-enabled file system.
vmemcache_delete
frees any structures associated with the cache.
vmemcache_get
searches for an entry with the given key, and if found, the entry’s
value is copied to vbuf.
vmemcache_put
inserts the given key-value pair into the cache.
vmemcache_evict
removes the given key from the cache.
vmemcache_callback_on_evict Called when an entry is being removed from the cache.
vmemcache_callback_on_miss Called when a get query fails to provide an opportunity to insert
the missing key.
Chapter 10 Volatile Use of persistent MeMory
Précédent

- 207/457

Suivant