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

Classes

struct  apr_redis_server_t
 
struct  apr_redis_t
 
struct  apr_redis_stats_t
 

Typedefs

typedef struct apr_redis_conn_t apr_redis_conn_t
 
typedef struct apr_redis_server_t apr_redis_server_t
 
typedef struct apr_redis_t apr_redis_t
 
typedef apr_uint32_t(* apr_redis_hash_func) (void *baton, const char *data, const apr_size_t data_len)
 
typedef apr_redis_server_t *(* apr_redis_server_func) (void *baton, apr_redis_t *rc, const apr_uint32_t hash)
 

Enumerations

enum  apr_redis_server_status_t { APR_RC_SERVER_LIVE , APR_RC_SERVER_DEAD }
 
enum  apr_redis_server_role_t { APR_RS_SERVER_MASTER , APR_RS_SERVER_SLAVE , APR_RS_SERVER_UNKNOWN }
 

Functions

 APU_DECLARE (apr_uint32_t) apr_redis_hash(apr_redis_t *rc
 
 APU_DECLARE (apr_redis_server_t *) apr_redis_find_server_hash(apr_redis_t *rc
 
 APU_DECLARE (apr_status_t) apr_redis_add_server(apr_redis_t *rc
 

Variables

const chardata
 
const char const apr_size_t data_len
 
const apr_uint32_t hash
 
apr_redis_trc
 
apr_redis_server_tserver
 
const charhost
 
const char apr_port_t port
 
apr_redis_server_trs
 
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_uint32_t rwto
 
const char apr_port_t apr_uint32_t apr_uint32_t apr_uint32_t apr_uint32_t apr_uint32_t apr_redis_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 char const apr_size_t data_size
 
const char char const apr_size_t apr_uint32_t timeout
 
const char apr_int32_t inc
 
const char apr_int32_t apr_uint32_tnew_value
 
apr_pool_ttemp_pool
 
apr_pool_t apr_pool_tdata_pool
 
apr_pool_t apr_pool_t apr_hash_tvalues
 
apr_pool_t apr_redis_stats_t ** stats
 

Detailed Description

Typedef Documentation

◆ apr_redis_conn_t

Opaque redis client connection object

Definition at line 71 of file apr_redis.h.

◆ apr_redis_hash_func

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

Definition at line 107 of file apr_redis.h.

◆ apr_redis_server_func

typedef apr_redis_server_t *(* apr_redis_server_func) (void *baton, apr_redis_t *rc, const apr_uint32_t hash)

Definition at line 115 of file apr_redis.h.

◆ apr_redis_server_t

Redis Server Info Object

Definition at line 74 of file apr_redis.h.

◆ apr_redis_t

Definition at line 100 of file apr_redis.h.

Enumeration Type Documentation

◆ apr_redis_server_role_t

Enumerator
APR_RS_SERVER_MASTER 

Server is a master

APR_RS_SERVER_SLAVE 

Server is a slave

APR_RS_SERVER_UNKNOWN 

Server role is unknown

Definition at line 373 of file apr_redis.h.

◆ apr_redis_server_status_t

Specifies the status of a redis server

Enumerator
APR_RC_SERVER_LIVE 

Server is alive and responding to requests

APR_RC_SERVER_DEAD 

Server is not responding to requests

Definition at line 64 of file apr_redis.h.

Function Documentation

◆ APU_DECLARE() [1/3]

APU_DECLARE ( apr_redis_server_t )

Picks a server based on a hash

Parameters
rcThe redis client object to use
hashHashed value of a Key
Returns
server that controls specified hash
See also
apr_redis_hash

server selection compatible with the standard Perl Client.

Finds a Server object based on a hostname/port pair

Parameters
rcThe redis 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/3]

APU_DECLARE ( apr_status_t  )

Adds a server to a client object

Parameters
rcThe redis 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
rcThe redis client object to use
rsServer to Activate

Disable a Server

Parameters
rcThe redis client object to use
rsServer 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
rwtor/w timeout value in seconds 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 redisd client object

Parameters
pPool to use
max_serversmaximum number of servers
flagsNot currently used
rclocation of the new redis client object

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

Parameters
rcclient 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

Sets a value by key on the server

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

Sets a value by key on the server

Parameters
rcclient 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

Deletes a key from a server

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

Query a server's version

Parameters
rsserver to query
pPool to allocate answer from
batonlocation to store server version string

Query a server's INFO

Parameters
rsserver to query
pPool to allocate answer from
batonlocation to store server INFO response string

Increments a value

Parameters
rcclient to use
keynull terminated string containing the key
incnumber to increment by
new_valuenew value after incrementing

Decrements a value

Parameters
rcclient to use
keynull terminated string containing the key
incnumber to decrement by
new_valuenew value after decrementing

Pings the server

Parameters
rsServer to ping

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

Parameters
rcclient 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_redis_value_t keyed by strings, contains the result of the multiget call.
Returns

Query a server for statistics

Parameters
rsserver 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/3]

APU_DECLARE ( apr_uint32_t  )

Creates a crc32 hash used to split keys between servers

Parameters
rcThe redis 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 redisd clients.

Pure CRC32 Hash. Used by some clients.

hash compatible with the standard Perl Client.

Definition at line 142 of file apr_memcache.c.

Variable Documentation

◆ baton

apr_pool_t char ** baton

Definition at line 264 of file apr_redis.h.

◆ data

const char * data

Definition at line 142 of file apr_redis.h.

◆ data_len

Definition at line 143 of file apr_redis.h.

◆ data_pool

apr_pool_t apr_pool_t* data_pool

Definition at line 370 of file apr_redis.h.

◆ data_size

Definition at line 279 of file apr_redis.h.

◆ flags

Definition at line 248 of file apr_redis.h.

◆ hash

Definition at line 167 of file apr_redis.h.

◆ host

const char * host

Definition at line 196 of file apr_redis.h.

◆ inc

Definition at line 337 of file apr_redis.h.

◆ key

const char * key

Definition at line 263 of file apr_redis.h.

◆ len

Definition at line 265 of file apr_redis.h.

◆ max

Definition at line 235 of file apr_redis.h.

◆ max_servers

apr_uint16_t max_servers

Definition at line 247 of file apr_redis.h.

◆ min

Definition at line 233 of file apr_redis.h.

◆ new_value

Definition at line 338 of file apr_redis.h.

◆ ns

Definition at line 238 of file apr_redis.h.

◆ p

Definition at line 262 of file apr_redis.h.

◆ port

Definition at line 197 of file apr_redis.h.

◆ rc

Definition at line 173 of file apr_redis.h.

◆ rs

Definition at line 205 of file apr_redis.h.

◆ rwto

Definition at line 237 of file apr_redis.h.

◆ server

Definition at line 185 of file apr_redis.h.

◆ smax

Definition at line 234 of file apr_redis.h.

◆ stats

Definition at line 451 of file apr_redis.h.

◆ temp_pool

apr_pool_t* temp_pool

Definition at line 369 of file apr_redis.h.

◆ timeout

Definition at line 295 of file apr_redis.h.

◆ ttl

Definition at line 236 of file apr_redis.h.

◆ values

Definition at line 371 of file apr_redis.h.