~kent/libmemcached/KBDocs4

« back to all changes in this revision

Viewing changes to docs/man/memcached_append.3

  • Committer: Brian Aker
  • Date: 2011-05-24 20:43:14 UTC
  • mfrom: (929.1.110 libmemcached-build)
  • Revision ID: brian@tangent.org-20110524204314-9ag1kkk4c1a6b3z3
Merge in local trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
.TH "MEMCACHED_APPEND" "3" "April 14, 2011" "0.47" "libmemcached"
 
1
.TH "MEMCACHED_APPEND" "3" "May 23, 2011" "0.47" "libmemcached"
2
2
.SH NAME
3
 
memcached_append \- Storing and Replacing Data
 
3
memcached_append \- Appending to or Prepending to data on the server
4
4
.
5
5
.nr rst2man-indent-level 0
6
6
.
31
31
.\" Man page generated from reStructeredText.
32
32
.
33
33
.sp
34
 
Store value on server
 
34
Appending or Prepending to data on the server
35
35
.SH SYNOPSIS
36
36
.sp
37
37
#include <libmemcached/memcached.h>
38
38
.INDENT 0.0
39
39
.TP
40
 
.B memcached_return_t memcached_set (memcached_st *ptr, const char *key, size_t key_length, const char *value, size_t value_length, time_t expiration, uint32_t flags);
41
 
.UNINDENT
42
 
.INDENT 0.0
43
 
.TP
44
 
.B memcached_return_t memcached_add (memcached_st *ptr, const char *key, size_t key_length, const char *value, size_t value_length, time_t expiration, uint32_t flags);
45
 
.UNINDENT
46
 
.INDENT 0.0
47
 
.TP
48
 
.B memcached_return_t memcached_replace (memcached_st *ptr, 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
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)
53
41
.UNINDENT
54
42
.INDENT 0.0
57
45
.UNINDENT
58
46
.INDENT 0.0
59
47
.TP
60
 
.B memcached_return_t memcached_cas(memcached_st *ptr, const char *key, size_t key_length, const char *value, size_t value_length, time_t expiration, uint32_t flags, uint64_t cas);
61
 
.UNINDENT
62
 
.INDENT 0.0
63
 
.TP
64
 
.B memcached_return_t memcached_set_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);
65
 
.UNINDENT
66
 
.INDENT 0.0
67
 
.TP
68
 
.B memcached_return_t memcached_add_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);
69
 
.UNINDENT
70
 
.INDENT 0.0
71
 
.TP
72
 
.B memcached_return_t memcached_replace_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);
73
 
.UNINDENT
74
 
.INDENT 0.0
75
 
.TP
76
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);
77
49
.UNINDENT
78
50
.INDENT 0.0
79
51
.TP
80
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);
81
53
.UNINDENT
82
 
.INDENT 0.0
83
 
.TP
84
 
.B memcached_return_t memcached_cas_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, uint64_t cas);
85
 
.UNINDENT
86
54
.sp
87
55
Compile and link with \-lmemcached
88
56
.SH DESCRIPTION
89
57
.sp
90
 
memcached_set(), memcached_add(), and memcached_replace() are all used to
91
 
store information on the server. All methods take a key, and its length to
92
 
store the object. Keys are currently limited to 250 characters by the
93
 
memcached(1) server. You must also supply a value and a length. Optionally you
94
 
may tests an expiration time for the object and a 16 byte value (it is
95
 
meant to be used as a bitmap).
96
 
.sp
97
 
memcached_set() will write an object to the server. If an object already
98
 
exists it will overwrite what is in the server. If the object does not exist
99
 
it will be written. If you are using the non\-blocking mode this function
100
 
will always return true unless a network error occurs.
101
 
.sp
102
 
memcached_replace() replaces an object on the server. If the object is not
103
 
found on the server an error occurs.
104
 
.sp
105
 
memcached_add() adds an object to the server. If the object is found on the
106
 
server an error occurs, otherwise the value is stored.
 
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.
107
64
.sp
108
65
memcached_prepend() places a segment of data before the last piece of data
109
66
stored. Currently expiration and key are not used in the server.
111
68
memcached_append() places a segment of data at the end of the last piece of
112
69
data stored. Currently expiration and key are not used in the server.
113
70
.sp
114
 
memcached_cas() overwrites data in the server as long as the "cas" value is
115
 
still the same in the server. You can get the cas value of a result by
116
 
calling memcached_result_cas() on a memcached_result_st(3) structure. At the point
117
 
that this note was written cas is still buggy in memached. Turning on tests
118
 
for it in libmemcached(3) is optional. Please see memcached_set() for
119
 
information on how to do this.
120
 
.sp
121
 
memcached_set_by_key(), memcached_add_by_key(), memcached_replace_by_key(),
122
 
memcached_prepend_by_key(), memcached_append_by_key_by_key(),
123
 
memcached_cas_by_key() methods all behave in a similar method as the non key
 
71
memcached_prepend_by_key() and memcached_append_by_key_by_key(,
 
72
methods both behave in a similar method as the non key
124
73
methods. The difference is that they use their group_key parameter to map
125
74
objects to particular servers.
126
75
.sp
127
76
If you are looking for performance, memcached_set() with non\-blocking IO is
128
77
the fastest way to store data on the server.
129
78
.sp
130
 
All of the above functions are testsed with the \fBMEMCACHED_BEHAVIOR_USE_UDP\fPbehavior enabled. But when using these operations with this behavior on, there
 
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
131
80
are limits to the size of the payload being sent to the server.  The reason for
132
 
these limits is that the Memcahed Server does not allow multi\-datagram requests
 
81
these limits is that the Memcached Server does not allow multi\-datagram requests
133
82
and the current server implementation sets a datagram size to 1400 bytes. Due
134
83
to protocol overhead, the actual limit of the user supplied data is less than
135
 
1400 bytes and depends on the protocol in use as well as the operation being
 
84
1400 bytes and depends on the protocol in use as, well as the operation being
136
85
executed. When running with the binary protocol, \(ga\(ga MEMCACHED_BEHAVIOR_BINARY_PROTOCOL\(ga\(ga,
137
86
the size of the key,value, flags and expiry combined may not exceed 1368 bytes.
138
87
When running with the ASCII protocol, the exact limit fluctuates depending on
146
95
All methods return a value of type \fBmemcached_return_t\fP.
147
96
On success the value will be \fBMEMCACHED_SUCCESS\fP.
148
97
Use memcached_strerror() to translate this value to a printable string.
149
 
.sp
150
 
For memcached_replace() and memcached_add(), \fBMEMCACHED_NOTSTORED\fP is a
151
 
legitmate error in the case of a collision.
152
98
.SH HOME
153
99
.sp
154
100
To find out more information please check:
155
101
\fI\%http://libmemcached.org/\fP
156
102
.SH SEE ALSO
157
103
.sp
158
 
memcached(1) libmemached(3) memcached_strerror(3)
 
104
memcached(1) libmemached(3) memcached_strerror(3) memcached_set(3) memcached_add(3) memcached_cas(3) memcached_replace(3)
159
105
.SH AUTHOR
160
106
Brian Aker
161
107
.SH COPYRIGHT