memcached 1.2.6 → 1.2.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (225) hide show
  1. data/CHANGELOG +2 -0
  2. data/Manifest +206 -12
  3. data/Rakefile +32 -1
  4. data/ext/extconf.rb +10 -35
  5. data/ext/libmemcached-0.32/AUTHORS +7 -0
  6. data/ext/libmemcached-0.32/COPYING +32 -0
  7. data/ext/libmemcached-0.32/ChangeLog +303 -0
  8. data/ext/libmemcached-0.32/INSTALL +302 -0
  9. data/ext/libmemcached-0.32/Makefile.am +36 -0
  10. data/ext/libmemcached-0.32/Makefile.in +828 -0
  11. data/ext/libmemcached-0.32/NEWS +1 -0
  12. data/ext/libmemcached-0.32/README +33 -0
  13. data/ext/libmemcached-0.32/THANKS +14 -0
  14. data/ext/libmemcached-0.32/TODO +11 -0
  15. data/ext/libmemcached-0.32/aclocal.m4 +1852 -0
  16. data/ext/libmemcached-0.32/clients/Makefile.am +73 -0
  17. data/ext/libmemcached-0.32/clients/Makefile.in +770 -0
  18. data/ext/libmemcached-0.32/clients/client_options.h +32 -0
  19. data/ext/libmemcached-0.32/clients/execute.c +64 -0
  20. data/ext/libmemcached-0.32/clients/execute.h +5 -0
  21. data/ext/libmemcached-0.32/clients/generator.c +74 -0
  22. data/ext/libmemcached-0.32/clients/generator.h +20 -0
  23. data/ext/libmemcached-0.32/clients/memcat.c +178 -0
  24. data/ext/libmemcached-0.32/clients/memcp.c +251 -0
  25. data/ext/libmemcached-0.32/clients/memdump.c +170 -0
  26. data/ext/libmemcached-0.32/clients/memerror.c +80 -0
  27. data/ext/libmemcached-0.32/clients/memflush.c +143 -0
  28. data/ext/libmemcached-0.32/clients/memrm.c +160 -0
  29. data/ext/libmemcached-0.32/clients/memslap.c +441 -0
  30. data/ext/libmemcached-0.32/clients/memstat.c +326 -0
  31. data/ext/libmemcached-0.32/clients/utilities.c +207 -0
  32. data/ext/libmemcached-0.32/clients/utilities.h +41 -0
  33. data/ext/libmemcached-0.32/config.h.in +252 -0
  34. data/ext/libmemcached-0.32/config/compile +143 -0
  35. data/ext/libmemcached-0.32/config/config.guess +1561 -0
  36. data/ext/libmemcached-0.32/config/config.rpath +666 -0
  37. data/ext/libmemcached-0.32/config/config.sub +1686 -0
  38. data/ext/libmemcached-0.32/config/depcomp +630 -0
  39. data/ext/libmemcached-0.32/config/install-sh +520 -0
  40. data/ext/libmemcached-0.32/config/ltmain.sh +8406 -0
  41. data/ext/libmemcached-0.32/config/missing +376 -0
  42. data/ext/libmemcached-0.32/configure +23048 -0
  43. data/ext/libmemcached-0.32/configure.ac +122 -0
  44. data/ext/libmemcached-0.32/docs/Makefile.am +415 -0
  45. data/ext/libmemcached-0.32/docs/Makefile.in +918 -0
  46. data/ext/libmemcached-0.32/docs/libmemcached.pod +123 -0
  47. data/ext/libmemcached-0.32/docs/libmemcached_examples.pod +115 -0
  48. data/ext/libmemcached-0.32/docs/libmemcachedutil.pod +40 -0
  49. data/ext/libmemcached-0.32/docs/memcached_analyze.pod +52 -0
  50. data/ext/libmemcached-0.32/docs/memcached_auto.pod +97 -0
  51. data/ext/libmemcached-0.32/docs/memcached_behavior.pod +224 -0
  52. data/ext/libmemcached-0.32/docs/memcached_callback.pod +123 -0
  53. data/ext/libmemcached-0.32/docs/memcached_create.pod +61 -0
  54. data/ext/libmemcached-0.32/docs/memcached_delete.pod +54 -0
  55. data/ext/libmemcached-0.32/docs/memcached_dump.pod +53 -0
  56. data/ext/libmemcached-0.32/docs/memcached_flush.pod +46 -0
  57. data/ext/libmemcached-0.32/docs/memcached_flush_buffers.pod +42 -0
  58. data/ext/libmemcached-0.32/docs/memcached_generate_hash_value.pod +57 -0
  59. data/ext/libmemcached-0.32/docs/memcached_get.pod +161 -0
  60. data/ext/libmemcached-0.32/docs/memcached_memory_allocators.pod +73 -0
  61. data/ext/libmemcached-0.32/docs/memcached_pool.pod +77 -0
  62. data/ext/libmemcached-0.32/docs/memcached_quit.pod +47 -0
  63. data/ext/libmemcached-0.32/docs/memcached_sasl.pod +63 -0
  64. data/ext/libmemcached-0.32/docs/memcached_server_st.pod +75 -0
  65. data/ext/libmemcached-0.32/docs/memcached_servers.pod +102 -0
  66. data/ext/libmemcached-0.32/docs/memcached_set.pod +187 -0
  67. data/ext/libmemcached-0.32/docs/memcached_stats.pod +82 -0
  68. data/ext/libmemcached-0.32/docs/memcached_strerror.pod +46 -0
  69. data/ext/libmemcached-0.32/docs/memcached_user_data.pod +49 -0
  70. data/ext/libmemcached-0.32/docs/memcached_verbosity.pod +41 -0
  71. data/ext/libmemcached-0.32/docs/memcached_version.pod +56 -0
  72. data/ext/libmemcached-0.32/docs/memcat.pod +37 -0
  73. data/ext/libmemcached-0.32/docs/memcp.pod +40 -0
  74. data/ext/libmemcached-0.32/docs/memdump.pod +31 -0
  75. data/ext/libmemcached-0.32/docs/memerror.pod +30 -0
  76. data/ext/libmemcached-0.32/docs/memflush.pod +35 -0
  77. data/ext/libmemcached-0.32/docs/memrm.pod +34 -0
  78. data/ext/libmemcached-0.32/docs/memslap.pod +33 -0
  79. data/ext/libmemcached-0.32/docs/memstat.pod +35 -0
  80. data/ext/libmemcached-0.32/libmemcached/Makefile.am +107 -0
  81. data/ext/libmemcached-0.32/libmemcached/Makefile.in +1050 -0
  82. data/ext/libmemcached-0.32/libmemcached/byteorder.c +31 -0
  83. data/ext/libmemcached-0.32/libmemcached/common.h +183 -0
  84. data/ext/libmemcached-0.32/libmemcached/crc.c +86 -0
  85. data/ext/libmemcached-0.32/libmemcached/hsieh_hash.c +68 -0
  86. data/ext/libmemcached-0.32/libmemcached/jenkins_hash.c +213 -0
  87. data/ext/libmemcached-0.32/libmemcached/libmemcached.ver +1 -0
  88. data/ext/libmemcached-0.32/libmemcached/libmemcached_probes.d +28 -0
  89. data/ext/libmemcached-0.32/libmemcached/libmemcached_probes.h +78 -0
  90. data/ext/libmemcached-0.32/libmemcached/md5.c +354 -0
  91. data/ext/libmemcached-0.32/libmemcached/memcached.c +152 -0
  92. data/ext/libmemcached-0.32/libmemcached/memcached.h +302 -0
  93. data/ext/libmemcached-0.32/libmemcached/memcached.hpp +799 -0
  94. data/ext/libmemcached-0.32/libmemcached/memcached/README.txt +7 -0
  95. data/ext/libmemcached-0.32/libmemcached/memcached/protocol_binary.h +366 -0
  96. data/ext/libmemcached-0.32/libmemcached/memcached_allocators.c +72 -0
  97. data/ext/libmemcached-0.32/libmemcached/memcached_analyze.c +100 -0
  98. data/ext/libmemcached-0.32/libmemcached/memcached_auto.c +207 -0
  99. data/ext/libmemcached-0.32/libmemcached/memcached_behavior.c +285 -0
  100. data/ext/libmemcached-0.32/libmemcached/memcached_callback.c +175 -0
  101. data/ext/libmemcached-0.32/libmemcached/memcached_configure.h.in +23 -0
  102. data/ext/libmemcached-0.32/libmemcached/memcached_connect.c +361 -0
  103. data/ext/libmemcached-0.32/libmemcached/memcached_constants.h +145 -0
  104. data/ext/libmemcached-0.32/libmemcached/memcached_delete.c +0 -0
  105. data/ext/libmemcached-0.32/libmemcached/memcached_do.c +34 -0
  106. data/ext/libmemcached-0.32/libmemcached/memcached_dump.c +79 -0
  107. data/ext/libmemcached-0.32/libmemcached/memcached_fetch.c +102 -0
  108. data/ext/libmemcached-0.32/libmemcached/memcached_flush.c +89 -0
  109. data/ext/libmemcached-0.32/libmemcached/memcached_flush_buffers.c +22 -0
  110. data/ext/libmemcached-0.32/libmemcached/memcached_get.c +495 -0
  111. data/ext/libmemcached-0.32/libmemcached/memcached_get.h +87 -0
  112. data/ext/libmemcached-0.32/libmemcached/memcached_hash.c +252 -0
  113. data/ext/libmemcached-0.32/libmemcached/memcached_hosts.c +510 -0
  114. data/ext/libmemcached-0.32/libmemcached/memcached_internal.h +31 -0
  115. data/ext/libmemcached-0.32/libmemcached/memcached_io.c +547 -0
  116. data/ext/libmemcached-0.32/libmemcached/memcached_io.h +59 -0
  117. data/ext/libmemcached-0.32/libmemcached/memcached_key.c +28 -0
  118. data/ext/libmemcached-0.32/libmemcached/memcached_parse.c +74 -0
  119. data/ext/libmemcached-0.32/libmemcached/memcached_pool.h +38 -0
  120. data/ext/libmemcached-0.32/libmemcached/memcached_purge.c +76 -0
  121. data/ext/libmemcached-0.32/libmemcached/memcached_quit.c +75 -0
  122. data/ext/libmemcached-0.32/libmemcached/memcached_response.c +528 -0
  123. data/ext/libmemcached-0.32/libmemcached/memcached_result.c +57 -0
  124. data/ext/libmemcached-0.32/libmemcached/memcached_result.h +59 -0
  125. data/ext/libmemcached-0.32/libmemcached/memcached_sasl.c +225 -0
  126. data/ext/libmemcached-0.32/libmemcached/memcached_sasl.h +44 -0
  127. data/ext/libmemcached-0.32/libmemcached/memcached_server.c +159 -0
  128. data/ext/libmemcached-0.32/libmemcached/memcached_server.h +93 -0
  129. data/ext/libmemcached-0.32/libmemcached/memcached_stats.c +454 -0
  130. data/ext/libmemcached-0.32/libmemcached/memcached_storage.c +514 -0
  131. data/ext/libmemcached-0.32/libmemcached/memcached_storage.h +107 -0
  132. data/ext/libmemcached-0.32/libmemcached/memcached_strerror.c +92 -0
  133. data/ext/libmemcached-0.32/libmemcached/memcached_string.c +138 -0
  134. data/ext/libmemcached-0.32/libmemcached/memcached_string.h +53 -0
  135. data/ext/libmemcached-0.32/libmemcached/memcached_types.h +44 -0
  136. data/ext/libmemcached-0.32/libmemcached/memcached_util.h +15 -0
  137. data/ext/libmemcached-0.32/libmemcached/memcached_verbosity.c +36 -0
  138. data/ext/libmemcached-0.32/libmemcached/memcached_version.c +112 -0
  139. data/ext/libmemcached-0.32/libmemcached/memcached_watchpoint.h +38 -0
  140. data/ext/libmemcached-0.32/libmemcached/murmur_hash.c +76 -0
  141. data/ext/libmemcached-0.32/libmemcached/visibility.h +51 -0
  142. data/ext/libmemcached-0.32/libmemcachedutil/Makefile.am +11 -0
  143. data/ext/libmemcached-0.32/libmemcachedutil/Makefile.in +602 -0
  144. data/ext/libmemcached-0.32/libmemcachedutil/libmemcachedutil.ver +1 -0
  145. data/ext/libmemcached-0.32/libmemcachedutil/memcached_pool.c +170 -0
  146. data/ext/libmemcached-0.32/m4/ac_cxx_compile_stdcxx_0x.m4 +103 -0
  147. data/ext/libmemcached-0.32/m4/ac_cxx_header_stdcxx_98.m4 +67 -0
  148. data/ext/libmemcached-0.32/m4/acx_pthread.m4 +276 -0
  149. data/ext/libmemcached-0.32/m4/byteorder.m4 +40 -0
  150. data/ext/libmemcached-0.32/m4/deprecated.m4 +17 -0
  151. data/ext/libmemcached-0.32/m4/enable_utillib.m4 +16 -0
  152. data/ext/libmemcached-0.32/m4/extensions.m4 +94 -0
  153. data/ext/libmemcached-0.32/m4/hsieh.m4 +18 -0
  154. data/ext/libmemcached-0.32/m4/lib-prefix.m4 +221 -0
  155. data/ext/libmemcached-0.32/m4/libtool.m4 +7360 -0
  156. data/ext/libmemcached-0.32/m4/ltoptions.m4 +368 -0
  157. data/ext/libmemcached-0.32/m4/ltsugar.m4 +123 -0
  158. data/ext/libmemcached-0.32/m4/ltversion.m4 +23 -0
  159. data/ext/libmemcached-0.32/m4/lt~obsolete.m4 +92 -0
  160. data/ext/libmemcached-0.32/m4/memcached.m4 +30 -0
  161. data/ext/libmemcached-0.32/m4/pandora_64bit.m4 +55 -0
  162. data/ext/libmemcached-0.32/m4/pandora_canonical.m4 +151 -0
  163. data/ext/libmemcached-0.32/m4/pandora_check_compiler_version.m4 +37 -0
  164. data/ext/libmemcached-0.32/m4/pandora_check_cxx_standard.m4 +16 -0
  165. data/ext/libmemcached-0.32/m4/pandora_enable_dtrace.m4 +41 -0
  166. data/ext/libmemcached-0.32/m4/pandora_ensure_gcc_version.m4 +36 -0
  167. data/ext/libmemcached-0.32/m4/pandora_have_better_malloc.m4 +54 -0
  168. data/ext/libmemcached-0.32/m4/pandora_have_sasl.m4 +133 -0
  169. data/ext/libmemcached-0.32/m4/pandora_header_assert.m4 +23 -0
  170. data/ext/libmemcached-0.32/m4/pandora_libtool.m4 +15 -0
  171. data/ext/libmemcached-0.32/m4/pandora_optimize.m4 +79 -0
  172. data/ext/libmemcached-0.32/m4/pandora_shared_ptr.m4 +56 -0
  173. data/ext/libmemcached-0.32/m4/pandora_vc_build.m4 +32 -0
  174. data/ext/libmemcached-0.32/m4/pandora_warnings.m4 +262 -0
  175. data/ext/libmemcached-0.32/m4/pod2man.m4 +7 -0
  176. data/ext/libmemcached-0.32/m4/protocol_binary.m4 +23 -0
  177. data/ext/libmemcached-0.32/m4/setsockopt.m4 +57 -0
  178. data/ext/libmemcached-0.32/m4/visibility.m4 +52 -0
  179. data/ext/libmemcached-0.32/support/Makefile.am +4 -0
  180. data/ext/libmemcached-0.32/support/Makefile.in +485 -0
  181. data/ext/libmemcached-0.32/support/libmemcached-fc.spec.in +105 -0
  182. data/ext/libmemcached-0.32/support/libmemcached.pc.in +10 -0
  183. data/ext/libmemcached-0.32/support/libmemcached.spec +105 -0
  184. data/ext/libmemcached-0.32/support/libmemcached.spec.in +105 -0
  185. data/ext/libmemcached-0.32/support/set_benchmark.sh +5 -0
  186. data/ext/libmemcached-0.32/tests/Makefile.am +105 -0
  187. data/ext/libmemcached-0.32/tests/Makefile.in +748 -0
  188. data/ext/libmemcached-0.32/tests/atomsmasher.c +245 -0
  189. data/ext/libmemcached-0.32/tests/function.c +4781 -0
  190. data/ext/libmemcached-0.32/tests/ketama_test_cases.h +108 -0
  191. data/ext/libmemcached-0.32/tests/output.cmp +7 -0
  192. data/ext/libmemcached-0.32/tests/output.res +7 -0
  193. data/ext/libmemcached-0.32/tests/output2.res +46 -0
  194. data/ext/libmemcached-0.32/tests/plus.cpp +293 -0
  195. data/ext/libmemcached-0.32/tests/r/memcat.res +19 -0
  196. data/ext/libmemcached-0.32/tests/r/memcp.res +27 -0
  197. data/ext/libmemcached-0.32/tests/r/memrm.res +19 -0
  198. data/ext/libmemcached-0.32/tests/r/memslap.res +33 -0
  199. data/ext/libmemcached-0.32/tests/r/memstat.res +33 -0
  200. data/ext/libmemcached-0.32/tests/server.c +118 -0
  201. data/ext/libmemcached-0.32/tests/server.h +25 -0
  202. data/ext/libmemcached-0.32/tests/start.c +16 -0
  203. data/ext/libmemcached-0.32/tests/t/memcat.test +4 -0
  204. data/ext/libmemcached-0.32/tests/t/memcp.test +3 -0
  205. data/ext/libmemcached-0.32/tests/t/memrm.test +3 -0
  206. data/ext/libmemcached-0.32/tests/t/memslap.test +5 -0
  207. data/ext/libmemcached-0.32/tests/t/memstat.test +3 -0
  208. data/ext/libmemcached-0.32/tests/test.c +137 -0
  209. data/ext/libmemcached-0.32/tests/test.h +46 -0
  210. data/ext/libmemcached-0.32/tests/udp.c +76 -0
  211. data/memcached.gemspec +4 -4
  212. data/test/unit/memcached_test.rb +30 -0
  213. metadata +213 -16
  214. data/ext/libmemcached-0.32.tar.gz +0 -0
  215. data/ext/libmemcached-1.patch +0 -270
  216. data/ext/libmemcached-10.patch +0 -12
  217. data/ext/libmemcached-2.patch +0 -116
  218. data/ext/libmemcached-3.patch +0 -8
  219. data/ext/libmemcached-4.patch +0 -40
  220. data/ext/libmemcached-5.patch +0 -832
  221. data/ext/libmemcached-6.patch +0 -20
  222. data/ext/libmemcached-7.patch +0 -2989
  223. data/ext/libmemcached-8.patch +0 -137
  224. data/ext/libmemcached-9.patch +0 -13
  225. data/ext/sasl.patch +0 -29283
@@ -0,0 +1,123 @@
1
+ =head1 NAME
2
+
3
+ libmemcached - Client library for memcached
4
+
5
+ =head1 LIBRARY
6
+
7
+ C Client Library for memcached (libmemcached, -lmemcached)
8
+
9
+ =head1 SYNOPSIS
10
+
11
+ #include <memcached.h>
12
+
13
+ =head1 DESCRIPTION
14
+
15
+ "Memcached is a high-performance, distributed memory object caching
16
+ system, generic in nature, but intended for use in speeding up dynamic web
17
+ applications by alleviating database load." L<http://danga.com/memcached/>
18
+
19
+ B<libmemcached> is a small, thread-safe client library for the
20
+ memcached protocol. The code has all been written with an eye to allow
21
+ for both web and embedded usage. It handles the work behind routing
22
+ particular keys to specific servers that you specify (and values are
23
+ matched based on server order as supplied by you). It implements both
24
+ a modula and consistent method of object distribution.
25
+
26
+ There are multiple implemented routing and hashing methods. See the
27
+ memcached_behavior_set() manpage.
28
+
29
+ All operations are performed against a C<memcached_st> structure.
30
+ These structures can either be dynamically allocated or statically
31
+ allocated and then initialized by memcached_create(). Functions have been
32
+ written in order to encapsulate the C<memcached_st>. It is not
33
+ recommended that you operate directly against the structure.
34
+
35
+ Nearly all functions return a C<memcached_return> value.
36
+ This value can be translated to a printable string with memcached_strerror(3).
37
+
38
+ Partitioning based on keys is supported in the library. Using the key partioning
39
+ functions it is possible to group sets of object onto servers.
40
+
41
+ C<memcached_st> structures are thread-safe, but each thread must
42
+ contain its own structure (that is, if you want to share these among
43
+ threads you must provide your own locking). No global variables are
44
+ used in this library.
45
+
46
+ If you are working with GNU autotools you will want to add the following to
47
+ your configure.ac to properly include libmemcached in your application.
48
+
49
+ PKG_CHECK_MODULES(DEPS, libmemcached >= 0.8.0)
50
+ AC_SUBST(DEPS_CFLAGS)
51
+ AC_SUBST(DEPS_LIBS)
52
+
53
+ Some features of the library must be enabled through memcached_behavior_set().
54
+
55
+ Hope you enjoy it!
56
+
57
+ =head1 CONSTANTS
58
+
59
+ A number of constants have been provided for in the library.
60
+
61
+ =over 4
62
+
63
+ =item MEMCACHED_DEFAULT_PORT
64
+
65
+ The default port used by memcached(3).
66
+
67
+ =item MEMCACHED_MAX_KEY
68
+
69
+ Default maximum size of a key (which includes the null pointer). Master keys
70
+ have no limit, this only applies to keys used for storage.
71
+
72
+ =item MEMCACHED_MAX_KEY
73
+
74
+ Default size of key (which includes the null pointer).
75
+
76
+ =item MEMCACHED_MAX_HOST_LENGTH
77
+
78
+ Maximum allowed size of the hostname.
79
+
80
+ =item MEMCACHED_VERSION_STRING
81
+
82
+ String value of libmemcached version such as "1.23.4"
83
+
84
+ =item MEMCACHED_MAJOR_VERSION
85
+
86
+ Major version value. Such as 1.23.4, would be 1
87
+
88
+ =item MEMCACHED_MINOR_VERSION
89
+
90
+ Major version value. Such as 1.23.4, would be 23
91
+
92
+ =item MEMCACHED_MICRO_VERSION
93
+
94
+ Major version value. Such as 1.23.4, would be 4
95
+
96
+
97
+ =back
98
+
99
+
100
+
101
+ =head1 THREADS AND PROCESSES
102
+
103
+ When using threads or forked processes it is important to keep an instance
104
+ of C<memcached_st> per process or thread. Without creating your own locking
105
+ structures you can not share a single C<memcached_st>. You can though call
106
+ memcached_quit(3) on a C<memcached_st> and then use the resulting cloned
107
+ structure.
108
+
109
+ =head1 HOME
110
+
111
+ To find out more information please check:
112
+ L<http://tangent.org/552/libmemcached.html>
113
+
114
+ =head1 AUTHOR
115
+
116
+ Brian Aker, E<lt>brian@tangent.orgE<gt>
117
+
118
+ =head1 SEE ALSO
119
+
120
+ memcached(1) libmemcached_examples(3) libmemcached(1) memcat(1) memcp(1) memflush(1) memrm(1) memslap(1) memstat(1) memcached_fetch(3) memcached_replace(3) memcached_server_list_free(3) libmemcached_examples(3) memcached_clone(3) memcached_free(3) memcached_server_add(3) memcached_server_push(3) memcached_add(3) memcached_get(3) memcached_server_count(3) memcached_servers_parse(3) memcached_create(3) memcached_increment(3) memcached_server_list(3) memcached_set(3) memcached_decrement(3) memcached_mget(3) memcached_server_list_append(3) memcached_strerror(3) memcached_delete(3) memcached_quit(3) memcached_server_list_count(3) memcached_verbosity(3) memcached_server_add_unix_socket(3) memcached_result_create(3) memcached_result_free(3) memcached_result_key_value(3) memcached_result_key_length(3) memcached_result_value(3) memcached_result_length(3) memcached_result_flags(3) memcached_result_cas(3) memcached_result_st(3) memcached_append(3) memcached_prepend(3) memcached_fetch_result(3) memerror(1) memcached_get_by_key(3) memcached_mget_by_key(3) memcached_delete_by_key(3) memcached_fetch_execute(3) memcached_callback_get(3) memcached_callback_set(3) memcached_version(3) memcached_lib_version(3) memcached_result_set_value(3) memcached_dump(3) memdump(1) memcached_set_memory_allocators(3) memcached_get_memory_allocators(3) memcached_get_user_data(3) memcached_set_user_data(3)
121
+
122
+ =cut
123
+
@@ -0,0 +1,115 @@
1
+ =head1 NAME
2
+
3
+ libmemcached_examples - Examples for libmemcached
4
+
5
+ =head1 DESCRIPTION
6
+
7
+ For full examples, test cases are found in tests/*.c in the main
8
+ distribution. These are always up to date, and are used for each test run of
9
+ the library.
10
+
11
+ =head2 Creating and Freeing structure
12
+
13
+ memcached_st *memc;
14
+ memcached_return rc;
15
+
16
+ memc= memcached_create(NULL);
17
+ ...do stuff...
18
+ memcached_free(memc);
19
+
20
+ The above code would create a connection and then free the connection when
21
+ finished.
22
+
23
+ =head2 Connecting to servers
24
+
25
+ memcached_server_st *servers;
26
+ memcached_st *memc= memcached_create(NULL);
27
+ char servername[]= "0.example.com";
28
+
29
+ servers= memcached_server_list_append(NULL, servername, 400, &rc);
30
+
31
+ for (x= 0; x < 20; x++)
32
+ {
33
+ char buffer[SMALL_STRING_LEN];
34
+
35
+ snprintf(buffer, SMALL_STRING_LEN, "%u.example.com", 400+x);
36
+ servers= memcached_server_list_append(servers, buffer, 401, &rc);
37
+ }
38
+ rc= memcached_server_push(memc, servers);
39
+ memcached_server_free(servers);
40
+ memcached_free(memc);
41
+
42
+ In the above code you create a C<memcached_st> object that you then feed in a
43
+ single host into. In the for loop you build a C<memcached_server_st>
44
+ pointer that you then later feed via memcached_server_push() into the
45
+ C<memcached_st> structure.
46
+
47
+ You can reuse the C<memcached_server_st> object with multile C<memcached_st>
48
+ structures.
49
+
50
+ =head2 Adding a value to the server
51
+
52
+ char *key= "foo";
53
+ char *value;
54
+ size_t value_length= 8191;
55
+ unsigned int x;
56
+
57
+ value = (char*)malloc(value_length);
58
+ assert(value);
59
+
60
+ for (x= 0; x < value_length; x++)
61
+ value[x] = (char) (x % 127);
62
+
63
+ for (x= 0; x < 1; x++)
64
+ {
65
+ rc= memcached_set(memc, key, strlen(key),
66
+ value, value_length,
67
+ (time_t)0, (uint32_t)0);
68
+ assert(rc == MEMCACHED_SUCCESS);
69
+ }
70
+
71
+ free(value);
72
+
73
+ It is best practice to always look at the return value of any operation.
74
+
75
+ =head2 Fetching multiple values
76
+
77
+ memcached_return rc;
78
+ char *keys[]= {"fudge", "son", "food"};
79
+ size_t key_length[]= {5, 3, 4};
80
+ unsigned int x;
81
+ uint32_t flags;
82
+
83
+ char return_key[MEMCACHED_MAX_KEY];
84
+ size_t return_key_length;
85
+ char *return_value;
86
+ size_t return_value_length;
87
+
88
+ rc= memcached_mget(memc, keys, key_length, 3);
89
+
90
+ x= 0;
91
+ while ((return_value= memcached_fetch(memc, return_key, &return_key_length,
92
+ &return_value_length, &flags, &rc)))
93
+ {
94
+ free(return_value);
95
+ x++;
96
+ }
97
+
98
+ Notice that you freed values returned from memcached_fetch(). The define
99
+ C<MEMCACHED_MAX_KEY> is provided for usage.
100
+
101
+ =head1 HOME
102
+
103
+ To find out more information please check:
104
+ L<http://tangent.org/552/libmemcached.html>
105
+
106
+ =head1 AUTHOR
107
+
108
+ Brian Aker, E<lt>brian@tangent.orgE<gt>
109
+
110
+ =head1 SEE ALSO
111
+
112
+ memcached(1)
113
+
114
+ =cut
115
+
@@ -0,0 +1,40 @@
1
+ =head1 NAME
2
+
3
+ libmemcachedutil - Utility library for libmemcached
4
+
5
+ =head1 LIBRARY
6
+
7
+ C Client Library containing utility functions for libmemcached (libmemcachedutil, -lmemcachedutil)
8
+
9
+ =head1 SYNOPSIS
10
+
11
+ cc [ flag ... ] file ... -lmemcachedutil
12
+
13
+ #include <libmemcached/memcached_util.h>
14
+
15
+ =head1 DESCRIPTION
16
+
17
+ B<libmemcachedutil> is a small and thread-safe client library that provides
18
+ extra functionality built on top of B<libmemcached>.
19
+
20
+ =head1 THREADS
21
+
22
+ Do not try to access an instance of C<memcached_st> from multiple threads
23
+ at the same time. If you want to access memcached from multiple threads
24
+ you should either clone the C<memcached_st>, or use the memcached pool
25
+ implementation. see memcached_pool_create(3).
26
+
27
+ =head1 HOME
28
+
29
+ To find out more information please check:
30
+ L<http://tangent.org/552/libmemcached.html>
31
+
32
+ =head1 AUTHOR
33
+
34
+ Trond Norbye, E<lt>trond.norbye@sun.comE<gt>
35
+
36
+ =head1 SEE ALSO
37
+
38
+ libmemcached(3) memcached_pool_create(3) memcached_pool_destroy(3) memcached_pool_pop(3) memcached_pool_push(3)
39
+
40
+ =cut
@@ -0,0 +1,52 @@
1
+ =head1 NAME
2
+
3
+ memcached_analyze - Analyze server information
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_analysis_st *memcached_analyze(memcached_st *ptr,
14
+ memcached_stat_st *stat,
15
+ memcached_return *error);
16
+
17
+ =head1 DESCRIPTION
18
+
19
+ libmemcached(3) has the ability to query a memcached server (or collection
20
+ of servers) for their current state. Queries to find state return a
21
+ C<memcached_analysis_st> structure. You are responsible for freeing this structure.
22
+
23
+ memcached_analyze() analyzes useful information based on the provided servers
24
+ and sets the result to the C<memcached_analysis_st> structure. The return value
25
+ must be freed by the calling application.
26
+
27
+ A command line tool, memstat(1) with the option --analyze, is provided so that
28
+ you do not have to write an application to use this method.
29
+
30
+ =head1 RETURN
31
+
32
+ A pointer to the allocated C<memcached_analysis_st> structure on success and
33
+ a NULL pointer on failure. You may inspect the error detail by checking the
34
+ C<memcached_return> value.
35
+
36
+ Any method returning a C<memcached_analysis_st> expects you to free the
37
+ memory allocated for it.
38
+
39
+ =head1 HOME
40
+
41
+ To find out more information please check:
42
+ L<http://tangent.org/552/libmemcached.html>
43
+
44
+ =head1 AUTHOR
45
+
46
+ Toru Maesaka, E<lt>dev@torum.netE<gt>
47
+
48
+ =head1 SEE ALSO
49
+
50
+ memcached(1) libmemcached(3) memcached_strerror(3)
51
+
52
+ =cut
@@ -0,0 +1,97 @@
1
+ =head1 NAME
2
+
3
+ memcached_increment, memcached_decrement,
4
+ memcached_increment_with_initial, memcached_decrement_with_initial - Manipulate
5
+ counters
6
+
7
+ =head1 LIBRARY
8
+
9
+ C Client Library for memcached (libmemcached, -lmemcached)
10
+
11
+ =head1 SYNOPSIS
12
+
13
+ #include <memcached.h>
14
+
15
+ memcached_return
16
+ memcached_increment (memcached_st *ptr,
17
+ const char *key, size_t key_length,
18
+ unsigned int offset,
19
+ uint64_t *value);
20
+
21
+ memcached_return
22
+ memcached_decrement (memcached_st *ptr,
23
+ const char *key, size_t key_length,
24
+ unsigned int offset,
25
+ uint64_t *value);
26
+
27
+ memcached_return
28
+ memcached_increment_with_initial (memcached_st *ptr,
29
+ const char *key,
30
+ size_t key_length,
31
+ uint64_t offset,
32
+ uint64_t initial,
33
+ time_t expiration,
34
+ uint64_t *value);
35
+
36
+ memcached_return
37
+ memcached_decrement_with_initial (memcached_st *ptr,
38
+ const char *key,
39
+ size_t key_length,
40
+ uint64_t offset,
41
+ uint64_t initial,
42
+ time_t expiration,
43
+ uint64_t *value);
44
+
45
+ =head1 DESCRIPTION
46
+
47
+ memcached(1) servers have the ability to increment and decrement keys
48
+ (overflow and underflow are not detected). This gives you the ability to use
49
+ memcached to generate shared sequences of values.
50
+
51
+ memcached_increment() takes a key and keylength and increments the value by
52
+ the offset passed to it. The value is then returned via the unsigned int
53
+ value pointer you pass to it.
54
+
55
+ memcached_decrement() takes a key and keylength and decrements the value by
56
+ the offset passed to it. The value is then returned via the unsigned int
57
+ value pointer you pass to it.
58
+
59
+ memcached_increment_with_initial() takes a key and keylength and increments
60
+ the value by the offset passed to it. If the object specified by key does
61
+ not exist, one of two things may happen: If the expiration value is
62
+ MEMCACHED_EXPIRATION_NOT_ADD, the operation will fail. For all other
63
+ expiration values, the operation will succeed by seeding the value for that
64
+ key with a initial value to expire with the provided expiration time. The
65
+ flags will be set to zero.The value is then returned via the unsigned int
66
+ value pointer you pass to it.
67
+
68
+ memcached_decrement_with_initial() takes a key and keylength and decrements
69
+ the value by the offset passed to it. If the object specified by key does
70
+ not exist, one of two things may happen: If the expiration value is
71
+ MEMCACHED_EXPIRATION_NOT_ADD, the operation will fail. For all other
72
+ expiration values, the operation will succeed by seeding the value for that
73
+ key with a initial value to expire with the provided expiration time. The
74
+ flags will be set to zero.The value is then returned via the unsigned int
75
+ value pointer you pass to it.
76
+
77
+ =head1 RETURN
78
+
79
+ A value of type C<memcached_return> is returned.
80
+ On success that value will be C<MEMCACHED_SUCCESS>.
81
+ Use memcached_strerror() to translate this value to a printable string.
82
+
83
+ =head1 HOME
84
+
85
+ To find out more information please check:
86
+ L<http://tangent.org/552/libmemcached.html>
87
+
88
+ =head1 AUTHOR
89
+
90
+ Brian Aker, E<lt>brian@tangent.orgE<gt>
91
+
92
+ =head1 SEE ALSO
93
+
94
+ memcached(1) libmemcached(3) memcached_strerror(3)
95
+
96
+ =cut
97
+
@@ -0,0 +1,224 @@
1
+ =head1 NAME
2
+
3
+ memcached_behavior_get, memcached_behavior_set - Manipulate behavior
4
+
5
+ =head1 LIBRARY
6
+
7
+ C Client Library for memcached (libmemcached, -lmemcached)
8
+
9
+ =head1 SYNOPSIS
10
+
11
+ #include <memcached.h>
12
+
13
+ uint64_t
14
+ memcached_behavior_get (memcached_st *ptr,
15
+ memcached_behavior flag);
16
+
17
+ memcached_return
18
+ memcached_behavior_set (memcached_st *ptr,
19
+ memcached_behavior flag,
20
+ uint64_t data);
21
+
22
+ =head1 DESCRIPTION
23
+
24
+ libmemcached(3) behavior can be modified by use memcached_behavior_set().
25
+ Default behavior is the library strives to be quick and accurate. Some
26
+ behavior, while being faster, can also result in not entirely accurate
27
+ behavior (for instance, memcached_set() will always respond with
28
+ C<MEMCACHED_SUCCESS>).
29
+
30
+ memcached_behavior_get() takes a behavior flag and returns whether or not
31
+ that behavior is currently enabled in the client.
32
+
33
+ memcached_behavior_set() changes the value of a particular option of the
34
+ client. It takes both a flag (listed below) and a value. For simple on or
35
+ off options you just need to pass in a value of 1. Calls to
36
+ memcached_behavior_set() will flush and reset all connections.
37
+
38
+ =over 4
39
+
40
+ =item MEMCACHED_BEHAVIOR_USE_UDP
41
+
42
+ Causes libmemcached(3) to use the UDP transport when communicating
43
+ with a memcached server. Not all I/O operations are supported
44
+ when this behavior is enababled. The following operations will return
45
+ C<MEMCACHED_NOT_SUPPORTED> when executed with the MEMCACHED_BEHAVIOR_USE_UDP
46
+ enabled: memcached_version(), memcached_stat(), memcached_get(),
47
+ memcached_get_by_key(), memcached_mget(), memcached_mget_by_key(),
48
+ memcached_fetch(), memcached_fetch_result(), memcached_value_fetch().
49
+
50
+ All other operations are supported but are executed in a 'fire-and-forget'
51
+ mode, in which once the client has executed the operation, no attempt
52
+ will be made to ensure the operation has been received and acted on by the
53
+ server.
54
+
55
+ libmemcached(3) does not allow TCP and UDP servers to be shared within
56
+ the same libmemached(3) client 'instance'. An attempt to add a TCP server
57
+ when this behavior is enabled will result in a C<MEMCACHED_INVALID_HOST_PROTOCOL>,
58
+ as will attempting to add a UDP server when this behavior has not been enabled.
59
+
60
+ =item MEMCACHED_BEHAVIOR_NO_BLOCK
61
+
62
+ Causes libmemcached(3) to use asychronous IO. This is the fastest transport
63
+ available for storage functions.
64
+
65
+ =item MEMCACHED_BEHAVIOR_SND_TIMEOUT
66
+
67
+ This sets the microsecond behavior of the socket against the SO_SNDTIMEO flag.
68
+ In cases where you cannot use non-blocking IO this will allow you to still have
69
+ timeouts on the sending of data.
70
+
71
+ =item MEMCACHED_BEHAVIOR_RCV_TIMEOUT
72
+
73
+ This sets the microsecond behavior of the socket against the SO_RCVTIMEO flag.
74
+ In cases where you cannot use non-blocking IO this will allow you to still have
75
+ timeouts on the reading of data.
76
+
77
+ =item MEMCACHED_BEHAVIOR_TCP_NODELAY
78
+
79
+ Turns on the no-delay feature for connecting sockets (may be faster in some
80
+ environments).
81
+
82
+ =item MEMCACHED_BEHAVIOR_HASH
83
+
84
+ Makes the default hashing algorithm for keys use MD5. The value can be set
85
+ to either MEMCACHED_HASH_DEFAULT, MEMCACHED_HASH_MD5, MEMCACHED_HASH_CRC, MEMCACHED_HASH_FNV1_64, MEMCACHED_HASH_FNV1A_64, MEMCACHED_HASH_FNV1_32, MEMCACHED_HASH_FNV1A_32, MEMCACHED_HASH_JENKINS, MEMCACHED_HASH_HSIEH, and MEMCACHED_HASH_MURMUR.
86
+ Each hash has it's advantages and it's weaknesses. If you dont know or dont care, just go with the default.
87
+ Support for MEMCACHED_HASH_HSIEH is a compile time option that is disabled by default. To enable support for this hashing algorithm, configure and build libmemcached with the --enable-hash_hsieh.
88
+
89
+ =item MEMCACHED_BEHAVIOR_DISTRIBUTION
90
+
91
+ Using this you can enable different means of distributing values to servers.
92
+ The default method is MEMCACHED_DISTRIBUTION_MODULA. You can enable
93
+ consistent hashing by setting MEMCACHED_DISTRIBUTION_CONSISTENT.
94
+ Consistent hashing delivers better distribution and allows servers to be
95
+ added to the cluster with minimal cache losses. Currently
96
+ MEMCACHED_DISTRIBUTION_CONSISTENT is an alias for the value
97
+ MEMCACHED_DISTRIBUTION_CONSISTENT_KETAMA.
98
+
99
+ =item MEMCACHED_BEHAVIOR_CACHE_LOOKUPS
100
+
101
+ Memcached can cache named lookups so that DNS lookups are made only once.
102
+
103
+ =item MEMCACHED_BEHAVIOR_SUPPORT_CAS
104
+
105
+ Support CAS operations (this is not enabled by default at this point in the server since it imposes a slight performance penalty).
106
+
107
+ =item MEMCACHED_BEHAVIOR_KETAMA
108
+
109
+ Sets the default distribution to MEMCACHED_DISTRIBUTION_CONSISTENT_KETAMA
110
+ and the hash to MEMCACHED_HASH_MD5.
111
+
112
+ =item MEMCACHED_BEHAVIOR_KETAMA_WEIGHTED
113
+
114
+ Sets the default distribution to MEMCACHED_DISTRIBUTION_CONSISTENT_KETAMA with the weighted support.
115
+ and the hash to MEMCACHED_HASH_MD5.
116
+
117
+ =item MEMCACHED_BEHAVIOR_KETAMA_HASH
118
+
119
+ Sets the hashing algorithm for host mapping on continuum. The value can be set
120
+ to either MEMCACHED_HASH_DEFAULT, MEMCACHED_HASH_MD5, MEMCACHED_HASH_CRC, MEMCACHED_HASH_FNV1_64, MEMCACHED_HASH_FNV1A_64, MEMCACHED_HASH_FNV1_32, and MEMCACHED_HASH_FNV1A_32.
121
+
122
+ =item MEMCACHED_BEHAVIOR_POLL_TIMEOUT
123
+
124
+ Modify the timeout value that is used by poll(). The default value is -1. An signed int pointer must be passed to memcached_behavior_set() to change this value. For memcached_behavior_get() a signed int value will be cast and returned as the unsigned long long.
125
+
126
+ =item MEMCACHED_BEHAVIOR_USER_DATA
127
+
128
+ This allows you to store a pointer to a specifc piece of data. This can be
129
+ retrieved from inside of memcached_fetch_execute(). Cloning a memcached_st
130
+
131
+ will copy the pointer to the clone. This was deprecated in 0.14 in favor
132
+ of memcached_callback_set(3). This will be removed in 0.15.
133
+
134
+ =item MEMCACHED_BEHAVIOR_BUFFER_REQUESTS
135
+
136
+ Enabling buffered IO causes commands to "buffer" instead of being sent. Any
137
+ action that gets data causes this buffer to be be sent to the remote
138
+ connection. Quiting the connection or closing down the connection will also
139
+ cause the buffered data to be pushed to the remote connection.
140
+
141
+ =item MEMCACHED_BEHAVIOR_VERIFY_KEY
142
+
143
+ Enabling this will cause libmemcached(3) to test all keys to verify that they
144
+ are valid keys.
145
+
146
+ =item MEMCACHED_BEHAVIOR_SORT_HOSTS
147
+
148
+ Enabling this will cause hosts that are added to be placed in the host list in
149
+ sorted order. This will defeat consisten hashing.
150
+
151
+ =item MEMCACHED_BEHAVIOR_CONNECT_TIMEOUT
152
+
153
+ In non-blocking mode this changes the value of the timeout during socket
154
+ connection.
155
+
156
+ =item MEMCACHED_BEHAVIOR_BINARY_PROTOCOL
157
+
158
+ Enable the use of the binary protocol. Please note that you cannot toggle
159
+ this flag on an open connection.
160
+
161
+ =item MEMCACHED_BEHAVIOR_SERVER_FAILURE_LIMIT
162
+
163
+ Set this value to enable the server be removed after continuous MEMCACHED_BEHAVIOR_SERVER_FAILURE_LIMIT
164
+ times connection failure.
165
+
166
+ =item MEMCACHED_BEHAVIOR_IO_MSG_WATERMARK
167
+
168
+ Set this value to tune the number of messages that may be sent before
169
+ libmemcached should start to automatically drain the input queue. Setting
170
+ this value to high, may cause libmemcached to deadlock (trying to send data,
171
+ but the send will block because the input buffer in the kernel is full).
172
+
173
+ =item MEMCACHED_BEHAVIOR_IO_BYTES_WATERMARK
174
+
175
+ Set this value to tune the number of bytes that may be sent before
176
+ libmemcached should start to automatically drain the input queue (need
177
+ at least 10 IO requests sent without reading the input buffer). Setting
178
+ this value to high, may cause libmemcached to deadlock (trying to send
179
+ data, but the send will block because the input buffer in the kernel is full).
180
+
181
+ =item MEMCACHED_BEHAVIOR_IO_KEY_PREFETCH
182
+
183
+ The binary protocol works a bit different than the textual protocol in
184
+ that a multiget is implemented as a pipe of single get-operations which
185
+ are sent to the server in a chunk. If you are using large multigets from
186
+ your application, you may improve the latency of the gets by setting
187
+ this value so you send out the first chunk of requests when you hit the
188
+ specified limit. It allows the servers to start processing the requests
189
+ to send the data back while the rest of the requests are created and
190
+ sent to the server.
191
+
192
+ =item MEMCACHED_BEHAVIOR_NOREPLY
193
+
194
+ Set this value to specify that you really don't care about the result
195
+ from your storage commands (set, add, replace, append, prepend).
196
+
197
+ =back
198
+
199
+ =head1 RETURN
200
+
201
+ memcached_behavior_get() returns either the current value of the get, or 0
202
+ or 1 on simple flag behaviors (1 being enabled). memcached_behavior_set()
203
+ returns failure or success.
204
+
205
+ =head1 NOTES
206
+
207
+ memcached_behavior_set() in version .17 was changed from taking a pointer
208
+ to data value, to taking a uin64_t.
209
+
210
+ =head1 HOME
211
+
212
+ To find out more information please check:
213
+ L<http://tangent.org/552/libmemcached.html>
214
+
215
+ =head1 AUTHOR
216
+
217
+ Brian Aker, E<lt>brian@tangent.orgE<gt>
218
+
219
+ =head1 SEE ALSO
220
+
221
+ memcached(1) libmemcached(3) memcached_strerror(3)
222
+
223
+ =cut
224
+