Merge in updates to doc/build of memaslap.
[awesomized/libmemcached] / docs / man / memcached_prepend_by_key.3
1 .TH "MEMCACHED_PREPEND_BY_KEY" "3" "June 02, 2011" "0.47" "libmemcached"
2 .SH NAME
3 memcached_prepend_by_key \- Appending to or Prepending to data on the server
4 .
5 .nr rst2man-indent-level 0
6 .
7 .de1 rstReportMargin
8 \\$1 \\n[an-margin]
9 level \\n[rst2man-indent-level]
10 level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
11 -
12 \\n[rst2man-indent0]
13 \\n[rst2man-indent1]
14 \\n[rst2man-indent2]
15 ..
16 .de1 INDENT
17 .\" .rstReportMargin pre:
18 . RS \\$1
19 . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
20 . nr rst2man-indent-level +1
21 .\" .rstReportMargin post:
22 ..
23 .de UNINDENT
24 . RE
25 .\" indent \\n[an-margin]
26 .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
27 .nr rst2man-indent-level -1
28 .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
29 .in \\n[rst2man-indent\\n[rst2man-indent-level]]u
30 ..
31 .\" Man page generated from reStructeredText.
32 .
33 .sp
34 Appending or Prepending to data on the server
35 .SH SYNOPSIS
36 .sp
37 #include <libmemcached/memcached.h>
38 .INDENT 0.0
39 .TP
40 .B memcached_return_t memcached_prepend(memcached_st\fI\ *ptr\fP, const char\fI\ *key\fP, size_t\fI\ key_length\fP, const char\fI\ *value\fP, size_t\fI\ value_length\fP, time_t\fI\ expiration\fP, uint32_t\fI\ flags\fP)
41 .UNINDENT
42 .INDENT 0.0
43 .TP
44 .B memcached_return_t memcached_append(memcached_st\fI\ *ptr\fP, const char\fI\ *key\fP, size_t\fI\ key_length\fP, const char\fI\ *value\fP, size_t\fI\ value_length\fP, time_t\fI\ expiration\fP, uint32_t\fI\ flags\fP)
45 .UNINDENT
46 .INDENT 0.0
47 .TP
48 .B memcached_return_t memcached_prepend_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);
49 .UNINDENT
50 .INDENT 0.0
51 .TP
52 .B 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);
53 .UNINDENT
54 .sp
55 Compile and link with \-lmemcached
56 .SH DESCRIPTION
57 .sp
58 memcached_prepend() and memcached_append are used to
59 modify information on a server. All methods take a key, and its length to
60 store the object. Keys are currently limited to 250 characters when using either a version of memcached(1) which is 1.4 or below, or when using the text protocol.
61 You must supply both a value and a length. Optionally you
62 may test an expiration time for the object and a 16 byte value (it is
63 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.
64 .sp
65 memcached_prepend() places a segment of data before the last piece of data
66 stored. Currently expiration and key are not used in the server.
67 .sp
68 memcached_append() places a segment of data at the end of the last piece of
69 data stored. Currently expiration and key are not used in the server.
70 .sp
71 memcached_prepend_by_key() and memcached_append_by_key_by_key(,
72 methods both behave in a similar method as the non key
73 methods. The difference is that they use their group_key parameter to map
74 objects to particular servers.
75 .sp
76 If you are looking for performance, memcached_set() with non\-blocking IO is
77 the fastest way to store data on the server.
78 .sp
79 All of the above functions are testsed with the \fBMEMCACHED_BEHAVIOR_USE_UDP\fPbehavior enabled. However, when using these operations with this behavior on, there
80 are limits to the size of the payload being sent to the server. The reason for
81 these limits is that the Memcached Server does not allow multi\-datagram requests
82 and the current server implementation sets a datagram size to 1400 bytes. Due
83 to protocol overhead, the actual limit of the user supplied data is less than
84 1400 bytes and depends on the protocol in use as, well as the operation being
85 executed. When running with the binary protocol, \(ga\(ga MEMCACHED_BEHAVIOR_BINARY_PROTOCOL\(ga\(ga,
86 the size of the key,value, flags and expiry combined may not exceed 1368 bytes.
87 When running with the ASCII protocol, the exact limit fluctuates depending on
88 which function is being executed and whether the function is a cas operation
89 or not. For non\-cas ASCII set operations, there are at least 1335 bytes available
90 to split among the key, key_prefix, and value; for cas ASCII operations there are
91 at least 1318 bytes available to split among the key, key_prefix and value. If the
92 total size of the command, including overhead, exceeds 1400 bytes, a \fBMEMCACHED_WRITE_FAILURE\fPwill be returned.
93 .SH RETURN
94 .sp
95 All methods return a value of type \fBmemcached_return_t\fP.
96 On success the value will be \fBMEMCACHED_SUCCESS\fP.
97 Use memcached_strerror() to translate this value to a printable string.
98 .SH HOME
99 .sp
100 To find out more information please check:
101 \fI\%http://libmemcached.org/\fP
102 .SH SEE ALSO
103 .sp
104 memcached(1) libmemached(3) memcached_strerror(3) memcached_set(3) memcached_add(3) memcached_cas(3) memcached_replace(3)
105 .SH AUTHOR
106 Brian Aker
107 .SH COPYRIGHT
108 2011, Brian Aker DataDifferential, http://datadifferential.com/
109 .\" Generated by docutils manpage writer.
110 .\"
111 .