Apache HTTPD
Classes | Typedefs | Enumerations | Functions | Variables
Memcached Client Routines

Classes

struct  apr_memcache_server_t
 
struct  apr_memcache_t
 
struct  apr_memcache_value_t
 
struct  apr_memcache_stats_t
 

Typedefs

typedef struct apr_memcache_conn_t apr_memcache_conn_t
 
typedef struct apr_memcache_server_t apr_memcache_server_t
 
typedef apr_uint32_t(* apr_memcache_hash_func) (void *baton, const char *data, const apr_size_t data_len)
 
typedef struct apr_memcache_t apr_memcache_t
 
typedef apr_memcache_server_t *(* apr_memcache_server_func) (void *baton, apr_memcache_t *mc, const apr_uint32_t hash)
 

Enumerations

enum  apr_memcache_server_status_t { APR_MC_SERVER_LIVE , APR_MC_SERVER_DEAD }
 

Functions

 APU_DECLARE (apr_uint32_t) apr_memcache_hash(apr_memcache_t *mc
 
 APU_DECLARE (apr_memcache_server_t *) apr_memcache_find_server_hash(apr_memcache_t *mc
 
 APU_DECLARE (apr_status_t) apr_memcache_add_server(apr_memcache_t *mc
 
 APU_DECLARE (void) apr_memcache_add_multget_key(apr_pool_t *data_pool
 Computes SipHash-2-4, producing a 64bit (APR_SIPHASH_DSIZE) hash from a message and a 128bit (APR_SIPHASH_KSIZE) secret key, into a possibly unaligned buffer (using the little endian representation as defined by the authors for interoperabilty) usable as a MAC.
 

Variables

const chardata
 
const char const apr_size_t data_len
 
const apr_uint32_t hash
 
apr_memcache_tmc
 
apr_memcache_server_tserver
 
const charhost
 
const char apr_port_t port
 
apr_memcache_server_tms
 
const char apr_port_t apr_uint32_t min
 
const char apr_port_t apr_uint32_t apr_uint32_t smax
 
const char apr_port_t apr_uint32_t apr_uint32_t apr_uint32_t max
 
const char apr_port_t apr_uint32_t apr_uint32_t apr_uint32_t apr_uint32_t ttl
 
const char apr_port_t apr_uint32_t apr_uint32_t apr_uint32_t apr_uint32_t apr_memcache_server_t ** ns
 
apr_uint16_t max_servers
 
apr_uint16_t apr_uint32_t flags
 
apr_pool_tp
 
apr_pool_t const charkey
 
apr_pool_t const char char ** baton
 
apr_pool_t const char char apr_size_tlen
 
const char apr_hash_t ** values
 
apr_pool_ttemp_pool
 
apr_pool_t apr_pool_tdata_pool
 
const char char const apr_size_t data_size
 
const char char const apr_size_t apr_uint32_t timeout
 
const char apr_int32_t n
 
const char apr_int32_t apr_uint32_tnv
 
const char apr_int32_t apr_uint32_tnew_value
 
apr_pool_t apr_memcache_stats_t ** stats
 

Detailed Description

Typedef Documentation

◆ apr_memcache_conn_t

Opaque memcache client connection object

Definition at line 56 of file apr_memcache.h.

◆ apr_memcache_hash_func

typedef apr_uint32_t(* apr_memcache_hash_func) (void *baton, const char *data, const apr_size_t data_len)

Definition at line 82 of file apr_memcache.h.

◆ apr_memcache_server_func

typedef apr_memcache_server_t *(* apr_memcache_server_func) (void *baton, apr_memcache_t *mc, const apr_uint32_t hash)

Definition at line 93 of file apr_memcache.h.

◆ apr_memcache_server_t

Memcache Server Info Object

Definition at line 59 of file apr_memcache.h.

◆ apr_memcache_t

Definition at line 86 of file apr_memcache.h.

Enumeration Type Documentation

◆ apr_memcache_server_status_t

Specifies the status of a memcached server

Enumerator
APR_MC_SERVER_LIVE 

Server is alive and responding to requests

APR_MC_SERVER_DEAD 

Server is not responding to requests

Definition at line 49 of file apr_memcache.h.

Function Documentation

◆ APU_DECLARE() [1/4]

APU_DECLARE ( apr_memcache_server_t )

Picks a server based on a hash

Parameters
mcThe memcache client object to use
hashHashed value of a Key
Returns
server that controls specified hash
See also
apr_memcache_hash

server selection compatible with the standard Perl Client.

Finds a Server object based on a hostname/port pair

Parameters
mcThe memcache client object to use
hostHostname of the server
portPort of the server
Returns
Server with matching Hostname and Port, or NULL if none was found.

◆ APU_DECLARE() [2/4]

APU_DECLARE ( apr_status_t  )

Adds a server to a client object

Parameters
mcThe memcache client object to use
serverServer to add
Remarks
Adding servers is not thread safe, and should be done once at startup.
Warning
Changing servers after startup may cause keys to go to different servers.

Enables a Server for use again

Parameters
mcThe memcache client object to use
msServer to Activate

Disable a Server

Parameters
mcThe memcache client object to use
msServer to Disable

Creates a new Server Object

Parameters
pPool to use
hosthostname of the server
portport of the server
minminimum number of client sockets to open
smaxsoft maximum number of client connections to open
maxhard maximum number of client connections
ttltime to live in microseconds of a client connection
nslocation of the new server object
See also
apr_reslist_create
Remarks
min, smax, and max are only used when APR_HAS_THREADS

Creates a new memcached client object

Parameters
pPool to use
max_serversmaximum number of servers
flagsNot currently used
mclocation of the new memcache client object

Gets a value from the server, allocating the value out of p

Parameters
mcclient to use
pPool to use
keynull terminated string containing the key
batonlocation of the allocated value
lenlength of data at baton
flagsany flags set by the client for this key
Returns

Gets multiple values from the server, allocating the values out of p

Parameters
mcclient to use
temp_poolPool used for temporary allocations. May be cleared inside this call.
data_poolPool used to allocate data for the returned values.
valueshash of apr_memcache_value_t keyed by strings, contains the result of the multiget call.
Returns

Sets a value by key on the server

Parameters
mcclient to use
keynull terminated string containing the key
batondata to store on the server
data_sizelength of data at baton
timeouttime in seconds for the data to live on the server
flagsany flags set by the client for this key

Adds value by key on the server

Parameters
mcclient to use
keynull terminated string containing the key
batondata to store on the server
data_sizelength of data at baton
timeouttime for the data to live on the server
flagsany flags set by the client for this key
Returns
APR_SUCCESS if the key was added, APR_EEXIST if the key already exists on the server.

Replaces value by key on the server

Parameters
mcclient to use
keynull terminated string containing the key
batondata to store on the server
data_sizelength of data at baton
timeouttime for the data to live on the server
flagsany flags set by the client for this key
Returns
APR_SUCCESS if the key was added, APR_EEXIST if the key did not exist on the server.

Deletes a key from a server

Parameters
mcclient to use
keynull terminated string containing the key
timeouttime for the delete to stop other clients from adding

Increments a value

Parameters
mcclient to use
keynull terminated string containing the key
nnumber to increment by
nvnew value after incrementing

Decrements a value

Parameters
mcclient to use
keynull terminated string containing the key
nnumber to decrement by
new_valuenew value after decrementing

Query a server's version

Parameters
msserver to query
pPool to allocate answer from
batonlocation to store server version string
lenlength of the server version string

Query a server for statistics

Parameters
msserver to query
pPool to allocate answer from
statslocation of the new statistics structure

< Shared lock. More than one process or thread can hold a shared lock at any given time. Essentially, this is a "read lock", preventing writers from establishing an exclusive lock.

< Shared lock. More than one process or thread can hold a shared lock at any given time. Essentially, this is a "read lock", preventing writers from establishing an exclusive lock.

< Exclusive lock. Only one process may hold an exclusive lock at any given time. This is analogous to a "write lock".

< Exclusive lock. Only one process may hold an exclusive lock at any given time. This is analogous to a "write lock".

< Replace

< Insert with duplicates

< Shared lock. More than one process or thread can hold a shared lock at any given time. Essentially, this is a "read lock", preventing writers from establishing an exclusive lock.

< Shared lock. More than one process or thread can hold a shared lock at any given time. Essentially, this is a "read lock", preventing writers from establishing an exclusive lock.

< mask to extract lock type

< Shared lock. More than one process or thread can hold a shared lock at any given time. Essentially, this is a "read lock", preventing writers from establishing an exclusive lock.

< Exclusive lock. Only one process may hold an exclusive lock at any given time. This is analogous to a "write lock".

< Exclusive lock. Only one process may hold an exclusive lock at any given time. This is analogous to a "write lock".

< Size of the file

< Shared lock. More than one process or thread can hold a shared lock at any given time. Essentially, this is a "read lock", preventing writers from establishing an exclusive lock.

< Exclusive lock. Only one process may hold an exclusive lock at any given time. This is analogous to a "write lock".

Definition at line 358 of file apr_brigade.c.

◆ APU_DECLARE() [3/4]

APU_DECLARE ( apr_uint32_t  )

Creates a crc32 hash used to split keys between servers

Parameters
mcThe memcache client object to use
dataData to be hashed
data_lenLength of the data to use
Returns
crc32 hash of data
Remarks
The crc32 hash is not compatible with old memcached clients.

Pure CRC32 Hash. Used by some clients.

hash compatible with the standard Perl Client.

Definition at line 556 of file apr_memcache.c.

◆ APU_DECLARE() [4/4]

APU_DECLARE ( void  )

Computes SipHash-2-4, producing a 64bit (APR_SIPHASH_DSIZE) hash from a message and a 128bit (APR_SIPHASH_KSIZE) secret key, into a possibly unaligned buffer (using the little endian representation as defined by the authors for interoperabilty) usable as a MAC.

Add a key to a hash for a multiget query if the hash (*value) is NULL it will be created

Parameters
data_poolpool from where the hash and their items are created from
keynull terminated string containing the key
valueshash of keys and values that this key will be added to
Returns

< use pool pre cleanup

Definition at line 128 of file apr_sha1.c.

Variable Documentation

◆ baton

apr_pool_t char ** baton

Definition at line 250 of file apr_memcache.h.

◆ data

const char * data

Definition at line 130 of file apr_memcache.h.

◆ data_len

Definition at line 131 of file apr_memcache.h.

◆ data_pool

apr_pool_t apr_pool_t* data_pool

Definition at line 279 of file apr_memcache.h.

◆ data_size

Definition at line 294 of file apr_memcache.h.

◆ flags

Definition at line 234 of file apr_memcache.h.

◆ hash

Definition at line 155 of file apr_memcache.h.

◆ host

const char * host

Definition at line 184 of file apr_memcache.h.

◆ key

const char * key

Definition at line 249 of file apr_memcache.h.

◆ len

Definition at line 251 of file apr_memcache.h.

◆ max

Definition at line 222 of file apr_memcache.h.

◆ max_servers

apr_uint16_t max_servers

Definition at line 233 of file apr_memcache.h.

◆ mc

Definition at line 161 of file apr_memcache.h.

◆ min

Definition at line 220 of file apr_memcache.h.

◆ ms

Definition at line 193 of file apr_memcache.h.

◆ n

Definition at line 352 of file apr_memcache.h.

◆ new_value

Definition at line 365 of file apr_memcache.h.

◆ ns

Definition at line 224 of file apr_memcache.h.

◆ nv

Definition at line 353 of file apr_memcache.h.

◆ p

Definition at line 248 of file apr_memcache.h.

◆ port

Definition at line 185 of file apr_memcache.h.

◆ server

Definition at line 173 of file apr_memcache.h.

◆ smax

Definition at line 221 of file apr_memcache.h.

◆ stats

Definition at line 435 of file apr_memcache.h.

◆ temp_pool

apr_pool_t* temp_pool

Definition at line 278 of file apr_memcache.h.

◆ timeout

Definition at line 295 of file apr_memcache.h.

◆ ttl

Definition at line 223 of file apr_memcache.h.

◆ values

Definition at line 265 of file apr_memcache.h.