memcached.h | memcached.h | |||
---|---|---|---|---|
skipping to change at line 36 | skipping to change at line 36 | |||
#include <libmemcached/memcached_server.h> | #include <libmemcached/memcached_server.h> | |||
#include <libmemcached/memcached_string.h> | #include <libmemcached/memcached_string.h> | |||
#include <libmemcached/memcached_result.h> | #include <libmemcached/memcached_result.h> | |||
#include <libmemcached/memcached_storage.h> | #include <libmemcached/memcached_storage.h> | |||
#ifdef __cplusplus | #ifdef __cplusplus | |||
extern "C" { | extern "C" { | |||
#endif | #endif | |||
#define MEMCACHED_VERSION_STRING_LENGTH 24 | #define MEMCACHED_VERSION_STRING_LENGTH 24 | |||
#define LIBMEMCACHED_VERSION_STRING "0.33" | #define LIBMEMCACHED_VERSION_STRING "0.34" | |||
struct memcached_analysis_st { | struct memcached_analysis_st { | |||
uint32_t average_item_size; | uint32_t average_item_size; | |||
uint32_t longest_uptime; | uint32_t longest_uptime; | |||
uint32_t least_free_server; | uint32_t least_free_server; | |||
uint32_t most_consumed_server; | uint32_t most_consumed_server; | |||
uint32_t oldest_server; | uint32_t oldest_server; | |||
double pool_hit_ratio; | double pool_hit_ratio; | |||
uint64_t most_used_bytes; | uint64_t most_used_bytes; | |||
uint64_t least_remaining_bytes; | uint64_t least_remaining_bytes; | |||
skipping to change at line 83 | skipping to change at line 83 | |||
char version[MEMCACHED_VERSION_STRING_LENGTH]; | char version[MEMCACHED_VERSION_STRING_LENGTH]; | |||
}; | }; | |||
struct memcached_st { | struct memcached_st { | |||
uint8_t purging; | uint8_t purging; | |||
bool is_allocated; | bool is_allocated; | |||
uint8_t distribution; | uint8_t distribution; | |||
uint8_t hash; | uint8_t hash; | |||
uint32_t continuum_points_counter; | uint32_t continuum_points_counter; | |||
memcached_server_st *hosts; | memcached_server_st *hosts; | |||
memcached_server_st *last_disconnected_server; | ||||
int32_t snd_timeout; | int32_t snd_timeout; | |||
int32_t rcv_timeout; | int32_t rcv_timeout; | |||
uint32_t server_failure_limit; | uint32_t server_failure_limit; | |||
uint32_t io_msg_watermark; | uint32_t io_msg_watermark; | |||
uint32_t io_bytes_watermark; | uint32_t io_bytes_watermark; | |||
uint32_t io_key_prefetch; | uint32_t io_key_prefetch; | |||
uint32_t number_of_hosts; | uint32_t number_of_hosts; | |||
uint32_t cursor_server; | uint32_t cursor_server; | |||
int cached_errno; | int cached_errno; | |||
uint32_t flags; | uint32_t flags; | |||
End of changes. 2 change blocks. | ||||
1 lines changed or deleted | 2 lines changed or added | |||
memcached.hpp | memcached.hpp | |||
---|---|---|---|---|
skipping to change at line 167 | skipping to change at line 167 | |||
/** | /** | |||
* Set the list of memcached servers to use. | * Set the list of memcached servers to use. | |||
* | * | |||
* @param[in] in_servers_list list of servers | * @param[in] in_servers_list list of servers | |||
* @return true on success; false otherwise | * @return true on success; false otherwise | |||
*/ | */ | |||
bool setServers(const std::string &in_servers_list) | bool setServers(const std::string &in_servers_list) | |||
{ | { | |||
servers_list.assign(in_servers_list); | servers_list.assign(in_servers_list); | |||
servers= memcached_servers_parse(in_servers_list.c_str()); | servers= memcached_servers_parse(in_servers_list.c_str()); | |||
memcached_server_push(&memc, servers); | ||||
return (servers == NULL); | return (servers == NULL); | |||
} | } | |||
/** | /** | |||
* Add a server to the list of memcached servers to use. | * Add a server to the list of memcached servers to use. | |||
* | * | |||
* @param[in] server_name name of the server to add | * @param[in] server_name name of the server to add | |||
* @param[in[ port port number of server to add | * @param[in] port port number of server to add | |||
* @return true on success; false otherwise | * @return true on success; false otherwise | |||
*/ | */ | |||
bool addServer(const std::string &server_name, unsigned int port) | bool addServer(const std::string &server_name, unsigned int port) | |||
{ | { | |||
memcached_return rc; | memcached_return rc; | |||
std::ostringstream strstm; | std::ostringstream strstm; | |||
servers_list.append(","); | servers_list.append(","); | |||
servers_list.append(server_name); | servers_list.append(server_name); | |||
servers_list.append(":"); | servers_list.append(":"); | |||
strstm << port; | strstm << port; | |||
servers_list.append(strstm.str()); | servers_list.append(strstm.str()); | |||
servers= memcached_server_list_append(servers, | servers= memcached_server_list_append(servers, | |||
server_name.c_str(), | server_name.c_str(), | |||
port, | port, | |||
&rc); | &rc); | |||
memcached_server_push(&memc, servers); | ||||
return (rc == MEMCACHED_SUCCESS); | ||||
} | ||||
/** | ||||
* Remove a server from the list of memcached servers to use. | ||||
* | ||||
* @param[in] server_name name of the server to remove | ||||
* @param[in] port port number of server to remove | ||||
* @return true on success; false otherwise | ||||
*/ | ||||
bool removeServer(const std::string &server_name, size_t port) | ||||
{ | ||||
std::string tmp_str; | ||||
std::ostringstream strstm; | ||||
tmp_str.append(","); | ||||
tmp_str.append(server_name); | ||||
tmp_str.append(":"); | ||||
strstm << port; | ||||
tmp_str.append(strstm.str()); | ||||
memcached_server_st *server= memcached_servers_parse(tmp_str.c_str()); | ||||
memcached_return rc= memcached_server_remove(server); | ||||
return (rc == MEMCACHED_SUCCESS); | return (rc == MEMCACHED_SUCCESS); | |||
} | } | |||
/** | /** | |||
* Fetches an individual value from the server. mget() must always | * Fetches an individual value from the server. mget() must always | |||
* be called before using this method. | * be called before using this method. | |||
* | * | |||
* @param[in] key key of object to fetch | * @param[in] key key of object to fetch | |||
* @param[out] ret_val store returned object in this vector | * @param[out] ret_val store returned object in this vector | |||
* @return a memcached return structure | * @return a memcached return structure | |||
End of changes. 3 change blocks. | ||||
1 lines changed or deleted | 24 lines changed or added | |||
memcached_pool.h | memcached_pool.h | |||
---|---|---|---|---|
skipping to change at line 34 | skipping to change at line 34 | |||
LIBMEMCACHED_API | LIBMEMCACHED_API | |||
memcached_st* memcached_pool_destroy(memcached_pool_st* pool); | memcached_st* memcached_pool_destroy(memcached_pool_st* pool); | |||
LIBMEMCACHED_API | LIBMEMCACHED_API | |||
memcached_st* memcached_pool_pop(memcached_pool_st* pool, | memcached_st* memcached_pool_pop(memcached_pool_st* pool, | |||
bool block, | bool block, | |||
memcached_return* rc); | memcached_return* rc); | |||
LIBMEMCACHED_API | LIBMEMCACHED_API | |||
memcached_return memcached_pool_push(memcached_pool_st* pool, | memcached_return memcached_pool_push(memcached_pool_st* pool, | |||
memcached_st* mmc); | memcached_st* mmc); | |||
LIBMEMCACHED_API | ||||
memcached_return memcached_pool_behavior_set(memcached_pool_st *ptr, memcac | ||||
hed_behavior flag, uint64_t data); | ||||
LIBMEMCACHED_API | ||||
memcached_return memcached_pool_behavior_get(memcached_pool_st *ptr, memcac | ||||
hed_behavior flag, uint64_t *value); | ||||
#ifdef __cplusplus | #ifdef __cplusplus | |||
} | } | |||
#endif | #endif | |||
#endif /* MEMCACHED_POOL_H */ | #endif /* MEMCACHED_POOL_H */ | |||
End of changes. 1 change blocks. | ||||
0 lines changed or deleted | 7 lines changed or added | |||
memcached_server.h | memcached_server.h | |||
---|---|---|---|---|
skipping to change at line 89 | skipping to change at line 89 | |||
void memcached_server_free(memcached_server_st *ptr); | void memcached_server_free(memcached_server_st *ptr); | |||
LIBMEMCACHED_API | LIBMEMCACHED_API | |||
memcached_server_st *memcached_server_clone(memcached_server_st *clone, mem cached_server_st *ptr); | memcached_server_st *memcached_server_clone(memcached_server_st *clone, mem cached_server_st *ptr); | |||
LIBMEMCACHED_API | LIBMEMCACHED_API | |||
memcached_analysis_st *memcached_analyze(memcached_st *memc, memcached_stat _st *memc_stat, | memcached_analysis_st *memcached_analyze(memcached_st *memc, memcached_stat _st *memc_stat, | |||
memcached_return *error); | memcached_return *error); | |||
LIBMEMCACHED_API | LIBMEMCACHED_API | |||
memcached_return memcached_server_remove(memcached_server_st *st_ptr); | memcached_return memcached_server_remove(memcached_server_st *st_ptr); | |||
LIBMEMCACHED_API | ||||
memcached_server_st *memcached_server_get_last_disconnect(memcached_st *ptr | ||||
); | ||||
#ifdef __cplusplus | #ifdef __cplusplus | |||
} | } | |||
#endif | #endif | |||
#endif /* __MEMCACHED_SERVER_H__ */ | #endif /* __MEMCACHED_SERVER_H__ */ | |||
End of changes. 1 change blocks. | ||||
0 lines changed or deleted | 4 lines changed or added | |||