nutcracker 0.2.3 → 0.2.4.beta1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (296) hide show
  1. data/README.md +53 -5
  2. data/Rakefile +14 -19
  3. data/bin/nutcracker +6 -1
  4. data/ext/nutcracker/ChangeLog +9 -0
  5. data/ext/nutcracker/LICENSE +0 -0
  6. data/ext/nutcracker/Makefile +643 -0
  7. data/ext/nutcracker/Makefile.am +0 -0
  8. data/ext/nutcracker/Makefile.in +66 -149
  9. data/ext/nutcracker/NOTICE +0 -0
  10. data/ext/nutcracker/README.md +13 -11
  11. data/ext/nutcracker/aclocal.m4 +112 -201
  12. data/ext/nutcracker/autom4te.cache/output.0 +18664 -0
  13. data/ext/nutcracker/autom4te.cache/output.1 +18664 -0
  14. data/ext/nutcracker/autom4te.cache/output.2 +18664 -0
  15. data/ext/nutcracker/autom4te.cache/requests +494 -0
  16. data/ext/nutcracker/autom4te.cache/traces.0 +2415 -0
  17. data/ext/nutcracker/autom4te.cache/traces.1 +945 -0
  18. data/ext/nutcracker/autom4te.cache/traces.2 +2415 -0
  19. data/ext/nutcracker/conf/nutcracker.leaf.yml +0 -0
  20. data/ext/nutcracker/conf/nutcracker.root.yml +0 -0
  21. data/ext/nutcracker/conf/nutcracker.yml +0 -0
  22. data/ext/nutcracker/config.h +332 -0
  23. data/ext/nutcracker/config.h.in +15 -0
  24. data/ext/nutcracker/config.log +2684 -0
  25. data/ext/nutcracker/config.status +2317 -0
  26. data/ext/nutcracker/config/config.guess +23 -84
  27. data/ext/nutcracker/config/config.sub +23 -93
  28. data/ext/nutcracker/config/depcomp +35 -81
  29. data/ext/nutcracker/config/install-sh +109 -122
  30. data/ext/nutcracker/config/ltmain.sh +1053 -721
  31. data/ext/nutcracker/config/missing +20 -29
  32. data/ext/nutcracker/configure +2122 -2320
  33. data/ext/nutcracker/configure.ac +35 -3
  34. data/ext/nutcracker/contrib/Makefile +494 -0
  35. data/ext/nutcracker/contrib/Makefile.am +0 -0
  36. data/ext/nutcracker/contrib/Makefile.in +41 -107
  37. data/ext/nutcracker/contrib/yaml-0.1.4.tar.gz +0 -0
  38. data/ext/nutcracker/contrib/yaml-0.1.4/Makefile +736 -0
  39. data/ext/nutcracker/contrib/yaml-0.1.4/autom4te.cache/output.0 +13102 -0
  40. data/ext/nutcracker/contrib/yaml-0.1.4/autom4te.cache/output.1 +13085 -0
  41. data/ext/nutcracker/contrib/yaml-0.1.4/autom4te.cache/output.2 +13085 -0
  42. data/ext/nutcracker/contrib/yaml-0.1.4/autom4te.cache/requests +476 -0
  43. data/ext/nutcracker/contrib/yaml-0.1.4/autom4te.cache/traces.0 +2339 -0
  44. data/ext/nutcracker/contrib/yaml-0.1.4/autom4te.cache/traces.1 +545 -0
  45. data/ext/nutcracker/contrib/yaml-0.1.4/autom4te.cache/traces.2 +2339 -0
  46. data/ext/nutcracker/contrib/yaml-0.1.4/config.h +81 -0
  47. data/ext/nutcracker/contrib/yaml-0.1.4/config.h.in~ +80 -0
  48. data/ext/nutcracker/contrib/yaml-0.1.4/config.log +688 -0
  49. data/ext/nutcracker/contrib/yaml-0.1.4/config.status +2032 -0
  50. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/annotated.html +51 -0
  51. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/bc_s.png +0 -0
  52. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/classes.html +41 -0
  53. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/closed.png +0 -0
  54. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/doxygen.css +656 -0
  55. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/doxygen.png +0 -0
  56. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/files.html +40 -0
  57. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions.html +91 -0
  58. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_0x62.html +84 -0
  59. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_0x63.html +87 -0
  60. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_0x64.html +83 -0
  61. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_0x65.html +110 -0
  62. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_0x66.html +79 -0
  63. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_0x68.html +80 -0
  64. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_0x69.html +92 -0
  65. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_0x6b.html +71 -0
  66. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_0x6c.html +88 -0
  67. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_0x6d.html +96 -0
  68. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_0x6e.html +71 -0
  69. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_0x6f.html +80 -0
  70. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_0x70.html +100 -0
  71. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_0x71.html +71 -0
  72. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_0x72.html +87 -0
  73. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_0x73.html +163 -0
  74. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_0x74.html +115 -0
  75. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_0x75.html +71 -0
  76. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_0x76.html +80 -0
  77. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_0x77.html +77 -0
  78. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_vars.html +91 -0
  79. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_vars_0x62.html +84 -0
  80. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_vars_0x63.html +87 -0
  81. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_vars_0x64.html +83 -0
  82. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_vars_0x65.html +110 -0
  83. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_vars_0x66.html +79 -0
  84. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_vars_0x68.html +80 -0
  85. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_vars_0x69.html +92 -0
  86. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_vars_0x6b.html +71 -0
  87. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_vars_0x6c.html +88 -0
  88. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_vars_0x6d.html +96 -0
  89. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_vars_0x6e.html +71 -0
  90. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_vars_0x6f.html +80 -0
  91. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_vars_0x70.html +100 -0
  92. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_vars_0x71.html +71 -0
  93. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_vars_0x72.html +87 -0
  94. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_vars_0x73.html +163 -0
  95. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_vars_0x74.html +115 -0
  96. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_vars_0x75.html +71 -0
  97. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_vars_0x76.html +80 -0
  98. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_vars_0x77.html +77 -0
  99. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/globals.html +667 -0
  100. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/globals_defs.html +81 -0
  101. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/globals_enum.html +78 -0
  102. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/globals_eval.html +373 -0
  103. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/globals_func.html +196 -0
  104. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/globals_type.html +126 -0
  105. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/group__basic.html +320 -0
  106. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/group__emitter.html +819 -0
  107. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/group__events.html +664 -0
  108. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/group__export.html +60 -0
  109. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/group__nodes.html +795 -0
  110. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/group__parser.html +606 -0
  111. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/group__styles.html +222 -0
  112. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/group__tokens.html +246 -0
  113. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/group__version.html +106 -0
  114. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/index.html +31 -0
  115. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/modules.html +42 -0
  116. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/nav_f.png +0 -0
  117. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/nav_h.png +0 -0
  118. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/open.png +0 -0
  119. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/structyaml__alias__data__s.html +108 -0
  120. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/structyaml__document__s.html +235 -0
  121. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/structyaml__emitter__s.html +1300 -0
  122. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/structyaml__event__s.html +496 -0
  123. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/structyaml__mark__s.html +108 -0
  124. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/structyaml__node__pair__s.html +91 -0
  125. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/structyaml__node__s.html +420 -0
  126. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/structyaml__parser__s.html +1229 -0
  127. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/structyaml__simple__key__s.html +97 -0
  128. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/structyaml__tag__directive__s.html +91 -0
  129. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/structyaml__token__s.html +413 -0
  130. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/structyaml__version__directive__s.html +91 -0
  131. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/tab_a.png +0 -0
  132. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/tab_b.png +0 -0
  133. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/tab_h.png +0 -0
  134. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/tab_s.png +0 -0
  135. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/tabs.css +59 -0
  136. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/yaml_8h.html +525 -0
  137. data/ext/nutcracker/contrib/yaml-0.1.4/include/Makefile.am +17 -0
  138. data/ext/nutcracker/contrib/yaml-0.1.4/include/Makefile.in +470 -0
  139. data/ext/nutcracker/contrib/yaml-0.1.4/libtool +8890 -0
  140. data/ext/nutcracker/contrib/yaml-0.1.4/src/Makefile +484 -0
  141. data/ext/nutcracker/contrib/yaml-0.1.4/src/api.lo +12 -0
  142. data/ext/nutcracker/contrib/yaml-0.1.4/src/api.o +0 -0
  143. data/ext/nutcracker/contrib/yaml-0.1.4/src/dumper.lo +12 -0
  144. data/ext/nutcracker/contrib/yaml-0.1.4/src/dumper.o +0 -0
  145. data/ext/nutcracker/contrib/yaml-0.1.4/src/emitter.lo +12 -0
  146. data/ext/nutcracker/contrib/yaml-0.1.4/src/emitter.o +0 -0
  147. data/ext/nutcracker/contrib/yaml-0.1.4/src/libyaml.la +41 -0
  148. data/ext/nutcracker/contrib/yaml-0.1.4/src/loader.lo +12 -0
  149. data/ext/nutcracker/contrib/yaml-0.1.4/src/loader.o +0 -0
  150. data/ext/nutcracker/contrib/yaml-0.1.4/src/parser.lo +12 -0
  151. data/ext/nutcracker/contrib/yaml-0.1.4/src/parser.o +0 -0
  152. data/ext/nutcracker/contrib/yaml-0.1.4/src/reader.lo +12 -0
  153. data/ext/nutcracker/contrib/yaml-0.1.4/src/reader.o +0 -0
  154. data/ext/nutcracker/contrib/yaml-0.1.4/src/scanner.lo +12 -0
  155. data/ext/nutcracker/contrib/yaml-0.1.4/src/scanner.o +0 -0
  156. data/ext/nutcracker/contrib/yaml-0.1.4/src/writer.lo +12 -0
  157. data/ext/nutcracker/contrib/yaml-0.1.4/src/writer.o +0 -0
  158. data/ext/nutcracker/contrib/yaml-0.1.4/stamp-h1 +1 -0
  159. data/ext/nutcracker/contrib/yaml-0.1.4/tests/Makefile +675 -0
  160. data/ext/nutcracker/contrib/yaml-0.1.4/tests/example-deconstructor +0 -0
  161. data/ext/nutcracker/contrib/yaml-0.1.4/tests/example-deconstructor-alt +0 -0
  162. data/ext/nutcracker/contrib/yaml-0.1.4/tests/example-deconstructor-alt.o +0 -0
  163. data/ext/nutcracker/contrib/yaml-0.1.4/tests/example-deconstructor.o +0 -0
  164. data/ext/nutcracker/contrib/yaml-0.1.4/tests/example-reformatter +0 -0
  165. data/ext/nutcracker/contrib/yaml-0.1.4/tests/example-reformatter-alt +0 -0
  166. data/ext/nutcracker/contrib/yaml-0.1.4/tests/example-reformatter-alt.o +0 -0
  167. data/ext/nutcracker/contrib/yaml-0.1.4/tests/example-reformatter.o +0 -0
  168. data/ext/nutcracker/contrib/yaml-0.1.4/tests/run-dumper +0 -0
  169. data/ext/nutcracker/contrib/yaml-0.1.4/tests/run-dumper.o +0 -0
  170. data/ext/nutcracker/contrib/yaml-0.1.4/tests/run-emitter +0 -0
  171. data/ext/nutcracker/contrib/yaml-0.1.4/tests/run-emitter.o +0 -0
  172. data/ext/nutcracker/contrib/yaml-0.1.4/tests/run-loader +0 -0
  173. data/ext/nutcracker/contrib/yaml-0.1.4/tests/run-loader.o +0 -0
  174. data/ext/nutcracker/contrib/yaml-0.1.4/tests/run-parser +0 -0
  175. data/ext/nutcracker/contrib/yaml-0.1.4/tests/run-parser.o +0 -0
  176. data/ext/nutcracker/contrib/yaml-0.1.4/tests/run-scanner +0 -0
  177. data/ext/nutcracker/contrib/yaml-0.1.4/tests/run-scanner.o +0 -0
  178. data/ext/nutcracker/contrib/yaml-0.1.4/yaml-0.1.pc +10 -0
  179. data/ext/nutcracker/contrib/yaml-0.1.4/yaml-0.1.pc.in +10 -0
  180. data/ext/nutcracker/extconf.rb +0 -5
  181. data/ext/nutcracker/libtool +9403 -0
  182. data/ext/nutcracker/m4/libtool.m4 +553 -492
  183. data/ext/nutcracker/m4/ltoptions.m4 +7 -6
  184. data/ext/nutcracker/m4/ltversion.m4 +5 -5
  185. data/ext/nutcracker/m4/lt~obsolete.m4 +9 -3
  186. data/ext/nutcracker/notes/c-styleguide.txt +0 -0
  187. data/ext/nutcracker/notes/debug.txt +0 -0
  188. data/ext/nutcracker/notes/memcache.txt +0 -0
  189. data/ext/nutcracker/notes/recommendation.md +21 -2
  190. data/ext/nutcracker/notes/redis.md +9 -9
  191. data/ext/nutcracker/notes/socket.txt +0 -0
  192. data/ext/nutcracker/scripts/nutcracker.init +0 -0
  193. data/ext/nutcracker/scripts/nutcracker.spec +0 -0
  194. data/ext/nutcracker/scripts/redis-check.py +0 -0
  195. data/ext/nutcracker/scripts/redis-check.sh +9 -0
  196. data/ext/nutcracker/src/Makefile +647 -0
  197. data/ext/nutcracker/src/Makefile.am +1 -1
  198. data/ext/nutcracker/src/Makefile.in +74 -153
  199. data/ext/nutcracker/src/hashkit/Makefile +476 -0
  200. data/ext/nutcracker/src/hashkit/Makefile.am +1 -0
  201. data/ext/nutcracker/src/hashkit/Makefile.in +39 -64
  202. data/ext/nutcracker/src/hashkit/libhashkit.a +0 -0
  203. data/ext/nutcracker/src/hashkit/nc_crc16.c +66 -0
  204. data/ext/nutcracker/src/hashkit/nc_crc16.o +0 -0
  205. data/ext/nutcracker/src/hashkit/nc_crc32.c +0 -0
  206. data/ext/nutcracker/src/hashkit/nc_crc32.o +0 -0
  207. data/ext/nutcracker/src/hashkit/nc_fnv.c +0 -0
  208. data/ext/nutcracker/src/hashkit/nc_fnv.o +0 -0
  209. data/ext/nutcracker/src/hashkit/nc_hashkit.h +2 -0
  210. data/ext/nutcracker/src/hashkit/nc_hsieh.c +0 -0
  211. data/ext/nutcracker/src/hashkit/nc_hsieh.o +0 -0
  212. data/ext/nutcracker/src/hashkit/nc_jenkins.c +0 -0
  213. data/ext/nutcracker/src/hashkit/nc_jenkins.o +0 -0
  214. data/ext/nutcracker/src/hashkit/nc_ketama.c +0 -0
  215. data/ext/nutcracker/src/hashkit/nc_ketama.o +0 -0
  216. data/ext/nutcracker/src/hashkit/nc_md5.c +0 -0
  217. data/ext/nutcracker/src/hashkit/nc_md5.o +0 -0
  218. data/ext/nutcracker/src/hashkit/nc_modula.c +18 -6
  219. data/ext/nutcracker/src/hashkit/nc_modula.o +0 -0
  220. data/ext/nutcracker/src/hashkit/nc_murmur.c +0 -0
  221. data/ext/nutcracker/src/hashkit/nc_murmur.o +0 -0
  222. data/ext/nutcracker/src/hashkit/nc_one_at_a_time.c +0 -0
  223. data/ext/nutcracker/src/hashkit/nc_one_at_a_time.o +0 -0
  224. data/ext/nutcracker/src/hashkit/nc_random.c +0 -0
  225. data/ext/nutcracker/src/hashkit/nc_random.o +0 -0
  226. data/ext/nutcracker/src/nc.c +0 -0
  227. data/ext/nutcracker/src/nc.o +0 -0
  228. data/ext/nutcracker/src/nc_array.c +0 -0
  229. data/ext/nutcracker/src/nc_array.h +0 -0
  230. data/ext/nutcracker/src/nc_array.o +0 -0
  231. data/ext/nutcracker/src/nc_client.c +0 -0
  232. data/ext/nutcracker/src/nc_client.h +0 -0
  233. data/ext/nutcracker/src/nc_client.o +0 -0
  234. data/ext/nutcracker/src/nc_conf.c +14 -35
  235. data/ext/nutcracker/src/nc_conf.h +1 -1
  236. data/ext/nutcracker/src/nc_conf.o +0 -0
  237. data/ext/nutcracker/src/nc_connection.c +0 -0
  238. data/ext/nutcracker/src/nc_connection.h +0 -0
  239. data/ext/nutcracker/src/nc_connection.o +0 -0
  240. data/ext/nutcracker/src/nc_core.c +29 -26
  241. data/ext/nutcracker/src/nc_core.h +13 -5
  242. data/ext/nutcracker/src/nc_core.o +0 -0
  243. data/ext/nutcracker/src/{nc_event.c → nc_epoll.c} +94 -30
  244. data/ext/nutcracker/src/nc_epoll.o +0 -0
  245. data/ext/nutcracker/src/nc_event.h +33 -13
  246. data/ext/nutcracker/src/nc_kqueue.c +296 -0
  247. data/ext/nutcracker/src/nc_kqueue.o +0 -0
  248. data/ext/nutcracker/src/nc_log.c +0 -0
  249. data/ext/nutcracker/src/nc_log.h +0 -0
  250. data/ext/nutcracker/src/nc_log.o +0 -0
  251. data/ext/nutcracker/src/nc_mbuf.c +0 -0
  252. data/ext/nutcracker/src/nc_mbuf.h +0 -0
  253. data/ext/nutcracker/src/nc_mbuf.o +0 -0
  254. data/ext/nutcracker/src/nc_message.c +0 -0
  255. data/ext/nutcracker/src/nc_message.h +2 -0
  256. data/ext/nutcracker/src/nc_message.o +0 -0
  257. data/ext/nutcracker/src/nc_proxy.c +8 -8
  258. data/ext/nutcracker/src/nc_proxy.h +0 -0
  259. data/ext/nutcracker/src/nc_proxy.o +0 -0
  260. data/ext/nutcracker/src/nc_queue.h +0 -0
  261. data/ext/nutcracker/src/nc_rbtree.c +0 -0
  262. data/ext/nutcracker/src/nc_rbtree.h +0 -0
  263. data/ext/nutcracker/src/nc_rbtree.o +0 -0
  264. data/ext/nutcracker/src/nc_request.c +3 -3
  265. data/ext/nutcracker/src/nc_request.o +0 -0
  266. data/ext/nutcracker/src/nc_response.c +4 -6
  267. data/ext/nutcracker/src/nc_response.o +0 -0
  268. data/ext/nutcracker/src/nc_server.c +14 -12
  269. data/ext/nutcracker/src/nc_server.h +0 -0
  270. data/ext/nutcracker/src/nc_server.o +0 -0
  271. data/ext/nutcracker/src/nc_signal.c +0 -0
  272. data/ext/nutcracker/src/nc_signal.h +0 -0
  273. data/ext/nutcracker/src/nc_signal.o +0 -0
  274. data/ext/nutcracker/src/nc_stats.c +16 -21
  275. data/ext/nutcracker/src/nc_stats.h +3 -4
  276. data/ext/nutcracker/src/nc_stats.o +0 -0
  277. data/ext/nutcracker/src/nc_string.c +0 -0
  278. data/ext/nutcracker/src/nc_string.h +0 -0
  279. data/ext/nutcracker/src/nc_string.o +0 -0
  280. data/ext/nutcracker/src/nc_util.c +16 -0
  281. data/ext/nutcracker/src/nc_util.h +1 -0
  282. data/ext/nutcracker/src/nc_util.o +0 -0
  283. data/ext/nutcracker/src/nutcracker +0 -0
  284. data/ext/nutcracker/src/proto/Makefile +454 -0
  285. data/ext/nutcracker/src/proto/Makefile.am +0 -0
  286. data/ext/nutcracker/src/proto/Makefile.in +32 -60
  287. data/ext/nutcracker/src/proto/libproto.a +0 -0
  288. data/ext/nutcracker/src/proto/nc_memcache.c +0 -0
  289. data/ext/nutcracker/src/proto/nc_memcache.o +0 -0
  290. data/ext/nutcracker/src/proto/nc_proto.h +0 -0
  291. data/ext/nutcracker/src/proto/nc_redis.c +17 -4
  292. data/ext/nutcracker/src/proto/nc_redis.o +0 -0
  293. data/ext/nutcracker/stamp-h1 +1 -0
  294. data/lib/nutcracker.rb +64 -2
  295. data/lib/nutcracker/version.rb +1 -1
  296. metadata +237 -9
@@ -10,6 +10,7 @@ noinst_LIBRARIES = libhashkit.a
10
10
  noinst_HEADERS = nc_hashkit.h
11
11
 
12
12
  libhashkit_a_SOURCES = \
13
+ nc_crc16.c \
13
14
  nc_crc32.c \
14
15
  nc_fnv.c \
15
16
  nc_hsieh.c \
@@ -1,9 +1,8 @@
1
- # Makefile.in generated by automake 1.11 from Makefile.am.
1
+ # Makefile.in generated by automake 1.10 from Makefile.am.
2
2
  # @configure_input@
3
3
 
4
4
  # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
5
- # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
6
- # Inc.
5
+ # 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
7
6
  # This Makefile.in is free software; the Free Software Foundation
8
7
  # gives unlimited permission to copy and/or distribute it,
9
8
  # with or without modifications, as long as this notice is preserved.
@@ -18,9 +17,8 @@
18
17
 
19
18
  VPATH = @srcdir@
20
19
  pkgdatadir = $(datadir)/@PACKAGE@
21
- pkgincludedir = $(includedir)/@PACKAGE@
22
20
  pkglibdir = $(libdir)/@PACKAGE@
23
- pkglibexecdir = $(libexecdir)/@PACKAGE@
21
+ pkgincludedir = $(includedir)/@PACKAGE@
24
22
  am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
25
23
  install_sh_DATA = $(install_sh) -c -m 644
26
24
  install_sh_PROGRAM = $(install_sh) -c
@@ -48,20 +46,19 @@ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
48
46
  mkinstalldirs = $(install_sh) -d
49
47
  CONFIG_HEADER = $(top_builddir)/config.h
50
48
  CONFIG_CLEAN_FILES =
51
- CONFIG_CLEAN_VPATH_FILES =
52
49
  LIBRARIES = $(noinst_LIBRARIES)
53
50
  ARFLAGS = cru
54
51
  libhashkit_a_AR = $(AR) $(ARFLAGS)
55
52
  libhashkit_a_LIBADD =
56
- am_libhashkit_a_OBJECTS = nc_crc32.$(OBJEXT) nc_fnv.$(OBJEXT) \
57
- nc_hsieh.$(OBJEXT) nc_jenkins.$(OBJEXT) nc_ketama.$(OBJEXT) \
58
- nc_md5.$(OBJEXT) nc_modula.$(OBJEXT) nc_murmur.$(OBJEXT) \
59
- nc_one_at_a_time.$(OBJEXT) nc_random.$(OBJEXT)
53
+ am_libhashkit_a_OBJECTS = nc_crc16.$(OBJEXT) nc_crc32.$(OBJEXT) \
54
+ nc_fnv.$(OBJEXT) nc_hsieh.$(OBJEXT) nc_jenkins.$(OBJEXT) \
55
+ nc_ketama.$(OBJEXT) nc_md5.$(OBJEXT) nc_modula.$(OBJEXT) \
56
+ nc_murmur.$(OBJEXT) nc_one_at_a_time.$(OBJEXT) \
57
+ nc_random.$(OBJEXT)
60
58
  libhashkit_a_OBJECTS = $(am_libhashkit_a_OBJECTS)
61
- DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
59
+ DEFAULT_INCLUDES = -I. -I$(top_builddir)@am__isrc@
62
60
  depcomp = $(SHELL) $(top_srcdir)/config/depcomp
63
61
  am__depfiles_maybe = depfiles
64
- am__mv = mv -f
65
62
  COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
66
63
  $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
67
64
  LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
@@ -177,7 +174,6 @@ libdir = @libdir@
177
174
  libexecdir = @libexecdir@
178
175
  localedir = @localedir@
179
176
  localstatedir = @localstatedir@
180
- lt_ECHO = @lt_ECHO@
181
177
  mandir = @mandir@
182
178
  mkdir_p = @mkdir_p@
183
179
  oldincludedir = @oldincludedir@
@@ -200,6 +196,7 @@ AM_CFLAGS = -Wall -Wshadow -Wno-unused-parameter -Wno-unused-value
200
196
  noinst_LIBRARIES = libhashkit.a
201
197
  noinst_HEADERS = nc_hashkit.h
202
198
  libhashkit_a_SOURCES = \
199
+ nc_crc16.c \
203
200
  nc_crc32.c \
204
201
  nc_fnv.c \
205
202
  nc_hsieh.c \
@@ -219,14 +216,14 @@ $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
219
216
  @for dep in $?; do \
220
217
  case '$(am__configure_deps)' in \
221
218
  *$$dep*) \
222
- ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
223
- && { if test -f $@; then exit 0; else break; fi; }; \
219
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
220
+ && exit 0; \
224
221
  exit 1;; \
225
222
  esac; \
226
223
  done; \
227
- echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/hashkit/Makefile'; \
228
- $(am__cd) $(top_srcdir) && \
229
- $(AUTOMAKE) --foreign src/hashkit/Makefile
224
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/hashkit/Makefile'; \
225
+ cd $(top_srcdir) && \
226
+ $(AUTOMAKE) --foreign src/hashkit/Makefile
230
227
  .PRECIOUS: Makefile
231
228
  Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
232
229
  @case '$?' in \
@@ -244,7 +241,6 @@ $(top_srcdir)/configure: $(am__configure_deps)
244
241
  cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
245
242
  $(ACLOCAL_M4): $(am__aclocal_m4_deps)
246
243
  cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
247
- $(am__aclocal_m4_deps):
248
244
 
249
245
  clean-noinstLIBRARIES:
250
246
  -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES)
@@ -259,6 +255,7 @@ mostlyclean-compile:
259
255
  distclean-compile:
260
256
  -rm -f *.tab.c
261
257
 
258
+ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nc_crc16.Po@am__quote@
262
259
  @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nc_crc32.Po@am__quote@
263
260
  @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nc_fnv.Po@am__quote@
264
261
  @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nc_hsieh.Po@am__quote@
@@ -272,21 +269,21 @@ distclean-compile:
272
269
 
273
270
  .c.o:
274
271
  @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
275
- @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
272
+ @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
276
273
  @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
277
274
  @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
278
275
  @am__fastdepCC_FALSE@ $(COMPILE) -c $<
279
276
 
280
277
  .c.obj:
281
278
  @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
282
- @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
279
+ @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
283
280
  @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
284
281
  @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
285
282
  @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
286
283
 
287
284
  .c.lo:
288
285
  @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
289
- @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
286
+ @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
290
287
  @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
291
288
  @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
292
289
  @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
@@ -302,49 +299,45 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
302
299
  unique=`for i in $$list; do \
303
300
  if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
304
301
  done | \
305
- $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
306
- END { if (nonempty) { for (i in files) print i; }; }'`; \
302
+ $(AWK) ' { files[$$0] = 1; } \
303
+ END { for (i in files) print i; }'`; \
307
304
  mkid -fID $$unique
308
305
  tags: TAGS
309
306
 
310
307
  TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
311
308
  $(TAGS_FILES) $(LISP)
312
- set x; \
309
+ tags=; \
313
310
  here=`pwd`; \
314
311
  list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
315
312
  unique=`for i in $$list; do \
316
313
  if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
317
314
  done | \
318
- $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
319
- END { if (nonempty) { for (i in files) print i; }; }'`; \
320
- shift; \
321
- if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
315
+ $(AWK) ' { files[$$0] = 1; } \
316
+ END { for (i in files) print i; }'`; \
317
+ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
322
318
  test -n "$$unique" || unique=$$empty_fix; \
323
- if test $$# -gt 0; then \
324
- $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
325
- "$$@" $$unique; \
326
- else \
327
- $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
328
- $$unique; \
329
- fi; \
319
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
320
+ $$tags $$unique; \
330
321
  fi
331
322
  ctags: CTAGS
332
323
  CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
333
324
  $(TAGS_FILES) $(LISP)
325
+ tags=; \
326
+ here=`pwd`; \
334
327
  list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
335
328
  unique=`for i in $$list; do \
336
329
  if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
337
330
  done | \
338
- $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
339
- END { if (nonempty) { for (i in files) print i; }; }'`; \
340
- test -z "$(CTAGS_ARGS)$$unique" \
331
+ $(AWK) ' { files[$$0] = 1; } \
332
+ END { for (i in files) print i; }'`; \
333
+ test -z "$(CTAGS_ARGS)$$tags$$unique" \
341
334
  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
342
- $$unique
335
+ $$tags $$unique
343
336
 
344
337
  GTAGS:
345
338
  here=`$(am__cd) $(top_builddir) && pwd` \
346
- && $(am__cd) $(top_srcdir) \
347
- && gtags -i $(GTAGS_ARGS) "$$here"
339
+ && cd $(top_srcdir) \
340
+ && gtags -i $(GTAGS_ARGS) $$here
348
341
 
349
342
  distclean-tags:
350
343
  -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
@@ -365,17 +358,13 @@ distdir: $(DISTFILES)
365
358
  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
366
359
  if test -d $$d/$$file; then \
367
360
  dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
368
- if test -d "$(distdir)/$$file"; then \
369
- find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
370
- fi; \
371
361
  if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
372
- cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
373
- find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
362
+ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
374
363
  fi; \
375
- cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
364
+ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
376
365
  else \
377
- test -f "$(distdir)/$$file" \
378
- || cp -p $$d/$$file "$(distdir)/$$file" \
366
+ test -f $(distdir)/$$file \
367
+ || cp -p $$d/$$file $(distdir)/$$file \
379
368
  || exit 1; \
380
369
  fi; \
381
370
  done
@@ -403,7 +392,6 @@ clean-generic:
403
392
 
404
393
  distclean-generic:
405
394
  -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
406
- -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
407
395
 
408
396
  maintainer-clean-generic:
409
397
  @echo "This command is intended for maintainers to use"
@@ -426,8 +414,6 @@ dvi-am:
426
414
 
427
415
  html: html-am
428
416
 
429
- html-am:
430
-
431
417
  info: info-am
432
418
 
433
419
  info-am:
@@ -436,28 +422,18 @@ install-data-am:
436
422
 
437
423
  install-dvi: install-dvi-am
438
424
 
439
- install-dvi-am:
440
-
441
425
  install-exec-am:
442
426
 
443
427
  install-html: install-html-am
444
428
 
445
- install-html-am:
446
-
447
429
  install-info: install-info-am
448
430
 
449
- install-info-am:
450
-
451
431
  install-man:
452
432
 
453
433
  install-pdf: install-pdf-am
454
434
 
455
- install-pdf-am:
456
-
457
435
  install-ps: install-ps-am
458
436
 
459
- install-ps-am:
460
-
461
437
  installcheck-am:
462
438
 
463
439
  maintainer-clean: maintainer-clean-am
@@ -495,7 +471,6 @@ uninstall-am:
495
471
  mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
496
472
  pdf pdf-am ps ps-am tags uninstall uninstall-am
497
473
 
498
-
499
474
  # Tell versions [3.59,3.63) of GNU make to not export all variables.
500
475
  # Otherwise a system limit (for SysV at least) may be exceeded.
501
476
  .NOEXPORT:
@@ -0,0 +1,66 @@
1
+ /*
2
+ * twemproxy - A fast and lightweight proxy for memcached protocol.
3
+ * Copyright (C) 2011 Twitter, Inc.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+
18
+ #include <nc_core.h>
19
+
20
+ static const uint16_t crc16tab[256] = {
21
+ 0x0000, 0x1021, 0x2042, 0x3063, 0x4084, 0x50a5, 0x60c6, 0x70e7,
22
+ 0x8108, 0x9129, 0xa14a, 0xb16b, 0xc18c, 0xd1ad, 0xe1ce, 0xf1ef,
23
+ 0x1231, 0x0210, 0x3273, 0x2252, 0x52b5, 0x4294, 0x72f7, 0x62d6,
24
+ 0x9339, 0x8318, 0xb37b, 0xa35a, 0xd3bd, 0xc39c, 0xf3ff, 0xe3de,
25
+ 0x2462, 0x3443, 0x0420, 0x1401, 0x64e6, 0x74c7, 0x44a4, 0x5485,
26
+ 0xa56a, 0xb54b, 0x8528, 0x9509, 0xe5ee, 0xf5cf, 0xc5ac, 0xd58d,
27
+ 0x3653, 0x2672, 0x1611, 0x0630, 0x76d7, 0x66f6, 0x5695, 0x46b4,
28
+ 0xb75b, 0xa77a, 0x9719, 0x8738, 0xf7df, 0xe7fe, 0xd79d, 0xc7bc,
29
+ 0x48c4, 0x58e5, 0x6886, 0x78a7, 0x0840, 0x1861, 0x2802, 0x3823,
30
+ 0xc9cc, 0xd9ed, 0xe98e, 0xf9af, 0x8948, 0x9969, 0xa90a, 0xb92b,
31
+ 0x5af5, 0x4ad4, 0x7ab7, 0x6a96, 0x1a71, 0x0a50, 0x3a33, 0x2a12,
32
+ 0xdbfd, 0xcbdc, 0xfbbf, 0xeb9e, 0x9b79, 0x8b58, 0xbb3b, 0xab1a,
33
+ 0x6ca6, 0x7c87, 0x4ce4, 0x5cc5, 0x2c22, 0x3c03, 0x0c60, 0x1c41,
34
+ 0xedae, 0xfd8f, 0xcdec, 0xddcd, 0xad2a, 0xbd0b, 0x8d68, 0x9d49,
35
+ 0x7e97, 0x6eb6, 0x5ed5, 0x4ef4, 0x3e13, 0x2e32, 0x1e51, 0x0e70,
36
+ 0xff9f, 0xefbe, 0xdfdd, 0xcffc, 0xbf1b, 0xaf3a, 0x9f59, 0x8f78,
37
+ 0x9188, 0x81a9, 0xb1ca, 0xa1eb, 0xd10c, 0xc12d, 0xf14e, 0xe16f,
38
+ 0x1080, 0x00a1, 0x30c2, 0x20e3, 0x5004, 0x4025, 0x7046, 0x6067,
39
+ 0x83b9, 0x9398, 0xa3fb, 0xb3da, 0xc33d, 0xd31c, 0xe37f, 0xf35e,
40
+ 0x02b1, 0x1290, 0x22f3, 0x32d2, 0x4235, 0x5214, 0x6277, 0x7256,
41
+ 0xb5ea, 0xa5cb, 0x95a8, 0x8589, 0xf56e, 0xe54f, 0xd52c, 0xc50d,
42
+ 0x34e2, 0x24c3, 0x14a0, 0x0481, 0x7466, 0x6447, 0x5424, 0x4405,
43
+ 0xa7db, 0xb7fa, 0x8799, 0x97b8, 0xe75f, 0xf77e, 0xc71d, 0xd73c,
44
+ 0x26d3, 0x36f2, 0x0691, 0x16b0, 0x6657, 0x7676, 0x4615, 0x5634,
45
+ 0xd94c, 0xc96d, 0xf90e, 0xe92f, 0x99c8, 0x89e9, 0xb98a, 0xa9ab,
46
+ 0x5844, 0x4865, 0x7806, 0x6827, 0x18c0, 0x08e1, 0x3882, 0x28a3,
47
+ 0xcb7d, 0xdb5c, 0xeb3f, 0xfb1e, 0x8bf9, 0x9bd8, 0xabbb, 0xbb9a,
48
+ 0x4a75, 0x5a54, 0x6a37, 0x7a16, 0x0af1, 0x1ad0, 0x2ab3, 0x3a92,
49
+ 0xfd2e, 0xed0f, 0xdd6c, 0xcd4d, 0xbdaa, 0xad8b, 0x9de8, 0x8dc9,
50
+ 0x7c26, 0x6c07, 0x5c64, 0x4c45, 0x3ca2, 0x2c83, 0x1ce0, 0x0cc1,
51
+ 0xef1f, 0xff3e, 0xcf5d, 0xdf7c, 0xaf9b, 0xbfba, 0x8fd9, 0x9ff8,
52
+ 0x6e17, 0x7e36, 0x4e55, 0x5e74, 0x2e93, 0x3eb2, 0x0ed1, 0x1ef0,
53
+ };
54
+
55
+ uint32_t
56
+ hash_crc16(const char *key, size_t key_length)
57
+ {
58
+ uint64_t x;
59
+ uint32_t crc = 0;
60
+
61
+ for (x=0; x < key_length; x++) {
62
+ crc = (crc << 8) ^ crc16tab[((crc >> 8) ^ *key++) & 0x00ff];
63
+ }
64
+
65
+ return crc;
66
+ }
File without changes
File without changes
Binary file
@@ -24,6 +24,7 @@
24
24
  #define HASH_CODEC(ACTION) \
25
25
  ACTION( HASH_ONE_AT_A_TIME, one_at_a_time ) \
26
26
  ACTION( HASH_MD5, md5 ) \
27
+ ACTION( HASH_CRC16, crc16 ) \
27
28
  ACTION( HASH_CRC32, crc32 ) \
28
29
  ACTION( HASH_FNV1_64, fnv1_64 ) \
29
30
  ACTION( HASH_FNV1A_64, fnv1a_64 ) \
@@ -56,6 +57,7 @@ uint32_t hash_one_at_a_time(const char *key, size_t key_length);
56
57
  void md5_signature(const unsigned char *key, unsigned int length, unsigned char *result);
57
58
  uint32_t hash_md5(const char *key, size_t key_length);
58
59
  uint32_t hash_crc32(const char *key, size_t key_length);
60
+ uint32_t hash_crc16(const char *key, size_t key_length);
59
61
  uint32_t hash_fnv1_64(const char *key, size_t key_length);
60
62
  uint32_t hash_fnv1a_64(const char *key, size_t key_length);
61
63
  uint32_t hash_fnv1_32(const char *key, size_t key_length);
File without changes
File without changes
File without changes
File without changes
Binary file
@@ -36,6 +36,8 @@ modula_update(struct server_pool *pool)
36
36
  uint32_t continuum_index; /* continuum index */
37
37
  uint32_t continuum_addition; /* extra space in the continuum */
38
38
  uint32_t server_index; /* server index */
39
+ uint32_t weight_index; /* weight index */
40
+ uint32_t total_weight; /* total live server weight */
39
41
  int64_t now; /* current timestamp in usec */
40
42
 
41
43
  now = nc_usec_now();
@@ -45,6 +47,7 @@ modula_update(struct server_pool *pool)
45
47
 
46
48
  nserver = array_n(&pool->server);
47
49
  nlive_server = 0;
50
+ total_weight = 0;
48
51
  pool->next_rebuild = 0LL;
49
52
 
50
53
  for (server_index = 0; server_index < nserver; server_index++) {
@@ -61,6 +64,13 @@ modula_update(struct server_pool *pool)
61
64
  } else {
62
65
  nlive_server++;
63
66
  }
67
+
68
+ ASSERT(server->weight > 0);
69
+
70
+ /* count weight only for live servers */
71
+ if (!pool->auto_eject_hosts || server->next_retry <= now) {
72
+ total_weight += server->weight;
73
+ }
64
74
  }
65
75
 
66
76
  pool->nlive_server = nlive_server;
@@ -85,9 +95,9 @@ modula_update(struct server_pool *pool)
85
95
  * Allocate the continuum for the pool, the first time, and every time we
86
96
  * add a new server to the pool
87
97
  */
88
- if (nlive_server > pool->nserver_continuum) {
98
+ if (total_weight > pool->nserver_continuum) {
89
99
  struct continuum *continuum;
90
- uint32_t nserver_continuum = nlive_server + MODULA_CONTINUUM_ADDITION;
100
+ uint32_t nserver_continuum = total_weight + MODULA_CONTINUUM_ADDITION;
91
101
  uint32_t ncontinuum = nserver_continuum * MODULA_POINTS_PER_SERVER;
92
102
 
93
103
  continuum = nc_realloc(pool->continuum, sizeof(*continuum) * ncontinuum);
@@ -110,12 +120,14 @@ modula_update(struct server_pool *pool)
110
120
  continue;
111
121
  }
112
122
 
113
- pointer_per_server = 1;
123
+ for (weight_index = 0; weight_index < server->weight; weight_index++) {
124
+ pointer_per_server = 1;
114
125
 
115
- pool->continuum[continuum_index].index = server_index;
116
- pool->continuum[continuum_index++].value = 0;
126
+ pool->continuum[continuum_index].index = server_index;
127
+ pool->continuum[continuum_index++].value = 0;
117
128
 
118
- pointer_counter += pointer_per_server;
129
+ pointer_counter += pointer_per_server;
130
+ }
119
131
  }
120
132
  pool->ncontinuum = pointer_counter;
121
133