Apache Portable Runtime Utility Library
|
Data Structures | |
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 | |
apr_uint32_t | apr_redis_hash (apr_redis_t *rc, const char *data, const apr_size_t data_len) |
apr_uint32_t | apr_redis_hash_crc32 (void *baton, const char *data, const apr_size_t data_len) |
apr_uint32_t | apr_redis_hash_default (void *baton, const char *data, const apr_size_t data_len) |
apr_redis_server_t * | apr_redis_find_server_hash (apr_redis_t *rc, const apr_uint32_t hash) |
apr_redis_server_t * | apr_redis_find_server_hash_default (void *baton, apr_redis_t *rc, const apr_uint32_t hash) |
apr_status_t | apr_redis_add_server (apr_redis_t *rc, apr_redis_server_t *server) |
apr_redis_server_t * | apr_redis_find_server (apr_redis_t *rc, const char *host, apr_port_t port) |
apr_status_t | apr_redis_enable_server (apr_redis_t *rc, apr_redis_server_t *rs) |
apr_status_t | apr_redis_disable_server (apr_redis_t *rc, apr_redis_server_t *rs) |
apr_status_t | apr_redis_server_create (apr_pool_t *p, const char *host, apr_port_t port, apr_uint32_t min, apr_uint32_t smax, apr_uint32_t max, apr_uint32_t ttl, apr_uint32_t rwto, apr_redis_server_t **ns) |
apr_status_t | apr_redis_create (apr_pool_t *p, apr_uint16_t max_servers, apr_uint32_t flags, apr_redis_t **rc) |
apr_status_t | apr_redis_getp (apr_redis_t *rc, apr_pool_t *p, const char *key, char **baton, apr_size_t *len, apr_uint16_t *flags) |
apr_status_t | apr_redis_set (apr_redis_t *rc, const char *key, char *baton, const apr_size_t data_size, apr_uint16_t flags) |
apr_status_t | apr_redis_setex (apr_redis_t *rc, const char *key, char *baton, const apr_size_t data_size, apr_uint32_t timeout, apr_uint16_t flags) |
apr_status_t | apr_redis_delete (apr_redis_t *rc, const char *key, apr_uint32_t timeout) |
apr_status_t | apr_redis_version (apr_redis_server_t *rs, apr_pool_t *p, char **baton) |
apr_status_t | apr_redis_info (apr_redis_server_t *rs, apr_pool_t *p, char **baton) |
apr_status_t | apr_redis_incr (apr_redis_t *rc, const char *key, apr_int32_t inc, apr_uint32_t *new_value) |
apr_status_t | apr_redis_decr (apr_redis_t *rc, const char *key, apr_int32_t inc, apr_uint32_t *new_value) |
apr_status_t | apr_redis_ping (apr_redis_server_t *rs) |
apr_status_t | apr_redis_multgetp (apr_redis_t *rc, apr_pool_t *temp_pool, apr_pool_t *data_pool, apr_hash_t *values) |
apr_status_t | apr_redis_stats (apr_redis_server_t *rs, apr_pool_t *p, apr_redis_stats_t **stats) |
typedef struct apr_redis_conn_t apr_redis_conn_t |
Opaque redis client connection object
typedef struct apr_redis_server_t apr_redis_server_t |
Redis Server Info Object
apr_status_t apr_redis_add_server | ( | apr_redis_t * | rc, |
apr_redis_server_t * | server | ||
) |
Adds a server to a client object
rc | The redis client object to use |
server | Server to add |
apr_status_t apr_redis_create | ( | apr_pool_t * | p, |
apr_uint16_t | max_servers, | ||
apr_uint32_t | flags, | ||
apr_redis_t ** | rc | ||
) |
Creates a new redisd client object
p | Pool to use |
max_servers | maximum number of servers |
flags | Not currently used |
rc | location of the new redis client object |
apr_status_t apr_redis_decr | ( | apr_redis_t * | rc, |
const char * | key, | ||
apr_int32_t | inc, | ||
apr_uint32_t * | new_value | ||
) |
Decrements a value
rc | client to use |
key | null terminated string containing the key |
inc | number to decrement by |
new_value | new value after decrementing |
apr_status_t apr_redis_delete | ( | apr_redis_t * | rc, |
const char * | key, | ||
apr_uint32_t | timeout | ||
) |
Deletes a key from a server
rc | client to use |
key | null terminated string containing the key |
timeout | time for the delete to stop other clients from adding |
apr_status_t apr_redis_disable_server | ( | apr_redis_t * | rc, |
apr_redis_server_t * | rs | ||
) |
Disable a Server
rc | The redis client object to use |
rs | Server to Disable |
apr_status_t apr_redis_enable_server | ( | apr_redis_t * | rc, |
apr_redis_server_t * | rs | ||
) |
Enables a Server for use again
rc | The redis client object to use |
rs | Server to Activate |
apr_redis_server_t* apr_redis_find_server | ( | apr_redis_t * | rc, |
const char * | host, | ||
apr_port_t | port | ||
) |
Finds a Server object based on a hostname/port pair
rc | The redis client object to use |
host | Hostname of the server |
port | Port of the server |
apr_redis_server_t* apr_redis_find_server_hash | ( | apr_redis_t * | rc, |
const apr_uint32_t | hash | ||
) |
Picks a server based on a hash
rc | The redis client object to use |
hash | Hashed value of a Key |
apr_redis_server_t* apr_redis_find_server_hash_default | ( | void * | baton, |
apr_redis_t * | rc, | ||
const apr_uint32_t | hash | ||
) |
server selection compatible with the standard Perl Client.
apr_status_t apr_redis_getp | ( | apr_redis_t * | rc, |
apr_pool_t * | p, | ||
const char * | key, | ||
char ** | baton, | ||
apr_size_t * | len, | ||
apr_uint16_t * | flags | ||
) |
Gets a value from the server, allocating the value out of p
rc | client to use |
p | Pool to use |
key | null terminated string containing the key |
baton | location of the allocated value |
len | length of data at baton |
flags | any flags set by the client for this key |
apr_uint32_t apr_redis_hash | ( | apr_redis_t * | rc, |
const char * | data, | ||
const apr_size_t | data_len | ||
) |
Creates a crc32 hash used to split keys between servers
rc | The redis client object to use |
data | Data to be hashed |
data_len | Length of the data to use |
apr_uint32_t apr_redis_hash_crc32 | ( | void * | baton, |
const char * | data, | ||
const apr_size_t | data_len | ||
) |
Pure CRC32 Hash. Used by some clients.
apr_uint32_t apr_redis_hash_default | ( | void * | baton, |
const char * | data, | ||
const apr_size_t | data_len | ||
) |
hash compatible with the standard Perl Client.
apr_status_t apr_redis_incr | ( | apr_redis_t * | rc, |
const char * | key, | ||
apr_int32_t | inc, | ||
apr_uint32_t * | new_value | ||
) |
Increments a value
rc | client to use |
key | null terminated string containing the key |
inc | number to increment by |
new_value | new value after incrementing |
apr_status_t apr_redis_info | ( | apr_redis_server_t * | rs, |
apr_pool_t * | p, | ||
char ** | baton | ||
) |
Query a server's INFO
rs | server to query |
p | Pool to allocate answer from |
baton | location to store server INFO response string |
apr_status_t apr_redis_multgetp | ( | apr_redis_t * | rc, |
apr_pool_t * | temp_pool, | ||
apr_pool_t * | data_pool, | ||
apr_hash_t * | values | ||
) |
Gets multiple values from the server, allocating the values out of p
rc | client to use |
temp_pool | Pool used for temporary allocations. May be cleared inside this call. |
data_pool | Pool used to allocate data for the returned values. |
values | hash of apr_redis_value_t keyed by strings, contains the result of the multiget call. |
apr_status_t apr_redis_ping | ( | apr_redis_server_t * | rs | ) |
Pings the server
rs | Server to ping |
apr_status_t apr_redis_server_create | ( | apr_pool_t * | p, |
const char * | host, | ||
apr_port_t | port, | ||
apr_uint32_t | min, | ||
apr_uint32_t | smax, | ||
apr_uint32_t | max, | ||
apr_uint32_t | ttl, | ||
apr_uint32_t | rwto, | ||
apr_redis_server_t ** | ns | ||
) |
Creates a new Server Object
p | Pool to use |
host | hostname of the server |
port | port of the server |
min | minimum number of client sockets to open |
smax | soft maximum number of client connections to open |
max | hard maximum number of client connections |
ttl | time to live in microseconds of a client connection |
rwto | r/w timeout value in seconds of a client connection |
ns | location of the new server object |
apr_status_t apr_redis_set | ( | apr_redis_t * | rc, |
const char * | key, | ||
char * | baton, | ||
const apr_size_t | data_size, | ||
apr_uint16_t | flags | ||
) |
Sets a value by key on the server
rc | client to use |
key | null terminated string containing the key |
baton | data to store on the server |
data_size | length of data at baton |
flags | any flags set by the client for this key |
apr_status_t apr_redis_setex | ( | apr_redis_t * | rc, |
const char * | key, | ||
char * | baton, | ||
const apr_size_t | data_size, | ||
apr_uint32_t | timeout, | ||
apr_uint16_t | flags | ||
) |
Sets a value by key on the server
rc | client to use |
key | null terminated string containing the key |
baton | data to store on the server |
data_size | length of data at baton |
timeout | time in seconds for the data to live on the server |
flags | any flags set by the client for this key |
apr_status_t apr_redis_stats | ( | apr_redis_server_t * | rs, |
apr_pool_t * | p, | ||
apr_redis_stats_t ** | stats | ||
) |
Query a server for statistics
rs | server to query |
p | Pool to allocate answer from |
stats | location of the new statistics structure |
apr_status_t apr_redis_version | ( | apr_redis_server_t * | rs, |
apr_pool_t * | p, | ||
char ** | baton | ||
) |
Query a server's version
rs | server to query |
p | Pool to allocate answer from |
baton | location to store server version string |