From: Michael Wallner Date: Fri, 28 Feb 2020 19:19:39 +0000 (+0100) Subject: update docs X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=c6fde8b6a27b6af31f0cf26a9cdccd54cd25734a;p=awesomized%2Flibmemcached update docs --- diff --git a/genindex.html b/genindex.html index ef6a634e..613254c2 100644 --- a/genindex.html +++ b/genindex.html @@ -329,13 +329,6 @@
  • hashkit_get_function (C++ function)
  • -
  • - hashkit_hash_fn - -
  • hashkit_hash_fn (C++ type)
  • @@ -360,13 +353,6 @@
  • hashkit_set_function (C++ function)
  • -
  • - hashkit_st - -
  • hashkit_st (C++ type)
  • hashkit_value (C++ function) @@ -404,13 +390,6 @@
  • memcached_add_by_key (C++ function)
  • -
  • - memcached_analysis_st - -
  • memcached_analysis_st (C++ type)
  • memcached_analyze (C++ function) @@ -423,10 +402,10 @@
  • memcached_behavior_set (C++ function)
  • -
  • memcached_behavior_t (C type) +
  • memcached_behavior_t (C++ enum)
  • memcached_behavior_t::MEMCACHED_BEHAVIOR_AUTO_EJECT_HOSTS (C++ enumerator) @@ -505,10 +484,10 @@
  • memcached_callback_set (C++ function)
  • -
  • memcached_callback_t (C type) +
  • memcached_callback_t (C++ enum)
  • memcached_callback_t::MEMCACHED_CALLBACK_CLEANUP_FUNCTION (C++ enumerator) @@ -578,6 +557,8 @@
  • memcached_exist (C++ function)
  • memcached_exist_by_key (C++ function) +
  • +
  • MEMCACHED_EXPIRATION_NOT_ADD (C macro)
  • memcached_failed (C++ function)
  • @@ -901,7 +882,7 @@ memcached_st
  • memcached_st (C++ type) @@ -1065,13 +1046,7 @@ object
  • diff --git a/index.html b/index.html index 97362a7d..1aea79d0 100644 --- a/index.html +++ b/index.html @@ -174,9 +174,6 @@

    libmemcached is an open source C/C++ client library and tools for the memcached server (http://memcached.org/). It has been designed to be light on memory usage, thread safe, and provide full access to server side methods.

    -

    libmemcached

    @@ -209,7 +206,7 @@ memory usage, thread safe, and provide full access to server side methods.

  • Advanced Topics
  • +
    +

    Index¶

    +

    Index

    +
    diff --git a/libhashkit/hashkit_create.html b/libhashkit/hashkit_create.html index ec4507a4..c52a3e69 100644 --- a/libhashkit/hashkit_create.html +++ b/libhashkit/hashkit_create.html @@ -180,7 +180,6 @@

    Creating a hashkit structure¶

    -

    Create, copy and free a hashkit structure

    SYNOPSIS¶

    @@ -215,25 +214,24 @@

    DESCRIPTION¶

    -

    The hashkit_create() function initializes a hashkit object for use. If -you pass a NULL argument for hash, then the memory for the object is -allocated. If you specify a pre-allocated piece of memory, that is -initialized for use.

    -

    The hashkit_clone() function initializes a hashkit object much like -hashkit_create(), but instead of using default settings it will use -the settings of the ptr hashkit object.

    -

    The hashkit_free() frees any resources being consumed by the hashkit -objects that were initialized with hashkit_create() or hashkit_clone().

    -

    The hashkit_is_allocated() reports where the memory was allocated -for a hashkit object.

    +

    The hashkit_create() function initializes a hashkit object for use. If you pass +a NULL argument for hash, then the memory for the object is allocated. If you +specify a pre-allocated piece of memory, that is initialized for use.

    +

    The hashkit_clone() function initializes a hashkit object much like +hashkit_create(), but instead of using default settings it will use the settings +of the ptr hashkit object.

    +

    The hashkit_free() frees any resources being consumed by the hashkit objects +that were initialized with hashkit_create() or hashkit_clone().

    +

    The hashkit_is_allocated() reports where the memory was allocated for a hashkit +object.

    RETURN VALUE¶

    -

    hashkit_create() and hashkit_clone() will return NULL on -failure or non-NULL on success.

    -

    hashkit_is_allocated() returns true if the memory for the hashkit -object was allocated inside of hashkit_create() or -hashkit_clone(), otherwise it is false and was user-supplied memory.

    +

    hashkit_create() and hashkit_clone() will return NULL on failure or non-NULL on +success.

    +

    hashkit_is_allocated() returns true if the memory for the hashkit object was +allocated inside of hashkit_create() or hashkit_clone(), otherwise it is false +and was user-supplied memory.

    SEE ALSO¶

    diff --git a/libhashkit/hashkit_function.html b/libhashkit/hashkit_function.html index 359eae47..3f280cf2 100644 --- a/libhashkit/hashkit_function.html +++ b/libhashkit/hashkit_function.html @@ -180,7 +180,6 @@

    Set Hash Function¶

    -

    Set hash functions to use for calculating values for keys

    SYNOPSIS¶

    @@ -229,10 +228,10 @@

    RETURN VALUE¶

    -

    hashkit_set_function(), hashkit_set_custom_function() and the distribution equivalents -return hashkit_return_t HASHKIT_SUCCESS on success.

    -

    hashkit_get_function() and hashkit_get_distribution_function() return hashkit_hash_algorithm_t -indicating the hash function used.

    +

    hashkit_set_function(), hashkit_set_custom_function() and the distribution +equivalents return hashkit_return_t HASHKIT_SUCCESS on success.

    +

    hashkit_get_function() and hashkit_get_distribution_function() return +hashkit_hash_algorithm_t indicating the hash function used.

    SEE ALSO¶

    diff --git a/libhashkit/hashkit_functions.html b/libhashkit/hashkit_functions.html index b7ff2bcf..83574e84 100644 --- a/libhashkit/hashkit_functions.html +++ b/libhashkit/hashkit_functions.html @@ -180,7 +180,6 @@

    Available Hashes¶

    -

    Various hash functions to use for calculating hash values for keys

    SYNOPSIS¶

    diff --git a/libhashkit/hashkit_value.html b/libhashkit/hashkit_value.html index 96d4db70..a48bd815 100644 --- a/libhashkit/hashkit_value.html +++ b/libhashkit/hashkit_value.html @@ -180,7 +180,6 @@

    Generate hash value¶

    -

    Generate a value for the given key

    SYNOPSIS¶

    @@ -195,10 +194,10 @@

    DESCRIPTION¶

    -

    The hashkit_value() function generates a 32-bit hash value from the -given key and key_length. The hash argument is an initialized hashkit -object, and distribution type and hash function is used from this -object while generating the value.

    +

    The hashkit_value() function generates a 32-bit hash value from the given key +and key_length. The hash argument is an initialized hashkit object, and +distribution type and hash function is used from this object while generating +the value.

    RETURN VALUE¶

    diff --git a/libmemcached.html b/libmemcached.html index f5dc67a4..4474cd0e 100644 --- a/libmemcached.html +++ b/libmemcached.html @@ -196,26 +196,24 @@ Memcached. Some of the features provided:

    DESCRIPTION¶

    -

    “Memcached is a high-performance, distributed memory object caching -system, generic in nature, but intended for use in speeding up dynamic web -applications by alleviating database load.” -http://memcached.org/

    -

    libmemcached is a small, thread-safe client library for the -memcached protocol. The code has all been written to allow -for both web and embedded usage. It handles the work behind routing -individual keys to specific servers specified by the developer (and values are -matched based on server order as supplied by the user). It implements -a modular and consistent method of object distribution.

    +

    “Memcached is a high-performance, distributed memory object caching system, +generic in nature, but intended for use in speeding up dynamic web applications +by alleviating database load.” http://memcached.org/

    +

    libmemcached is a small, thread-safe client library for the memcached +protocol. The code has all been written to allow for both web and embedded +usage. It handles the work behind routing individual keys to specific servers +specified by the developer (and values are matched based on server order as +supplied by the user). It implements a modular and consistent method of object +distribution.

    There are multiple implemented routing and hashing methods. See the -memcached_behavior_set() manpage for more information.

    -

    All operations are performed against a memcached_st structure. -These structures can either be dynamically allocated or statically -allocated and then initialized by memcached_create(). Functions have -been written in order to encapsulate the memcached_st. It is not -recommended that you operate directly against the structure.

    -

    Nearly all functions return a memcached_return_t value. -This value can be translated to a printable string with -memcached_strerror.

    +memcached_behavior_set() manpage for more information.

    +

    All operations are performed against a memcached_st structure. These +structures can either be dynamically allocated or statically allocated and then +initialized by memcached_create(). Functions have been written in order to +encapsulate the memcached_st. It is not recommended that you operate directly +against the structure.

    +

    Nearly all functions return a memcached_return_t value. This value can be +translated to a printable string with memcached_strerror().

    Objects are stored on servers by hashing keys. The hash value maps the key to a particular server. All clients understand how this hashing works, so it is possibly to reliably both push data to a server and retrieve data from a server.

    @@ -224,20 +222,14 @@ possibly to reliably both push data to a server and retrieve data from a server. applications can use the same memcached servers.

    Some features of the library must be enabled through memcached_behavior_set().

    -
    -

    CONSTANTS¶

    -

    A number of constants have been provided for in the library.

    -

    See libmemcached Constants and Defaults.

    -

    THREADS AND PROCESSES¶

    No global variables are used in this library.

    -

    memcached_st structures are thread-safe, but when using threads or -forked processes it is important to keep one instance of memcached_st -per process or thread. Without creating your own locking structures you can not -share a single memcached_st. However, you can call -memcached_quit() on a memcached_st and then use the resulting -cloned structure.

    +

    memcached_st structures are thread-safe, but when using threads or forked +processes it is important to keep one instance of memcached_st per process or +thread. Without creating your own locking structures you can not share a single +memcached_st. However, you can call memcached_quit() on a memcached_st and +then use the resulting cloned structure.

    SYSTEMTAP¶

    diff --git a/libmemcached/configuration.html b/libmemcached/configuration.html index 098a25ce..115f183c 100644 --- a/libmemcached/configuration.html +++ b/libmemcached/configuration.html @@ -230,7 +230,7 @@ being used.

    --REMOVE_FAILED_SERVERS
    -

    Enable the behavior MEMCACHED_BEHAVIOR_REMOVE_FAILED_SERVERS.

    +

    Enable the behavior MEMCACHED_BEHAVIOR_REMOVE_FAILED_SERVERS.

    @@ -242,7 +242,7 @@ being used.

    --BUFFER-REQUESTS
    -

    Please see MEMCACHED_BEHAVIOR_BUFFER_REQUESTS.

    +

    Please see MEMCACHED_BEHAVIOR_BUFFER_REQUESTS.

    @@ -256,7 +256,7 @@ on information only contained in the file.

    --CONNECT-TIMEOUT=
    -

    See memcached_behavior_set() for MEMCACHED_BEHAVIOR_CONNECT_TIMEOUT.

    +

    See memcached_behavior_set() for MEMCACHED_BEHAVIOR_CONNECT_TIMEOUT.

    @@ -308,13 +308,13 @@ naming order.

    --SUPPORT-CAS
    -

    See memcached_behavior_set() for MEMCACHED_BEHAVIOR_SUPPORT_CAS

    +

    See memcached_behavior_set() for MEMCACHED_BEHAVIOR_SUPPORT_CAS

    --USE-UDP
    -

    See memcached_behavior_set() for MEMCACHED_BEHAVIOR_USE_UDP

    +

    See memcached_behavior_set() for MEMCACHED_BEHAVIOR_USE_UDP

    @@ -346,7 +346,7 @@ accomplished by prepending the namespace value to all keys.

    --TCP-NODELAY
    -

    See memcached_behavior_set() for MEMCACHED_BEHAVIOR_TCP_NODELAY

    +

    See memcached_behavior_set() for MEMCACHED_BEHAVIOR_TCP_NODELAY

    @@ -358,31 +358,31 @@ accomplished by prepending the namespace value to all keys.

    --RETRY-TIMEOUT=
    -

    See memcached_behavior_set() for MEMCACHED_BEHAVIOR_RETRY_TIMEOUT

    +

    See memcached_behavior_set() for MEMCACHED_BEHAVIOR_RETRY_TIMEOUT

    --SERVER-FAILURE-LIMIT=
    -

    See memcached_behavior_set() for MEMCACHED_BEHAVIOR_SERVER_FAILURE_LIMIT

    +

    See memcached_behavior_set() for MEMCACHED_BEHAVIOR_SERVER_FAILURE_LIMIT

    --SND-TIMEOUT=
    -

    See memcached_behavior_set() for MEMCACHED_BEHAVIOR_SND_TIMEOUT

    +

    See memcached_behavior_set() for MEMCACHED_BEHAVIOR_SND_TIMEOUT

    --SOCKET-RECV-SIZE=
    -

    See memcached_behavior_set() for MEMCACHED_BEHAVIOR_SOCKET_RECV_SIZE

    +

    See memcached_behavior_set() for MEMCACHED_BEHAVIOR_SOCKET_RECV_SIZE

    --SOCKET-SEND-SIZE=
    -

    See memcached_behavior_set() for MEMCACHED_BEHAVIOR_SOCKET_SEND_SIZE

    +

    See memcached_behavior_set() for MEMCACHED_BEHAVIOR_SOCKET_SEND_SIZE

    @@ -423,7 +423,7 @@ accomplished by prepending the namespace value to all keys.

    INCLUDE

    Include a file in configuration. -Unlike –CONFIGURE-FILE= this will not reset memcached_st.

    +Unlike --CONFIGURE-FILE= this will not reset memcached_st.

    @@ -456,8 +456,8 @@ Unlike –CONFIGURE-FILE= this will not reset

    RETURN VALUE¶

    -

    memcached() returns a pointer to the memcached_st that was -created (or initialized). On an allocation failure, it returns NULL.

    +

    memcached() returns a pointer to the memcached_st that was created (or +initialized). On an allocation failure, it returns NULL.

    EXAMPLE¶

    diff --git a/libmemcached/constants.html b/libmemcached/constants.html index 929a3736..dbc4f8c1 100644 --- a/libmemcached/constants.html +++ b/libmemcached/constants.html @@ -189,7 +189,7 @@
    LIBMEMCACHED_VERSION_STRING¶
    -

    String value of libmemcached version such as “1.23.4”

    +

    String value of libmemcached version such as “1.0.99”

    @@ -260,6 +260,12 @@ have no limit, this only applies to keys used for storage.

    How many extra slots we should build for in the continuum, defaults to 10.

    +
    +
    +MEMCACHED_EXPIRATION_NOT_ADD¶
    +

    Value 0xffffffffU

    +
    +
    MEMCACHED_STRIDE¶
    diff --git a/libmemcached/examples.html b/libmemcached/examples.html index e8cf0216..d02198b7 100644 --- a/libmemcached/examples.html +++ b/libmemcached/examples.html @@ -183,9 +183,8 @@

    Examples for libmemcached

    DESCRIPTION¶

    -

    For full examples, test cases are found in tests/*.c in the main -distribution. These are always up to date, and are used for each test run of -the library.

    +

    For full examples, test cases are found in tests/*.c in the main distribution. +These are always up to date, and are used for each test run of the library.

    Connecting to servers¶

    @@ -200,12 +199,15 @@ the library.

    memcached_free(memc);
    -

    In the above code you create a memcached_st object with three server -by making use of memcached_create().

    +

    In the above code you create a memcached_st object with three server by making +use of memcached_create().

    Creating a pool of servers¶

    -
    const char *config_string= "--SERVER=host10.example.com --SERVER=host11.example.com --SERVER=host10.example.com";
    +
    const char *config_string =
    +  "--SERVER=host10.example.com "
    +  "--SERVER=host11.example.com "
    +  "--SERVER=host10.example.com";
     
     memcached_pool_st* pool= memcached_pool(config_string, strlen(config_string));
     
    @@ -226,9 +228,9 @@ by making use of memcached_pool_destroy(pool);
     
    -

    In the above code you create a memcached_pool_st object with three -server by making use of memcached_pool().

    -

    When memcached_pool_destroy() all memory will be released that is associated +

    In the above code you create a memcached_pool_st object with three server by +making use of memcached_pool().

    +

    When memcached_pool_destroy() all memory will be released that is associated with the pool.

    diff --git a/libmemcached/index.html b/libmemcached/index.html index b930df21..d0dcf722 100644 --- a/libmemcached/index.html +++ b/libmemcached/index.html @@ -201,7 +201,7 @@
  • memcached_touch, memcached_touch_by_key
  • Flushing client buffers
  • Working with result sets
  • -
  • Appending or Prepending to data on the server
  • +
  • Appending or Prepending Data
  • Working with data on the server in an atomic fashion
  • @@ -224,7 +224,7 @@
  • Advanced Topics
  • diff --git a/libmemcached/memcached_analyze.html b/libmemcached/memcached_analyze.html index 07f744ce..af71e6fc 100644 --- a/libmemcached/memcached_analyze.html +++ b/libmemcached/memcached_analyze.html @@ -196,18 +196,16 @@

    Analyzing servers¶

    -

    Analyze server information

    SYNOPSIS¶

    -
    +
    #include <libmemcached/memcached.h>

    Compile and link with -lmemcached

    -type memcached_analysis_st¶
    -

    typedef struct memcached_analysis_st memcached_analysis_st;

    -
    +typedef struct memcached_analysis_st memcached_analysis_st¶
    +
    @@ -217,22 +215,26 @@

    DESCRIPTION¶

    -

    libmemcached has the ability to query a memcached server (or -collection of servers) for their current state. Queries to find state return a -memcached_analysis_st structure. You are responsible for freeing this structure.

    -

    memcached_analyze() analyzes useful information based on the -provided servers and sets the result to the memcached_analysis_st -structure. The return value must be freed by the calling application.

    -

    A command line tool, memstat with the option memstat --analyze, -is provided so that you do not have to write an application to use this method.

    +

    libmemcached has the ability to query a memcached server (or collection of +servers) for their current state. Queries to find state return a +memcached_analysis_st structure. You are responsible for freeing this +structure.

    +

    memcached_analyze() analyzes useful information based on the provided servers +and sets the result to the memcached_analysis_st structure. The return value +must be freed by the calling application.

    +
    +

    See also

    +

    memstat --analyze +A command line tool to analyze a memcached server.

    +
    -
    -

    RETURN¶

    -

    A pointer to the allocated memcached_analysis_st structure on -success and a NULL pointer on failure. You may inspect the error detail by -checking the memcached_return_t value.

    -

    Any method returning a memcached_analysis_st expects you to free the -memory allocated for it.

    +
    +

    RETURN VALUE¶

    +

    A pointer to the allocated memcached_analysis_st structure on success and a +NULL pointer on failure. You may inspect the error detail by checking the +memcached_return_t value.

    +

    Any method returning a memcached_analysis_st expects you to free the memory +allocated for it.

    SEE ALSO¶

    diff --git a/libmemcached/memcached_append.html b/libmemcached/memcached_append.html index 6ec8a789..dc26fe56 100644 --- a/libmemcached/memcached_append.html +++ b/libmemcached/memcached_append.html @@ -8,7 +8,7 @@ - Appending or Prepending to data on the server — libmemcached 1.0.99 documentation + Appending or Prepending Data — libmemcached 1.0.99 documentation @@ -96,7 +96,7 @@
  • memcached_touch, memcached_touch_by_key
  • Flushing client buffers
  • Working with result sets
  • -
  • Appending or Prepending to data on the server
  • +
  • Appending or Prepending Data
  • Working with data on the server in an atomic fashion
  • @@ -173,7 +173,7 @@
  • Working with Data »
  • -
  • Appending or Prepending to data on the server
  • +
  • Appending or Prepending Data
  • @@ -190,12 +190,14 @@
    -
    -

    Appending or Prepending to data on the server¶

    -

    Appending or Prepending to data on the server

    +
    +

    Appending or Prepending Data¶

    SYNOPSIS¶

    -

    #include <libmemcached/memcached.h>

    +
    +
    #include <libmemcached-1.0/memcached.h>

    Compile and link with -lmemcached

    +
    +
    memcached_return_t memcached_prepend(memcached_st *ptr, const char *key, size_t key_length, const char *value, size_t value_length, time_t expiration, uint32_t flags)¶
    @@ -216,58 +218,59 @@ memcached_return_t memcached_append_by_key(memcached_st *ptr, const char *group_key, size_t group_key_length, const char *key, size_t key_length, const char *value, size_t value_length, time_t expiration, uint32_t flags)¶
    -

    Compile and link with -lmemcached

    DESCRIPTION¶

    -

    memcached_prepend() and memcached_append are used to -modify information on a server. All methods take a key, and its length to -store the object. Keys are currently limited to 250 characters when using -either a version of memcached which is 1.4 or below, or when using the text -protocol. You must supply both a value and a length. Optionally you -may test an expiration time for the object and a 16 byte value (it is -meant to be used as a bitmap). “flags” is a 4byte space that is stored -alongside of the main value. Many sub libraries make use of this field, -so in most cases users should avoid making use of it.

    -

    memcached_prepend() places a segment of data before the last piece -of data stored. Currently expiration and key are not used in the server.

    -

    memcached_append() places a segment of data at the end of the last -piece of data stored. Currently expiration and key are not used in the server.

    -

    memcached_prepend_by_key() and -memcached_append_by_key() methods both behave in a similar -method as the non key methods. The difference is that they use their +

    memcached_prepend() and memcached_append are used to modify information on a +server. All methods take a key, and key_length to store the object. Keys +are currently limited to 250 characters when using either a version of memcached +which is 1.4 or below, or when using the text protocol. You must supply both a +value and a length. Optionally you may test an expiration time for the object +and a 16 byte value (it is meant to be used as a bitmap). flags is a 4byte +space that is stored alongside of the main value. Many sub libraries make use of +this field, so in most cases users should avoid making use of it.

    +

    memcached_prepend() places a segment of data before the last piece of data +stored. Currently expiration and key are not used in the server.

    +

    memcached_append() places a segment of data at the end of the last piece of data +stored. Currently expiration and key are not used in the server.

    +

    memcached_prepend_by_key() and memcached_append_by_key() methods both behave in +a similar method as the non key methods. The difference is that they use their group_key parameter to map objects to particular servers.

    -

    If you are looking for performance, memcached_set() with non-blocking -IO is the fastest way to store data on the server.

    -

    All of the above functions are tested with the -MEMCACHED_BEHAVIOR_USE_UDP behavior enabled. However, when using -these operations with this behavior on, there are limits to the size of the -payload being sent to the server. The reason for these limits is that the -Memcached Server does not allow multi-datagram requests -and the current server implementation sets a datagram size to 1400 bytes. Due -to protocol overhead, the actual limit of the user supplied data is less than -1400 bytes and depends on the protocol in use as, well as the operation being -executed. When running with the binary protocol, -MEMCACHED_BEHAVIOR_BINARY_PROTOCOL, the size of the key,value, -flags and expiry combined may not exceed 1368 bytes. When running with the -ASCII protocol, the exact limit fluctuates depending on which function is -being executed and whether the function is a cas operation or not. For -non-cas ASCII set operations, there are at least 1335 bytes available -to split among the key, key_prefix, and value; for cas ASCII operations -there are at least 1318 bytes available to split among the key, key_prefix -and value. If the total size of the command, including overhead, exceeds -1400 bytes, a MEMCACHED_WRITE_FAILURE will be returned.

    +

    If you are looking for performance, memcached_set() with non-blocking IO is the +fastest way to store data on the server.

    +

    All of the above functions are tested with the MEMCACHED_BEHAVIOR_USE_UDP +behavior enabled. However, when using these operations with this behavior on, +there are limits to the size of the payload being sent to the server. The +reason for these limits is that the Memcached Server does not allow +multi-datagram requests and the current server implementation sets a datagram +size to 1400 bytes. Due to protocol overhead, the actual limit of the user +supplied data is less than 1400 bytes and depends on the protocol in use as, +well as the operation being executed. When running with the binary protocol, +MEMCACHED_BEHAVIOR_BINARY_PROTOCOL, the size of the key,value, flags and +expiry combined may not exceed 1368 bytes. When running with the ASCII protocol, +the exact limit fluctuates depending on which function is being executed and +whether the function is a cas operation or not. For non-cas ASCII set +operations, there are at least 1335 bytes available to split among the key, +key_prefix, and value; for cas ASCII operations there are at least 1318 bytes +available to split among the key, key_prefix and value. If the total size of the +command, including overhead, exceeds 1400 bytes, a MEMCACHED_WRITE_FAILURE +will be returned.

    -
    -

    RETURN¶

    -

    All methods return a value of type memcached_return_t. -On success the value will be MEMCACHED_SUCCESS. -Use memcached_strerror() to translate this value to a printable -string.

    +
    +

    RETURN VALUE¶

    +

    All methods return a value of type memcached_return_t. On success the value +will be MEMCACHED_SUCCESS.

    +

    Use memcached_strerror() to translate this value to a printable string.

    diff --git a/libmemcached/memcached_auto.html b/libmemcached/memcached_auto.html index 93d52b73..99496b80 100644 --- a/libmemcached/memcached_auto.html +++ b/libmemcached/memcached_auto.html @@ -96,7 +96,7 @@
  • memcached_touch, memcached_touch_by_key
  • Flushing client buffers
  • Working with result sets
  • -
  • Appending or Prepending to data on the server
  • +
  • Appending or Prepending Data
  • Working with data on the server in an atomic fashion
  • @@ -193,8 +193,11 @@

    Incrementing and Decrementing Values¶

    -

    SYNOPSIS¶

    -

    #include <libmemcached/memcached.h>

    +

    SYNOPSIS¶

    +
    +
    #include <libmemcached/memcached.h>

    Compile and link with -lmemcached

    +
    +
    memcached_return_t memcached_increment(memcached_st *ptr, const char *key, size_t key_length, uint32_t offset, uint64_t *value)¶
    @@ -235,49 +238,54 @@ memcached_return_t memcached_decrement_with_initial_by_key(memcached_st *ptr, const char *group_key, size_t group_key_length, const char *key, size_t key_length, uint64_t offset, uint64_t initial, time_t expiration, uint64_t *value)¶
    -

    Compile and link with -lmemcached

    DESCRIPTION¶

    memcached(1) servers have the ability to increment and decrement keys (overflow and underflow are not detected). This gives you the ability to use memcached to generate shared sequences of values.

    -

    memcached_increment takes a key and key length and increments the value by -the offset passed to it. The value is then returned via the uint32_t -value pointer you pass to it.

    -

    memcached_decrement takes a key and keylength and decrements the value by -the offset passed to it. The value is then returned via the uint32_t -value pointer you pass to it.

    -

    memcached_increment_with_initial takes a key and keylength and increments -the value by the offset passed to it. If the object specified by key does -not exist, one of two things may happen: If the expiration value is -MEMCACHED_EXPIRATION_NOT_ADD, the operation will fail. For all other -expiration values, the operation will succeed by seeding the value for that -key with a initial value to expire with the provided expiration time. The -flags will be set to zero.The value is then returned via the uint32_t -value pointer you pass to it. memcached_increment_with_initial is only available -when using the binary protocol.

    -

    memcached_decrement_with_initial takes a key and keylength and decrements -the value by the offset passed to it. If the object specified by key does -not exist, one of two things may happen: If the expiration value is -MEMCACHED_EXPIRATION_NOT_ADD, the operation will fail. For all other -expiration values, the operation will succeed by seeding the value for that -key with a initial value to expire with the provided expiration time. The -flags will be set to zero.The value is then returned via the uint32_t -value pointer you pass to it. memcached_decrement_with_initial is only available -when using the binary protocol.

    -

    memcached_increment_by_key(), memcached_decrement_by_key(), -memcached_increment_with_initial_by_key(), and -memcached_decrement_with_initial_by_key() are master key equivalents of the above.

    +

    memcached_increment() takes a key and key_length and increments the +value by the offset passed to it. The value is then returned via the +uint32_t value pointer you pass to it.

    +

    memcached_decrement() takes a key and key_length and decrements the +value by the offset passed to it. The value is then returned via the +uint32_t value pointer you pass to it.

    +

    memcached_increment_with_initial() takes a key and key_length and +increments the value by the offset passed to it. If the object specified by +key does not exist, one of two things may happen: If the expiration +value is MEMCACHED_EXPIRATION_NOT_ADD, the operation will fail. For +all other expiration values, the operation will succeed by seeding the value +for that key with a initial value to expire with the provided expiration time. +The flags will be set to zero. The value is then returned via the uint32_t +value pointer you pass to it. memcached_increment_with_initial is only +available when using the binary protocol.

    +

    memcached_decrement_with_initial() takes a key and key_length and +decrements the value by the offset passed to it. If the object specified by +key does not exist, one of two things may happen: If the expiration +value is MEMCACHED_EXPIRATION_NOT_ADD, the operation will fail. For +all other expiration values, the operation will succeed by seeding the value +for that key with a initial value to expire with the provided expiration time. +The flags will be set to zero. The value is then returned via the uint32_t +value pointer you pass to it. memcached_decrement_with_initial() is only +available when using the binary protocol.

    +

    memcached_increment_by_key(), memcached_decrement_by_key(), +memcached_increment_with_initial_by_key(), and +memcached_decrement_with_initial_by_key() are master key equivalents of the +above.

    -
    -

    RETURN¶

    -

    A value of type memcached_return_t is returned. +

    +

    RETURN VALUE¶

    +

    A value of type memcached_return_t is returned. On success that value will be MEMCACHED_SUCCESS. -Use memcached_strerror to translate this value to a printable string.

    +Use memcached_strerror() to translate this value to a printable string.

    diff --git a/libmemcached/memcached_behavior.html b/libmemcached/memcached_behavior.html index f909c272..1b52f0a7 100644 --- a/libmemcached/memcached_behavior.html +++ b/libmemcached/memcached_behavior.html @@ -36,7 +36,7 @@ - + @@ -95,7 +95,7 @@
  • Advanced Topics
  • -
    -
    -typedef enum memcached_behavior_t memcached_behavior_t;
    -
    -
    uint64_t memcached_behavior_get(memcached_st *ptr, memcached_behavior_t flag)¶
    @@ -219,19 +214,19 @@
    memcached_return_t memcached_behavior_set(memcached_st *ptr, memcached_behavior_t flag, uint64_t data)¶
    -

    Changed in version 0.17: The data argument of memcached_behavior_set() was changed in +

    Changed in version 0.17: The data argument of memcached_behavior_set() was changed in from taking a pointer to data value, to taking a uin64_t.

    -
    -enum memcached_behavior_t memcached_behavior_t¶
    +
    +typedef enum memcached_behavior_t memcached_behavior_t¶
    -enum memcached_behavior_t¶
    +enum memcached_behavior_t
    enumerator MEMCACHED_BEHAVIOR_USE_UDP¶
    @@ -241,15 +236,15 @@ is enabled.

    The following operations will return MEMCACHED_NOT_SUPPORTED when executed with MEMCACHED_BEHAVIOR_USE_UDP enabled:

    All other operations are tested but are executed in a ‘fire-and-forget’ mode, in which once the client has executed the operation, no attempt @@ -328,8 +323,8 @@ servers.

    MEMCACHED_DISTRIBUTION_CONSISTENT. Consistent hashing delivers better distribution and allows servers to be added to the cluster with minimal cache losses.

    -

    Currently MEMCACHED_DISTRIBUTION_CONSISTENT is an alias for the -value type:MEMCACHED_DISTRIBUTION_CONSISTENT_KETAMA.

    +

    Currently MEMCACHED_DISTRIBUTION_CONSISTENT is an alias for the value +MEMCACHED_DISTRIBUTION_CONSISTENT_KETAMA.

    @@ -364,7 +359,7 @@ the server since it imposes a slight performance penalty).

    enumerator MEMCACHED_BEHAVIOR_KETAMA_WEIGHTED¶

    Sets the default distribution to MEMCACHED_DISTRIBUTION_CONSISTENT_KETAMA with the weighted tests. -Makes the default hashing algorithm for keys use MD5.

    +Makes the default hashing algorithm for keys use MEMCACHED_HASH_MD5.

    @@ -463,9 +458,9 @@ kernel is full).

    Set this value to tune the number of bytes that may be sent before libmemcached should start to automatically drain the input queue (need at least 10 IO requests sent without reading the input buffer).

    -

    Setting this value to high, may cause libmemcached to deadlock (trying to -send data, but the send will block because the input buffer in the kernel -is full).

    +

    Setting this value to high, may cause libmemcached to deadlock (trying +to send data, but the send will block because the input buffer in the +kernel is full).

    @@ -514,8 +509,8 @@ multiple servers with the expense of more write traffic.

    enumerator MEMCACHED_BEHAVIOR_CORK¶
    -

    Deprecated since version ?: This open has been deprecated with the behavior now built and used -appropriately on selected platforms.

    +

    Deprecated since version ?: This option has been deprecated with the behavior now built in and +used appropriately on selected platforms.

    @@ -592,7 +587,7 @@ seconds.

    enumerator MEMCACHED_BEHAVIOR_HASH_WITH_PREFIX_KEY¶

    When enabled the prefix key will be added to the key when determining -server by hash. See MEMCACHED_CALLBACK_NAMESPACE for additional +server by hash. See MEMCACHED_CALLBACK_NAMESPACE for additional information.

    @@ -601,26 +596,26 @@ information.

    DESCRIPTION¶

    -

    libmemcached behavior can be modified by using memcached_behavior_set(). +

    libmemcached behavior can be modified by using memcached_behavior_set(). Default behavior is the library strives to be quick and accurate. Some behavior, while being faster, can also result in not entirely accurate behavior (for -instance, memcached_set() will always respond with MEMCACHED_SUCCESS).

    -

    memcached_behavior_get() takes a behavior flag and returns whether or not +instance, memcached_set() will always respond with MEMCACHED_SUCCESS).

    +

    memcached_behavior_get() takes a behavior flag and returns whether or not that behavior is currently enabled in the client.

    -

    memcached_behavior_set() changes the value of a particular option of the -client. It takes both a flag (listed below) and a value. For simple on or off -options you just need to pass in a value of 1. Calls to -memcached_behavior_set() will flush and reset all connections.

    +

    memcached_behavior_set() changes the value of a particular option of the client. +It takes both a flag and a value. For simple on or off options you just +need to pass in a value of 1. Calls to memcached_behavior_set() will flush and +reset all connections.

    RETURN VALUE¶

    -

    memcached_behavior_get() returns either the current value of the key, or 0 -or 1 on simple flag behaviors (1 being enabled). memcached_behavior_set() +

    memcached_behavior_get() returns either the current value of the key, or 0 +or 1 on simple flag behaviors (1 being enabled). memcached_behavior_set() returns failure or success.

    NOTES¶

    -

    The data argument of memcached_behavior_set() was changed in version +

    The data argument of memcached_behavior_set() was changed in version 0.17 from taking a pointer to data value, to taking a uin64_t.

    @@ -642,7 +637,7 @@ returns failure or success.