memcached 1.7.0 → 1.7.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +9 -9
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/CHANGELOG +4 -0
- data/Manifest +2 -36
- data/README.rdoc +2 -2
- data/Rakefile +1 -0
- data/ext/extconf.rb +1 -1
- data/ext/lib64/libmemcached.la +41 -0
- data/ext/lib64/pkgconfig/libmemcached.pc +10 -0
- data/ext/libmemcached-0.32/Makefile.am +1 -1
- data/ext/libmemcached-0.32/Makefile.in +242 -162
- data/ext/libmemcached-0.32/aclocal.m4 +533 -342
- data/ext/libmemcached-0.32/config.h.in +5 -3
- data/ext/libmemcached-0.32/configure +449 -431
- data/ext/libmemcached-0.32/configure.ac +0 -2
- data/memcached.gemspec +0 -0
- data/memcached.pem +16 -16
- metadata +26 -59
- metadata.gz.sig +0 -0
- data/ext/libmemcached-0.32/docs/Makefile.am +0 -415
- data/ext/libmemcached-0.32/docs/Makefile.in +0 -920
- data/ext/libmemcached-0.32/docs/libmemcached.pod +0 -123
- data/ext/libmemcached-0.32/docs/libmemcached_examples.pod +0 -115
- data/ext/libmemcached-0.32/docs/libmemcachedutil.pod +0 -40
- data/ext/libmemcached-0.32/docs/memcached_analyze.pod +0 -52
- data/ext/libmemcached-0.32/docs/memcached_auto.pod +0 -97
- data/ext/libmemcached-0.32/docs/memcached_behavior.pod +0 -224
- data/ext/libmemcached-0.32/docs/memcached_callback.pod +0 -123
- data/ext/libmemcached-0.32/docs/memcached_create.pod +0 -61
- data/ext/libmemcached-0.32/docs/memcached_delete.pod +0 -54
- data/ext/libmemcached-0.32/docs/memcached_dump.pod +0 -53
- data/ext/libmemcached-0.32/docs/memcached_flush.pod +0 -46
- data/ext/libmemcached-0.32/docs/memcached_flush_buffers.pod +0 -42
- data/ext/libmemcached-0.32/docs/memcached_generate_hash_value.pod +0 -57
- data/ext/libmemcached-0.32/docs/memcached_get.pod +0 -161
- data/ext/libmemcached-0.32/docs/memcached_memory_allocators.pod +0 -73
- data/ext/libmemcached-0.32/docs/memcached_pool.pod +0 -77
- data/ext/libmemcached-0.32/docs/memcached_quit.pod +0 -47
- data/ext/libmemcached-0.32/docs/memcached_sasl.pod +0 -63
- data/ext/libmemcached-0.32/docs/memcached_server_st.pod +0 -75
- data/ext/libmemcached-0.32/docs/memcached_servers.pod +0 -102
- data/ext/libmemcached-0.32/docs/memcached_set.pod +0 -187
- data/ext/libmemcached-0.32/docs/memcached_stats.pod +0 -82
- data/ext/libmemcached-0.32/docs/memcached_strerror.pod +0 -46
- data/ext/libmemcached-0.32/docs/memcached_user_data.pod +0 -49
- data/ext/libmemcached-0.32/docs/memcached_verbosity.pod +0 -41
- data/ext/libmemcached-0.32/docs/memcached_version.pod +0 -56
- data/ext/libmemcached-0.32/docs/memcat.pod +0 -37
- data/ext/libmemcached-0.32/docs/memcp.pod +0 -40
- data/ext/libmemcached-0.32/docs/memdump.pod +0 -31
- data/ext/libmemcached-0.32/docs/memerror.pod +0 -30
- data/ext/libmemcached-0.32/docs/memflush.pod +0 -35
- data/ext/libmemcached-0.32/docs/memrm.pod +0 -34
- data/ext/libmemcached-0.32/docs/memslap.pod +0 -33
- data/ext/libmemcached-0.32/docs/memstat.pod +0 -35
@@ -1,73 +0,0 @@
|
|
1
|
-
=head1 NAME
|
2
|
-
|
3
|
-
memcached_set_memory_allocators, memcached_get_memory_allocators - Manage memory allocator functions
|
4
|
-
|
5
|
-
=head1 LIBRARY
|
6
|
-
|
7
|
-
C Client Library for memcached (libmemcached, -lmemcached)
|
8
|
-
|
9
|
-
=head1 SYNOPSIS
|
10
|
-
|
11
|
-
#include <memcached.h>
|
12
|
-
|
13
|
-
memcached_return
|
14
|
-
memcached_set_memory_allocators(memcached_st *ptr,
|
15
|
-
memcached_malloc_function mem_malloc,
|
16
|
-
memcached_free_function mem_free,
|
17
|
-
memcached_realloc_function mem_realloc,
|
18
|
-
memcached_calloc_function mem_calloc);
|
19
|
-
|
20
|
-
void memcached_get_memory_allocators(memcached_st *ptr,
|
21
|
-
memcached_malloc_function *mem_malloc,
|
22
|
-
memcached_free_function *mem_free,
|
23
|
-
memcached_realloc_function *mem_realloc,
|
24
|
-
memcached_calloc_function *mem_calloc);
|
25
|
-
|
26
|
-
void *(*memcached_malloc_function)(memcached_st *ptr, const size_t size);
|
27
|
-
void *(*memcached_realloc_function)(memcached_st *ptr, void *mem,
|
28
|
-
const size_t size);
|
29
|
-
void (*memcached_free_function)(memcached_st *ptr, void *mem);
|
30
|
-
void *(*memcached_calloc_function)(memcached_st *ptr, size_t nelem,
|
31
|
-
const size_t elsize);
|
32
|
-
|
33
|
-
|
34
|
-
=head1 DESCRIPTION
|
35
|
-
|
36
|
-
libmemcached(3) allows you to specify your own memory allocators optimized
|
37
|
-
for your application.
|
38
|
-
|
39
|
-
memcached_set_memory_allocators() is used to set the memory allocators used
|
40
|
-
by the memcached instance specified by ptr. Please note that you cannot
|
41
|
-
override only one of the memory allocators, you have to specify a complete
|
42
|
-
new set if you want to override one of them. All of the memory allocation
|
43
|
-
functions should behave as specified in the C99 standard. Specify NULL as
|
44
|
-
all functions to reset them to the default values.
|
45
|
-
|
46
|
-
memcached_get_memory_allocators() is used to get the currently used memory
|
47
|
-
allocators by a mamcached handle.
|
48
|
-
|
49
|
-
The first argument to the memory allocator functions is a pointer to a
|
50
|
-
memcached structure, and you may use the memcached_set_user_data() and
|
51
|
-
memcached_get_user_data() to store a user-specific value to each memcached
|
52
|
-
structure.
|
53
|
-
|
54
|
-
=head1 RETURN
|
55
|
-
|
56
|
-
memcached_set_memory_allocators() return MEMCACHED_SUCCESS upon success,
|
57
|
-
and MEMCACHED_FAILURE if you don't pass a complete set of function pointers.
|
58
|
-
|
59
|
-
=head1 HOME
|
60
|
-
|
61
|
-
To find out more information please check:
|
62
|
-
L<http://tangent.org/552/libmemcached.html>
|
63
|
-
|
64
|
-
=head1 AUTHOR
|
65
|
-
|
66
|
-
Trond Norbye, E<lt>trond.norbye@sun.comE<gt>
|
67
|
-
|
68
|
-
=head1 SEE ALSO
|
69
|
-
|
70
|
-
memcached(1) libmemcached(3) memcached_get_user_data(3) memcached_set_user_data(3)
|
71
|
-
|
72
|
-
=cut
|
73
|
-
|
@@ -1,77 +0,0 @@
|
|
1
|
-
=head1 NAME
|
2
|
-
|
3
|
-
memcached_pool_create, memcached_pool_destroy, memcached_pool_push, memcached_pool_pop - Manage pools
|
4
|
-
|
5
|
-
=head1 LIBRARY
|
6
|
-
|
7
|
-
C Client Library for memcached (libmemcachedutil, -lmemcachedutil)
|
8
|
-
|
9
|
-
=head1 SYNOPSIS
|
10
|
-
|
11
|
-
#include <libmemcached/memcached_pool.h>
|
12
|
-
|
13
|
-
memcached_pool_st *memcached_pool_create(memcached_st* mmc, int initial, int max);
|
14
|
-
memcached_st* memcached_pool_destroy(memcached_pool_st* pool);
|
15
|
-
|
16
|
-
memcached_st* memcached_pool_pop(memcached_pool_st* pool, bool block, memcached_return *rc);
|
17
|
-
memcached_return memcached_pool_push(memcached_pool_st* pool, memcached_st *mmc);
|
18
|
-
|
19
|
-
memcached_st *memcached_create (memcached_st *ptr);
|
20
|
-
|
21
|
-
|
22
|
-
=head1 DESCRIPTION
|
23
|
-
|
24
|
-
memcached_pool_create() is used to create a connection pool of objects you
|
25
|
-
may use to remove the overhead of using memcached_clone for short
|
26
|
-
lived C<memcached_st> objects. The mmc argument should be an
|
27
|
-
initialised C<memcached_st> structure, and a successfull invocation of
|
28
|
-
memcached_pool_create takes full ownership of the variable (until it
|
29
|
-
is released by memcached_pool_destroy). The C<initial> argument
|
30
|
-
specifies the initial size of the connection pool, and the C<max>
|
31
|
-
argument specifies the maximum size the connection pool should grow
|
32
|
-
to. Please note that the library will allocate a fixed size buffer
|
33
|
-
scaled to the max size of the connection pool, so you should not pass
|
34
|
-
MAXINT or some other large number here.
|
35
|
-
|
36
|
-
memcached_pool_destroy() is used to destroy the connection pool
|
37
|
-
created with memcached_pool_create() and release all allocated
|
38
|
-
resources. It will return the pointer to the C<memcached_st> structure
|
39
|
-
passed as an argument to memcached_pool_create(), and returns the
|
40
|
-
ownership of the pointer to the caller.
|
41
|
-
|
42
|
-
memcached_pool_pop() is used to grab a connection structure from the
|
43
|
-
connection pool. The block argument specifies if the function should
|
44
|
-
block and wait for a connection structure to be available if we try
|
45
|
-
to exceed the maximum size.
|
46
|
-
|
47
|
-
memcached_pool_push() is used to return a connection structure back to the pool.
|
48
|
-
|
49
|
-
=head1 RETURN
|
50
|
-
|
51
|
-
memcached_pool_create() returns a pointer to the newly created
|
52
|
-
memcached_pool_st structure. On an allocation failure, it returns
|
53
|
-
NULL.
|
54
|
-
|
55
|
-
memcached_pool_destroy() returns the pointer (and ownership) to the
|
56
|
-
memcached_st structure used to create the pool. If connections are in
|
57
|
-
use it returns NULL.
|
58
|
-
|
59
|
-
memcached_pool_pop() returns a pointer to a memcached_st structure
|
60
|
-
from the pool (or NULL if an allocation cannot be satisfied).
|
61
|
-
|
62
|
-
memcached_pool_push() returns MEMCACHED_SUCCESS upon success.
|
63
|
-
|
64
|
-
=head1 HOME
|
65
|
-
|
66
|
-
To find out more information please check:
|
67
|
-
L<http://tangent.org/552/libmemcached.html>
|
68
|
-
|
69
|
-
=head1 AUTHOR
|
70
|
-
|
71
|
-
Trond Norbye, E<lt>trond.norbye@sun.comE<gt>
|
72
|
-
|
73
|
-
=head1 SEE ALSO
|
74
|
-
|
75
|
-
memcached(1) libmemcached(3) memcached_create(3) memcached_free(3) libmemcachedutil(3)
|
76
|
-
|
77
|
-
=cut
|
@@ -1,47 +0,0 @@
|
|
1
|
-
=head1 NAME
|
2
|
-
|
3
|
-
memcached_quit - Disconnect from all servers
|
4
|
-
|
5
|
-
=head1 LIBRARY
|
6
|
-
|
7
|
-
C Client Library for memcached (libmemcached, -lmemcached)
|
8
|
-
|
9
|
-
=head1 SYNOPSIS
|
10
|
-
|
11
|
-
#include <memcached.h>
|
12
|
-
|
13
|
-
void memcached_quit (memcached_st *ptr);
|
14
|
-
|
15
|
-
=head1 DESCRIPTION
|
16
|
-
|
17
|
-
memcached_quit() will disconnect you from all currently connected servers.
|
18
|
-
It will also reset the state of the connection (ie, any memcached_fetch() you
|
19
|
-
are in the middle of will be terminated). This function is called
|
20
|
-
automatically when you call memcached_free() on the C<memcached_st> structure.
|
21
|
-
|
22
|
-
You do not need to call this on your own. All operations to change server
|
23
|
-
hashes and parameters will handle connections to the server for you. This
|
24
|
-
function is provided mainly so that you can timeout your connections or
|
25
|
-
reset connections during the middle of a memcached_fetch().
|
26
|
-
|
27
|
-
=head1 RETURN
|
28
|
-
|
29
|
-
A value of type C<memcached_return> is returned
|
30
|
-
On success that value will be C<MEMCACHED_SUCCESS>.
|
31
|
-
Use memcached_strerror() to translate this value to a printable string.
|
32
|
-
|
33
|
-
=head1 HOME
|
34
|
-
|
35
|
-
To find out more information please check:
|
36
|
-
L<http://tangent.org/552/libmemcached.html>
|
37
|
-
|
38
|
-
=head1 AUTHOR
|
39
|
-
|
40
|
-
Brian Aker, E<lt>brian@tangent.orgE<gt>
|
41
|
-
|
42
|
-
=head1 SEE ALSO
|
43
|
-
|
44
|
-
memcached(1) libmemcached(3) memcached_strerror(3)
|
45
|
-
|
46
|
-
=cut
|
47
|
-
|
@@ -1,63 +0,0 @@
|
|
1
|
-
=head1 NAME
|
2
|
-
|
3
|
-
memcached_set_sasl_callbacks, memcached_get_sasl_callbackss, memcached_get_sasl_set_auth_data - SASL support
|
4
|
-
|
5
|
-
=head1 LIBRARY
|
6
|
-
|
7
|
-
C Client Library for memcached (libmemcached, -lmemcached)
|
8
|
-
|
9
|
-
=head1 SYNOPSIS
|
10
|
-
|
11
|
-
#include <memcached.h>
|
12
|
-
|
13
|
-
void memcached_set_sasl_callbacks(memcached_st *ptr,
|
14
|
-
const sasl_callback_t *callbacks)
|
15
|
-
|
16
|
-
const sasl_callback_t *memcached_get_sasl_callbacks(memcached_st *ptr)
|
17
|
-
|
18
|
-
memcached_return memcached_set_sasl_auth_data(memcached_st *ptr,
|
19
|
-
const char *username,
|
20
|
-
const char *password)
|
21
|
-
memcached_return memcached_destroy_sasl_auth_data(memcached_st *ptr)
|
22
|
-
|
23
|
-
|
24
|
-
=head1 DESCRIPTION
|
25
|
-
|
26
|
-
libmemcached(3) allows you to plug in your own callbacks function used by
|
27
|
-
libsasl to perform SASL authentication.
|
28
|
-
|
29
|
-
Please note that SASL requires the memcached binary protocol, and you have
|
30
|
-
to specify the callbacks before you connect to the server.
|
31
|
-
|
32
|
-
memcached_set_sasl_auth_data() is a helper function for you defining
|
33
|
-
the basic functionality for you, but it will store the username and password
|
34
|
-
in memory. If you choose to use this method you have to call
|
35
|
-
memcached_destroy_sasl_auth_data before calling memcached_free to avoid
|
36
|
-
a memory leak. You should NOT call memcached_destroy_sasl_auth_data if you
|
37
|
-
specify your own callback function with memcached_set_sasl_callbacks().
|
38
|
-
|
39
|
-
You as a client user have to initialize libsasl by using sasl_client_init
|
40
|
-
before enabling it in libmemcached, and you have to shut down libsasl by
|
41
|
-
calling sasl_done() when you are done using SASL from libmemcached.
|
42
|
-
|
43
|
-
|
44
|
-
=head1 RETURN
|
45
|
-
|
46
|
-
memcached_get_sasl_callbacks() returns the callbacks currently used
|
47
|
-
by this memcached handle.
|
48
|
-
memcached_get_sasl_set_auth_data() returns MEMCACHED_SUCCESS upon success.
|
49
|
-
|
50
|
-
=head1 HOME
|
51
|
-
|
52
|
-
To find out more information please check:
|
53
|
-
L<http://tangent.org/552/libmemcached.html>
|
54
|
-
|
55
|
-
=head1 AUTHOR
|
56
|
-
|
57
|
-
Trond Norbye, E<lt>trond.norbye@sun.comE<gt>
|
58
|
-
|
59
|
-
=head1 SEE ALSO
|
60
|
-
|
61
|
-
memcached(1) libmemcached(3)
|
62
|
-
|
63
|
-
=cut
|
@@ -1,75 +0,0 @@
|
|
1
|
-
=head1 NAME
|
2
|
-
|
3
|
-
memcached_server_list_free, memcached_server_list_append,
|
4
|
-
memcached_server_list_count, memcached_servers_parse - Manage server list
|
5
|
-
|
6
|
-
=head1 LIBRARY
|
7
|
-
|
8
|
-
C Client Library for memcached (libmemcached, -lmemcached)
|
9
|
-
|
10
|
-
=head1 SYNOPSIS
|
11
|
-
|
12
|
-
#include <memcached.h>
|
13
|
-
|
14
|
-
void memcached_server_list_free (memcached_server_st *ptr);
|
15
|
-
|
16
|
-
memcached_server_st *
|
17
|
-
memcached_server_list_append (memcached_server_st *ptr,
|
18
|
-
const char *hostname,
|
19
|
-
unsigned int port,
|
20
|
-
memcached_return *error);
|
21
|
-
|
22
|
-
unsigned int memcached_server_list_count (memcached_server_st *ptr);
|
23
|
-
|
24
|
-
memcached_server_st *memcached_servers_parse (const char *server_strings);
|
25
|
-
|
26
|
-
const char *memcached_server_error(memcached_server_st *ptr);
|
27
|
-
|
28
|
-
void memcached_server_error_reset(memcached_server_st *ptr);
|
29
|
-
|
30
|
-
=head1 DESCRIPTION
|
31
|
-
|
32
|
-
libmemcached(3) operates on a list of hosts which are stored in
|
33
|
-
memcached_server_st structures. You should not modify these structures
|
34
|
-
directly. Functions are provided to modify these structures (and more can be
|
35
|
-
added, just ask!).
|
36
|
-
|
37
|
-
memcached_server_list_free() deallocates all memory associated with the array
|
38
|
-
of memcached_server_st that you passed to it.
|
39
|
-
|
40
|
-
memcached_server_list_append() adds a server to the end of a
|
41
|
-
memcached_server_st array. On error null will be returned and the
|
42
|
-
memcached_return pointer you passed into the function will be set with the
|
43
|
-
appropriate error. If the value of port is zero, it is set to the default
|
44
|
-
port of a memcached server.
|
45
|
-
|
46
|
-
memcached_servers_parse() takes a string, the type that is used for the
|
47
|
-
command line applications, and parse it to an array of memcached_server_st.
|
48
|
-
The example is "localhost, foo:555, foo, bar". All hosts except foo:555 will
|
49
|
-
be set to the default port, while that host will have a port of 555.
|
50
|
-
|
51
|
-
memcached_server_error() can be used to look at the text of the last error
|
52
|
-
message sent by the server to to the client. Use memcached_server_error_reset()
|
53
|
-
to reset the message (this does not currently free up the memory associated
|
54
|
-
with the message).
|
55
|
-
|
56
|
-
|
57
|
-
=head1 RETURN
|
58
|
-
|
59
|
-
Varies, see particular functions.
|
60
|
-
|
61
|
-
=head1 HOME
|
62
|
-
|
63
|
-
To find out more information please check:
|
64
|
-
L<http://tangent.org/552/libmemcached.html>
|
65
|
-
|
66
|
-
=head1 AUTHOR
|
67
|
-
|
68
|
-
Brian Aker, E<lt>brian@tangent.orgE<gt>
|
69
|
-
|
70
|
-
=head1 SEE ALSO
|
71
|
-
|
72
|
-
memcached(1) libmemcached(3) memcached_strerror(3)
|
73
|
-
|
74
|
-
=cut
|
75
|
-
|
@@ -1,102 +0,0 @@
|
|
1
|
-
=head1 NAME
|
2
|
-
|
3
|
-
memcached_server_count, memcached_server_list, memcached_server_add, memcached_server_push - Manage server list
|
4
|
-
|
5
|
-
=head1 LIBRARY
|
6
|
-
|
7
|
-
C Client Library for memcached (libmemcached, -lmemcached)
|
8
|
-
|
9
|
-
=head1 SYNOPSIS
|
10
|
-
|
11
|
-
#include <memcached.h>
|
12
|
-
|
13
|
-
unsigned int memcached_server_count (memcached_st *ptr);
|
14
|
-
|
15
|
-
memcached_server_st *
|
16
|
-
memcached_server_list (memcached_st *ptr);
|
17
|
-
|
18
|
-
memcached_return
|
19
|
-
memcached_server_add (memcached_st *ptr,
|
20
|
-
const char *hostname,
|
21
|
-
unsigned int port);
|
22
|
-
|
23
|
-
memcached_return
|
24
|
-
memcached_server_add_udp (memcached_st *ptr,
|
25
|
-
const char *hostname,
|
26
|
-
unsigned int port);
|
27
|
-
|
28
|
-
memcached_return
|
29
|
-
memcached_server_add_unix_socket (memcached_st *ptr,
|
30
|
-
const char *socket);
|
31
|
-
|
32
|
-
memcached_return
|
33
|
-
memcached_server_push (memcached_st *ptr,
|
34
|
-
memcached_server_st *list);
|
35
|
-
|
36
|
-
memcached_server_st *
|
37
|
-
memcached_server_by_key (memcached_st *ptr,
|
38
|
-
const char *key, size_t key_length,
|
39
|
-
memcached_return *error);
|
40
|
-
|
41
|
-
=head1 DESCRIPTION
|
42
|
-
|
43
|
-
libmemcached(3) performs operations on a list of hosts. The order of these
|
44
|
-
hosts determine routing to keys. Functions are provided to add keys to
|
45
|
-
memcached_st structures. To manipulate lists of servers see
|
46
|
-
memcached_server_st(3).
|
47
|
-
|
48
|
-
memcached_server_count() provides you a count of the current number of
|
49
|
-
servers being used by a C<memcached_st> structure.
|
50
|
-
|
51
|
-
memcached_server_list() is used to provide an array of all defined hosts.
|
52
|
-
You are responsible for freeing this list (aka it is not a pointer to the
|
53
|
-
currently used structure).
|
54
|
-
|
55
|
-
memcached_server_add() pushes a single TCP server into the C<memcached_st>
|
56
|
-
structure. This server will be placed at the end. Duplicate servers are
|
57
|
-
allowed, so duplication is not checked. Executing this function with the
|
58
|
-
C<MEMCACHED_BEHAVIOR_USE_UDP> behavior set will result in a
|
59
|
-
C<MEMCACHED_INVALID_HOST_PROTOCOL>.
|
60
|
-
|
61
|
-
memcached_server_add_udp() pushes a single UDP server into the C<memcached_st>
|
62
|
-
structure. This server will be placed at the end. Duplicate servers are
|
63
|
-
allowed, so duplication is not checked. Executing this function with out
|
64
|
-
setting the C<MEMCACHED_BEHAVIOR_USE_UDP> behavior will result in a
|
65
|
-
C<MEMCACHED_INVALID_HOST_PROTOCOL>.
|
66
|
-
|
67
|
-
memcached_server_add_unix_socket() pushes a single UNIX socket into the
|
68
|
-
C<memcached_st> structure. This UNIX socket will be placed at the end.
|
69
|
-
Duplicate servers are allowed, so duplication is not checked. The length
|
70
|
-
of the filename must be one character less then MEMCACHED_MAX_HOST_LENGTH.
|
71
|
-
|
72
|
-
memcached_server_push() pushes an array of C<memcached_server_st> into
|
73
|
-
the C<memcached_st> structure. These servers will be placed at the
|
74
|
-
end. Duplicate servers are allowed, so duplication is not checked. A
|
75
|
-
copy is made of structure so the list provided (and any operations on
|
76
|
-
the list) are not saved.
|
77
|
-
|
78
|
-
memcached_server_by_key() allows you to provide a key and retrieve the
|
79
|
-
server which would be used for assignment. This structure is cloned
|
80
|
-
from its original structure and must be freed. If NULL is returned you
|
81
|
-
should consult *error. The returning structure should be freed with
|
82
|
-
memcached_server_free().
|
83
|
-
|
84
|
-
=head1 RETURN
|
85
|
-
|
86
|
-
Varies, see particular functions.
|
87
|
-
|
88
|
-
=head1 HOME
|
89
|
-
|
90
|
-
To find out more information please check:
|
91
|
-
L<http://tangent.org/552/libmemcached.html>
|
92
|
-
|
93
|
-
=head1 AUTHOR
|
94
|
-
|
95
|
-
Brian Aker, E<lt>brian@tangent.orgE<gt>
|
96
|
-
|
97
|
-
=head1 SEE ALSO
|
98
|
-
|
99
|
-
memcached(1) libmemcached(3) memcached_strerror(3)
|
100
|
-
|
101
|
-
=cut
|
102
|
-
|
@@ -1,187 +0,0 @@
|
|
1
|
-
=head1 NAME
|
2
|
-
|
3
|
-
memcached_set, memcached_add, memcached_replace - Store value on server
|
4
|
-
|
5
|
-
=head1 LIBRARY
|
6
|
-
|
7
|
-
C Client Library for memcached (libmemcached, -lmemcached)
|
8
|
-
|
9
|
-
=head1 SYNOPSIS
|
10
|
-
|
11
|
-
#include <memcached.h>
|
12
|
-
|
13
|
-
memcached_return
|
14
|
-
memcached_set (memcached_st *ptr,
|
15
|
-
const char *key, size_t key_length,
|
16
|
-
const char *value, size_t value_length,
|
17
|
-
time_t expiration,
|
18
|
-
uint32_t flags);
|
19
|
-
|
20
|
-
memcached_return
|
21
|
-
memcached_add (memcached_st *ptr,
|
22
|
-
const char *key, size_t key_length,
|
23
|
-
const char *value, size_t value_length,
|
24
|
-
time_t expiration,
|
25
|
-
uint32_t flags);
|
26
|
-
|
27
|
-
memcached_return
|
28
|
-
memcached_replace (memcached_st *ptr,
|
29
|
-
const char *key, size_t key_length,
|
30
|
-
const char *value, size_t value_length,
|
31
|
-
time_t expiration,
|
32
|
-
uint32_t flags);
|
33
|
-
|
34
|
-
memcached_return
|
35
|
-
memcached_prepend(memcached_st *ptr,
|
36
|
-
const char *key, size_t key_length,
|
37
|
-
const char *value, size_t value_length,
|
38
|
-
time_t expiration,
|
39
|
-
uint32_t flags)
|
40
|
-
|
41
|
-
memcached_return
|
42
|
-
memcached_append(memcached_st *ptr,
|
43
|
-
const char *key, size_t key_length,
|
44
|
-
const char *value, size_t value_length,
|
45
|
-
time_t expiration,
|
46
|
-
uint32_t flags)
|
47
|
-
memcached_return
|
48
|
-
memcached_cas(memcached_st *ptr,
|
49
|
-
const char *key, size_t key_length,
|
50
|
-
const char *value, size_t value_length,
|
51
|
-
time_t expiration,
|
52
|
-
uint32_t flags,
|
53
|
-
uint64_t cas);
|
54
|
-
|
55
|
-
memcached_return
|
56
|
-
memcached_set_by_key(memcached_st *ptr,
|
57
|
-
const char *master_key, size_t master_key_length,
|
58
|
-
const char *key, size_t key_length,
|
59
|
-
const char *value, size_t value_length,
|
60
|
-
time_t expiration,
|
61
|
-
uint32_t flags);
|
62
|
-
|
63
|
-
memcached_return
|
64
|
-
memcached_add_by_key(memcached_st *ptr,
|
65
|
-
const char *master_key, size_t master_key_length,
|
66
|
-
const char *key, size_t key_length,
|
67
|
-
const char *value, size_t value_length,
|
68
|
-
time_t expiration,
|
69
|
-
uint32_t flags);
|
70
|
-
|
71
|
-
memcached_return
|
72
|
-
memcached_replace_by_key(memcached_st *ptr,
|
73
|
-
const char *master_key, size_t master_key_length,
|
74
|
-
const char *key, size_t key_length,
|
75
|
-
const char *value, size_t value_length,
|
76
|
-
time_t expiration,
|
77
|
-
uint32_t flags);
|
78
|
-
|
79
|
-
memcached_return
|
80
|
-
memcached_prepend_by_key(memcached_st *ptr,
|
81
|
-
const char *master_key, size_t master_key_length,
|
82
|
-
const char *key, size_t key_length,
|
83
|
-
const char *value, size_t value_length,
|
84
|
-
time_t expiration,
|
85
|
-
uint32_t flags);
|
86
|
-
|
87
|
-
memcached_return
|
88
|
-
memcached_append_by_key(memcached_st *ptr,
|
89
|
-
const char *master_key, size_t master_key_length,
|
90
|
-
const char *key, size_t key_length,
|
91
|
-
const char *value, size_t value_length,
|
92
|
-
time_t expiration,
|
93
|
-
uint32_t flags);
|
94
|
-
|
95
|
-
memcached_return
|
96
|
-
memcached_cas_by_key(memcached_st *ptr,
|
97
|
-
const char *master_key, size_t master_key_length,
|
98
|
-
const char *key, size_t key_length,
|
99
|
-
const char *value, size_t value_length,
|
100
|
-
time_t expiration,
|
101
|
-
uint32_t flags,
|
102
|
-
uint64_t cas);
|
103
|
-
|
104
|
-
=head1 DESCRIPTION
|
105
|
-
|
106
|
-
memcached_set(), memcached_add(), and memcached_replace() are all used to
|
107
|
-
store information on the server. All methods take a key, and its length to
|
108
|
-
store the object. Keys are currently limited to 250 characters by the
|
109
|
-
memcached(1) server. You must also supply a value and a length. Optionally you
|
110
|
-
may support an expiration time for the object and a 16 byte value (it is
|
111
|
-
meant to be used as a bitmap).
|
112
|
-
|
113
|
-
memcached_set() will write an object to the server. If an object already
|
114
|
-
exists it will overwrite what is in the server. If the object does not exist
|
115
|
-
it will be written. If you are using the non-blocking mode this function
|
116
|
-
will always return true unless a network error occurs.
|
117
|
-
|
118
|
-
memcached_replace() replaces an object on the server. If the object is not
|
119
|
-
found on the server an error occurs.
|
120
|
-
|
121
|
-
memcached_add() adds an object to the server. If the object is found on the
|
122
|
-
server an error occurs, otherwise the value is stored.
|
123
|
-
|
124
|
-
memcached_prepend() places a segment of data before the last piece of data
|
125
|
-
stored. Currently expiration and key are not used in the server.
|
126
|
-
|
127
|
-
memcached_append() places a segment of data at the end of the last piece of
|
128
|
-
data stored. Currently expiration and key are not used in the server.
|
129
|
-
|
130
|
-
memcached_cas() overwrites data in the server as long as the "cas" value is
|
131
|
-
still the same in the server. You can get the cas value of a result by
|
132
|
-
calling memcached_result_cas() on a memcached_result_st(3) structure. At the point
|
133
|
-
that this note was written cas is still buggy in memached. Turning on support
|
134
|
-
for it in libmemcached(3) is optional. Please see memcached_set() for
|
135
|
-
information on how to do this.
|
136
|
-
|
137
|
-
memcached_set_by_key(), memcached_add_by_key(), memcached_replace_by_key(),
|
138
|
-
memcached_prepend_by_key(), memcached_append_by_key_by_key(),
|
139
|
-
memcached_cas_by_key() methods all behave in a similar method as the non key
|
140
|
-
methods. The difference is that they use their master_key parameter to map
|
141
|
-
objects to particular servers.
|
142
|
-
|
143
|
-
If you are looking for performance, memcached_set() with non-blocking IO is
|
144
|
-
the fastest way to store data on the server.
|
145
|
-
|
146
|
-
All of the above functions are supported with the C<MEMCACHED_BEHAVIOR_USE_UDP>
|
147
|
-
behavior enabled. But when using these operations with this behavior on, there
|
148
|
-
are limits to the size of the payload being sent to the server. The reason for
|
149
|
-
these limits is that the Memcahed Server does not allow multi-datagram requests
|
150
|
-
and the current server implementation sets a datagram size to 1400 bytes. Due
|
151
|
-
to protocol overhead, the actual limit of the user supplied data is less than
|
152
|
-
1400 bytes and depends on the protocol in use as well as the operation being
|
153
|
-
executed. When running with the binary protocol, C< MEMCACHED_BEHAVIOR_BINARY_PROTOCOL>,
|
154
|
-
the size of the key,value, flags and expiry combined may not exceed 1368 bytes.
|
155
|
-
When running with the ASCII protocol, the exact limit fluctuates depending on
|
156
|
-
which function is being executed and whether the function is a cas operation
|
157
|
-
or not. For non-cas ASCII set operations, there are at least 1335 bytes available
|
158
|
-
to split among the key, key_prefix, and value; for cas ASCII operations there are
|
159
|
-
at least 1318 bytes available to split among the key, key_prefix and value. If the
|
160
|
-
total size of the command, including overhead, exceeds 1400 bytes, a C<MEMCACHED_WRITE_FAILURE>
|
161
|
-
will be returned.
|
162
|
-
|
163
|
-
|
164
|
-
=head1 RETURN
|
165
|
-
|
166
|
-
All methods return a value of type C<memcached_return>.
|
167
|
-
On success the value will be C<MEMCACHED_SUCCESS>.
|
168
|
-
Use memcached_strerror() to translate this value to a printable string.
|
169
|
-
|
170
|
-
For memcached_replace() and memcached_add(), C<MEMCACHED_NOTSTORED> is a
|
171
|
-
legitmate error in the case of a collision.
|
172
|
-
|
173
|
-
=head1 HOME
|
174
|
-
|
175
|
-
To find out more information please check:
|
176
|
-
L<http://tangent.org/552/libmemcached.html>
|
177
|
-
|
178
|
-
=head1 AUTHOR
|
179
|
-
|
180
|
-
Brian Aker, E<lt>brian@tangent.orgE<gt>
|
181
|
-
|
182
|
-
=head1 SEE ALSO
|
183
|
-
|
184
|
-
memcached(1) libmemached(3) memcached_strerror(3)
|
185
|
-
|
186
|
-
=cut
|
187
|
-
|