📄 apr_memcache.h
字号:
/** * Creates a new memcached client object * @param p Pool to use * @param max_servers maximum number of servers * @param flags Not currently used * @param mc location of the new memcache client object */APU_DECLARE(apr_status_t) apr_memcache_create(apr_pool_t *p, apr_uint16_t max_servers, apr_uint32_t flags, apr_memcache_t **mc);/** * Gets a value from the server, allocating the value out of p * @param mc client to use * @param p Pool to use * @param key null terminated string containing the key * @param baton location of the allocated value * @param len length of data at baton * @param flags any flags set by the client for this key * @return */APU_DECLARE(apr_status_t) apr_memcache_getp(apr_memcache_t *mc, apr_pool_t *p, const char* key, char **baton, apr_size_t *len, apr_uint16_t *flags);/** * Add a key to a hash for a multiget query * if the hash (*value) is NULL it will be created * @param data_pool pool from where the hash and their items are created from * @param key null terminated string containing the key * @param values hash of keys and values that this key will be added to * @return */APU_DECLARE(void) apr_memcache_add_multget_key(apr_pool_t *data_pool, const char* key, apr_hash_t **values);/** * Gets multiple values from the server, allocating the values out of p * @param mc client to use * @param temp_pool Pool used for tempoary allocations. May be cleared inside this * call. * @param data_pool Pool used to allocate data for the returned values. * @param values hash of apr_memcache_value_t keyed by strings, contains the * result of the multiget call. * @return */APU_DECLARE(apr_status_t)apr_memcache_multgetp(apr_memcache_t *mc, apr_pool_t *temp_pool, apr_pool_t *data_pool, apr_hash_t *values);/** * Sets a value by key on the server * @param mc client to use * @param key null terminated string containing the key * @param baton data to store on the server * @param len length of data at baton * @param timeout time in seconds for the data to live on the server * @param flags any flags set by the client for this key */APU_DECLARE(apr_status_t) apr_memcache_set(apr_memcache_t *mc, const char *key, char *baton, const apr_size_t data_size, apr_uint32_t timeout, apr_uint16_t flags);/** * Adds value by key on the server * @param mc client to use * @param key null terminated string containing the key * @param baton data to store on the server * @param len length of data at baton * @param timeout time for the data to live on the server * @param flags any flags set by the client for this key * @return APR_SUCCESS if the key was added, APR_EEXIST if the key * already exists on the server. */APU_DECLARE(apr_status_t) apr_memcache_add(apr_memcache_t *mc, const char *key, char *baton, const apr_size_t data_size, apr_uint32_t timeout, apr_uint16_t flags);/** * Replaces value by key on the server * @param mc client to use * @param key null terminated string containing the key * @param baton data to store on the server * @param len length of data at baton * @param timeout time for the data to live on the server * @param flags any flags set by the client for this key * @return APR_SUCCESS if the key was added, APR_EEXIST if the key * did not exist on the server. */APU_DECLARE(apr_status_t) apr_memcache_replace(apr_memcache_t *mc, const char *key, char *data, const apr_size_t data_size, apr_uint32_t timeout, apr_uint16_t flags);/** * Deletes a key from a server * @param mc client to use * @param key null terminated string containing the key * @param timeout time for the delete to stop other clients from adding */APU_DECLARE(apr_status_t) apr_memcache_delete(apr_memcache_t *mc, const char *key, apr_uint32_t timeout);/** * Increments a value * @param mc client to use * @param key null terminated string containing the key * @param n number to increment by * @param nv new value after incrmenting */APU_DECLARE(apr_status_t) apr_memcache_incr(apr_memcache_t *mc, const char *key, apr_int32_t n, apr_uint32_t *nv);/** * Decrements a value * @param mc client to use * @param key null terminated string containing the key * @param n number to decrement by * @param nv new value after decrementing */APU_DECLARE(apr_status_t) apr_memcache_decr(apr_memcache_t *mc, const char *key, apr_int32_t n, apr_uint32_t *new_value);/** * Query a server's version * @param ms server to query * @param p Pool to allocate answer from * @param baton location to store server version string * @param len length of the server version string */APU_DECLARE(apr_status_t) apr_memcache_version(apr_memcache_server_t *ms, apr_pool_t *p, char **baton);typedef struct{ /** Version string of this server */ const char *version; /** Process id of this server process */ apr_uint32_t pid; /** Number of seconds this server has been running */ apr_uint32_t uptime; /** current UNIX time according to the server */ apr_time_t time; /** The size of a pointer on the current machine */ apr_uint32_t pointer_size; /** Accumulated user time for this process */ apr_time_t rusage_user; /** Accumulated system time for this process */ apr_time_t rusage_system; /** Current number of items stored by the server */ apr_uint32_t curr_items; /** Total number of items stored by this server */ apr_uint32_t total_items; /** Current number of bytes used by this server to store items */ apr_uint64_t bytes; /** Number of open connections */ apr_uint32_t curr_connections; /** Total number of connections opened since the server started running */ apr_uint32_t total_connections; /** Number of connection structures allocated by the server */ apr_uint32_t connection_structures; /** Cumulative number of retrieval requests */ apr_uint32_t cmd_get; /** Cumulative number of storage requests */ apr_uint32_t cmd_set; /** Number of keys that have been requested and found present */ apr_uint32_t get_hits; /** Number of items that have been requested and not found */ apr_uint32_t get_misses; /** Number of items removed from cache because they passed their expiration time */ apr_uint64_t evictions; /** Total number of bytes read by this server */ apr_uint64_t bytes_read; /** Total number of bytes sent by this server */ apr_uint64_t bytes_written; /** Number of bytes this server is allowed to use for storage. */ apr_uint32_t limit_maxbytes; /** Number of threads the server is running (if built with threading) */ apr_uint32_t threads; } apr_memcache_stats_t;/** * Query a server for statistics * @param ms server to query * @param p Pool to allocate answer from * @param stats location of the new statistics structure */APU_DECLARE(apr_status_t) apr_memcache_stats(apr_memcache_server_t *ms, apr_pool_t *p, apr_memcache_stats_t **stats);/** @} */#ifdef __cplusplus}#endif#endif /* APR_MEMCACHE_H */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -