1memcached_get.pop(3)             memcached_get            memcached_get.pop(3)
2
3
4

NAME

6       memcached_get, memcached_mget, memcached_fetch, memcached_mget_execute,
7       memcached_mget_execute_by_key - Get a value
8

LIBRARY

10       C Client Library for memcached (libmemcached, -lmemcached)
11

SYNOPSIS

13         #include <memcached.h>
14
15         memcached_result_st *
16           memcached_fetch_result (memcached_st *ptr,
17                                   memcached_result_st *result,
18                                   memcached_return_t *error);
19
20         char *
21           memcached_get (memcached_st *ptr,
22                          const char *key, size_t key_length,
23                          size_t *value_length,
24                          uint32_t *flags,
25                          memcached_return_t *error);
26
27         memcached_return_t
28           memcached_mget (memcached_st *ptr,
29                         const char * const *keys,
30                         const size_t *key_length,
31                         size_t number_of_keys);
32         char *
33           memcached_get_by_key (memcached_st *ptr,
34                                 const char *master_key, size_t master_key_length,
35                                 const char *key, size_t key_length,
36                                 size_t *value_length,
37                                 uint32_t *flags,
38                                 memcached_return_t *error);
39
40         memcached_return_t
41           memcached_mget_by_key (memcached_st *ptr,
42                                  const char *master_key, size_t master_key_length,
43                                  const char * const *keys,
44                                  const size_t *key_length,
45                                  size_t number_of_keys);
46
47         char *
48           memcached_fetch (memcached_st *ptr,
49                            char *key, size_t *key_length,
50                            size_t *value_length,
51                            uint32_t *flags,
52                            memcached_return_t *error);
53
54         memcached_return_t
55           memcached_fetch_execute (memcached_st *ptr,
56                                    memcached_execute_fn *callback,
57                                    void *context,
58                                    uint32_t number_of_callbacks);
59
60
61         memcached_return_t
62           memcached_mget_execute (memcached_st *ptr,
63                                   const char * const *keys,
64                                   const size_t *key_length,
65                                   size_t number_of_keys,
66                                   memcached_execute_fn *callback,
67                                   void *context,
68                                   uint32_t number_of_callbacks);
69
70         memcached_return_t
71           memcached_mget_execute_by_key (memcached_st *ptr,
72                                          const char *master_key,
73                                          size_t master_key_length,
74                                          const char * const *keys,
75                                          const size_t *key_length,
76                                          size_t number_of_keys,
77                                          memcached_execute_fn *callback,
78                                          void *context,
79                                          uint32_t number_of_callbacks);
80

DESCRIPTION

82       memcached_get() is used to fetch an individual value from the server.
83       You must pass in a key and its length to fetch the object. You must
84       supply three pointer variables which will give you the state of the
85       returned object.  A uint32_t pointer to contain whatever flags you
86       stored with the value, a size_t pointer which will be filled with size
87       of of the object, and a memcached_return_t pointer to hold any error.
88       The object will be returned upon success and NULL will be returned on
89       failure. Any object returned by memcached_get() must be released by the
90       caller application.
91
92       memcached_mget() is used to select multiple keys at once. For multiple
93       key operations it is always faster to use this function. This function
94       always works asynchronously. memcached_fetch() is then used to retrieve
95       any keys found. No error is given on keys that are not found. You must
96       call either memcached_fetch() or memcached_fetch_result() after a
97       successful call to memcached_mget(). You should continue to call these
98       functions until they return NULL (aka no more values). If you need to
99       quit in the middle of a memcached_get() call, execute a
100       memcached_quit(). After you do this, you can issue new queries against
101       the server.
102
103       memcached_fetch() is used to fetch an individual value from the server.
104       memcached_mget() must always be called before using this method.  You
105       must pass in a key and its length to fetch the object. You must supply
106       three pointer variables which will give you the state of the returned
107       object.  A uint32_t pointer to contain whatever flags you stored with
108       the value, a size_t pointer which will be filled with size of of the
109       object, and a memcached_return_t pointer to hold any error. The object
110       will be returned upon success and NULL will be returned on failure.
111       MEMCACHD_END is returned by the *error value when all objects that have
112       been found are returned.  The final value upon MEMCACHED_END is null.
113       Values returned by memcached_fetch() musted be free'ed by the caller.
114       memcached_fetch() will be DEPRECATED in the near future,
115       memcached_fetch_result() should be used instead.
116
117       memcached_fetch_result() is used to return a memcached_result_st(3)
118       structure from a memcached server. The result object is forward
119       compatible with changes to the server. For more information please
120       refer to the memcached_result_st(3) help. This function will
121       dynamically allocate a result structure for you if you do not pass one
122       to the function.
123
124       memcached_fetch_execute() is a callback function for result sets.
125       Instead of returning the results to you for processing, it passes each
126       of the result sets to the list of functions you provide. It passes to
127       the function a memcached_st that can be cloned for use in the called
128       function (it can not be used directly). It also passes a result set
129       which does not need to be freed.  Finally it passes a "context". This
130       is just a pointer to a memory reference you supply the calling
131       function. Currently only one value is being passed to each function
132       call. In the future there will be an option to allow this to be an
133       array.
134
135       memcached_mget_execute() and memcached_mget_execute_by_key() is similar
136       to memcached_mget(), but it may trigger the supplied callbacks with
137       result sets while sending out the queries. If you try to perform a
138       really large multiget with memcached_mget() you may encounter a
139       deadlock in the OS kernel (we fail to write data to the socket because
140       the input buffer is full). memcached_mget_execute() solves this problem
141       by processing some of the results before continuing sending out
142       requests. Please note that this function is only available in the
143       binary protocol.
144
145       memcached_get_by_key() and memcached_mget_by_key() behave in a similar
146       nature as memcached_get() and memcached_mget(). The difference is that
147       they take a master key that is used for determining which server an
148       object was stored if key partitioning was used for storage.
149
150       All of the above functions are not supported when the
151       "MEMCACHED_BEHAVIOR_USE_UDP" has been set. Executing any of these
152       functions with this behavior on will result in
153       "MEMCACHED_NOT_SUPPORTED" being returned or, for those functions which
154       do not return a "memcached_return_t", the error function parameter will
155       be set to "MEMCACHED_NOT_SUPPORTED".
156

RETURN

158       All objects returned must be freed by the calling application.
159       memcached_get() and memcached_fetch() will return NULL on error. You
160       must look at the value of error to determine what the actual error was.
161
162       MEMCACHED_KEY_TOO_BIG is set to error whenever memcached_fetch() was
163       used and the key was set larger then MEMCACHED_MAX_KEY, which was the
164       largest key allowed for the original memcached ascii server.
165

HOME

167       To find out more information please check:
168       <https://launchpad.net/libmemcached>
169

AUTHOR

171       Brian Aker, <brian@tangent.org>
172

SEE ALSO

174       memcached(1) libmemcached(3) memcached_strerror(3)
175
176
177
178                                  2010-06-28              memcached_get.pop(3)
Impressum