MySQL  8.0.16
Source Code Documentation
items.h File Reference

Go to the source code of this file.

Classes

struct  _hash_item
 
struct  itemstats_t
 
struct  items
 

Typedefs

typedef struct _hash_item hash_item
 

Functions

hash_itemitem_alloc (struct default_engine *engine, const void *key, size_t nkey, int flags, rel_time_t exptime, int nbytes, const void *cookie)
 Allocate and initialize a new item structure. More...
 
hash_itemitem_get (struct default_engine *engine, const void *key, const size_t nkey)
 Get an item from the cache. More...
 
void item_stats_reset (struct default_engine *engine)
 Reset the item statistics. More...
 
void item_stats (struct default_engine *engine, ADD_STAT add_stat, const void *cookie)
 Get item statitistics. More...
 
void item_stats_sizes (struct default_engine *engine, ADD_STAT add_stat, const void *cookie)
 Get detaild item statitistics. More...
 
char * item_cachedump (struct default_engine *engine, const unsigned int slabs_clsid, const unsigned int limit, unsigned int *bytes)
 Dump items from the cache. More...
 
void item_flush_expired (struct default_engine *engine, time_t when)
 Flush expired items from the cache. More...
 
void item_release (struct default_engine *engine, hash_item *it)
 Release our reference to the current item. More...
 
void item_unlink (struct default_engine *engine, hash_item *it)
 Unlink the item from the hash table (make it inaccessible) More...
 
hash_itemtouch_item (struct default_engine *engine, const void *key, uint16_t nkey, uint32_t exptime)
 Set the expiration time for an object. More...
 
ENGINE_ERROR_CODE store_item (struct default_engine *engine, hash_item *item, uint64_t *cas, ENGINE_STORE_OPERATION operation, const void *cookie)
 Store an item in the cache. More...
 
ENGINE_ERROR_CODE arithmetic (struct default_engine *engine, const void *cookie, const void *key, const int nkey, const bool increment, const bool create, const uint64_t delta, const uint64_t initial, const rel_time_t exptime, uint64_t *cas, uint64_t *result)
 
bool item_start_scrub (struct default_engine *engine)
 Start the item scrubber. More...
 
tap_event_t item_tap_walker (ENGINE_HANDLE *handle, const void *cookie, item **itm, void **es, uint16_t *nes, uint8_t *ttl, uint16_t *flags, uint32_t *seqno, uint16_t *vbucket)
 The tap walker to walk the hashtables. More...
 
bool initialize_item_tap_walker (struct default_engine *engine, const void *cookie)
 

Typedef Documentation

◆ hash_item

typedef struct _hash_item hash_item

Function Documentation

◆ arithmetic()

ENGINE_ERROR_CODE arithmetic ( struct default_engine engine,
const void *  cookie,
const void *  key,
const int  nkey,
const bool  increment,
const bool  create,
const uint64_t  delta,
const uint64_t  initial,
const rel_time_t  exptime,
uint64_t *  cas,
uint64_t *  result 
)

◆ initialize_item_tap_walker()

bool initialize_item_tap_walker ( struct default_engine engine,
const void *  cookie 
)

◆ item_alloc()

hash_item* item_alloc ( struct default_engine engine,
const void *  key,
size_t  nkey,
int  flags,
rel_time_t  exptime,
int  nbytes,
const void *  cookie 
)

Allocate and initialize a new item structure.

Parameters
enginehandle to the storage engine
keythe key for the new item
nkeythe number of bytes in the key
flagsthe flags in the new item
exptimewhen the object should expire
nbytesthe number of bytes in the body for the item
cookiecookie provided by the core to identify the client
Returns
a pointer to an item on success NULL otherwise

◆ item_cachedump()

char* item_cachedump ( struct default_engine engine,
const unsigned int  slabs_clsid,
const unsigned int  limit,
unsigned int *  bytes 
)

Dump items from the cache.

Parameters
enginehandle to the storage engine
slabs_clsidthe slab class to get items from
limitthe maximum number of items to receive
bytesthe number of bytes in the return message (OUT)
Returns
pointer to a string containint the data

◆ item_flush_expired()

void item_flush_expired ( struct default_engine engine,
time_t  when 
)

Flush expired items from the cache.

Parameters
enginehandle to the storage engine
whenwhen the items should be flushed

◆ item_get()

hash_item* item_get ( struct default_engine engine,
const void *  key,
const size_t  nkey 
)

Get an item from the cache.

Parameters
enginehandle to the storage engine
keythe key for the item to get
nkeythe number of bytes in the key
Returns
pointer to the item if it exists or NULL otherwise

◆ item_release()

void item_release ( struct default_engine engine,
hash_item it 
)

Release our reference to the current item.

Parameters
enginehandle to the storage engine
itthe item to release

◆ item_start_scrub()

bool item_start_scrub ( struct default_engine engine)

Start the item scrubber.

Parameters
enginehandle to the storage engine

◆ item_stats()

void item_stats ( struct default_engine engine,
ADD_STAT  add_stat,
const void *  cookie 
)

Get item statitistics.

Parameters
enginehandle to the storage engine
add_statcallback provided by the core used to push statistics into the response
cookiecookie provided by the core to identify the client

◆ item_stats_reset()

void item_stats_reset ( struct default_engine engine)

Reset the item statistics.

Parameters
enginehandle to the storage engine

◆ item_stats_sizes()

void item_stats_sizes ( struct default_engine engine,
ADD_STAT  add_stat,
const void *  cookie 
)

Get detaild item statitistics.

Parameters
enginehandle to the storage engine
add_statcallback provided by the core used to push statistics into the response
cookiecookie provided by the core to identify the client

◆ item_tap_walker()

tap_event_t item_tap_walker ( ENGINE_HANDLE *  handle,
const void *  cookie,
item **  itm,
void **  es,
uint16_t *  nes,
uint8_t *  ttl,
uint16_t *  flags,
uint32_t *  seqno,
uint16_t *  vbucket 
)

The tap walker to walk the hashtables.

◆ item_unlink()

void item_unlink ( struct default_engine engine,
hash_item it 
)

Unlink the item from the hash table (make it inaccessible)

Parameters
enginehandle to the storage engine
itthe item to unlink

◆ store_item()

ENGINE_ERROR_CODE store_item ( struct default_engine engine,
hash_item item,
uint64_t *  cas,
ENGINE_STORE_OPERATION  operation,
const void *  cookie 
)

Store an item in the cache.

Parameters
enginehandle to the storage engine
itemthe item to store
casthe cas value (OUT)
operationwhat kind of store operation is this (ADD/SET etc)
cookiecookie provided by the core to identify the client
Returns
ENGINE_SUCCESS on success

◆ touch_item()

hash_item* touch_item ( struct default_engine engine,
const void *  key,
uint16_t  nkey,
uint32_t  exptime 
)

Set the expiration time for an object.

Parameters
enginehandle to the storage engine
keythe key to set
nkeythe number of characters in key..
exptimethe expiration time
Returns
The (updated) item if it exists