GME  13
Classes | Typedefs | Enumerations | Functions | Variables
Memcached Client Routines
APR Utility Functions
Collaboration diagram for 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

Variables

const char * data
const char const apr_size_t data_len
const apr_uint32_t hash
apr_memcache_tmc
apr_memcache_server_tserver
const char * host
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 char * key
apr_pool_t const char char ** baton
apr_pool_t const char char
apr_size_t * 
len
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_t * 
nv
const char apr_int32_t
apr_uint32_t * 
new_value
apr_pool_t apr_memcache_stats_t ** stats

Typedef Documentation

Opaque memcache client connection object

Definition at line 56 of file apr_memcache.h.

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.

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.

Memcache Server Info Object

Definition at line 59 of file apr_memcache.h.

Definition at line 86 of file apr_memcache.h.


Enumeration Type Documentation

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 ( 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.

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.

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
APU_DECLARE ( void  )

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:

Variable Documentation

apr_pool_t char** baton

Definition at line 248 of file apr_memcache.h.

const char* data

Definition at line 130 of file apr_memcache.h.

const char const apr_size_t data_len

Definition at line 130 of file apr_memcache.h.

Definition at line 278 of file apr_memcache.h.

const char char const apr_size_t data_size

Definition at line 292 of file apr_memcache.h.

const char char const apr_size_t apr_uint32_t apr_uint16_t flags

Definition at line 233 of file apr_memcache.h.

apr_memcache_t const apr_uint32_t hash

Definition at line 155 of file apr_memcache.h.

const char * host

Definition at line 184 of file apr_memcache.h.

const char* key

Definition at line 248 of file apr_memcache.h.

apr_pool_t const char char apr_size_t* len

Definition at line 248 of file apr_memcache.h.

const char apr_port_t apr_uint32_t apr_uint32_t apr_uint32_t max

Definition at line 218 of file apr_memcache.h.

apr_uint16_t max_servers

Definition at line 233 of file apr_memcache.h.

apr_uint16_t apr_uint32_t apr_memcache_t ** mc

Definition at line 161 of file apr_memcache.h.

const char apr_port_t apr_uint32_t min

Definition at line 218 of file apr_memcache.h.

Definition at line 193 of file apr_memcache.h.

const char apr_int32_t n

Definition at line 351 of file apr_memcache.h.

const char apr_int32_t apr_uint32_t* new_value

Definition at line 363 of file apr_memcache.h.

const char apr_port_t apr_uint32_t apr_uint32_t apr_uint32_t apr_uint32_t apr_memcache_server_t** ns

Definition at line 218 of file apr_memcache.h.

const char apr_int32_t apr_uint32_t* nv

Definition at line 351 of file apr_memcache.h.

Definition at line 248 of file apr_memcache.h.

const char apr_port_t port

Definition at line 184 of file apr_memcache.h.

Definition at line 173 of file apr_memcache.h.

const char apr_port_t apr_uint32_t apr_uint32_t smax

Definition at line 218 of file apr_memcache.h.

Definition at line 434 of file apr_memcache.h.

Definition at line 278 of file apr_memcache.h.

const char apr_uint32_t timeout

Definition at line 292 of file apr_memcache.h.

const char apr_port_t apr_uint32_t apr_uint32_t apr_uint32_t apr_uint32_t ttl

Definition at line 218 of file apr_memcache.h.

Definition at line 264 of file apr_memcache.h.