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.
- data/README.md +53 -5
- data/Rakefile +14 -19
- data/bin/nutcracker +6 -1
- data/ext/nutcracker/ChangeLog +9 -0
- data/ext/nutcracker/LICENSE +0 -0
- data/ext/nutcracker/Makefile +643 -0
- data/ext/nutcracker/Makefile.am +0 -0
- data/ext/nutcracker/Makefile.in +66 -149
- data/ext/nutcracker/NOTICE +0 -0
- data/ext/nutcracker/README.md +13 -11
- data/ext/nutcracker/aclocal.m4 +112 -201
- data/ext/nutcracker/autom4te.cache/output.0 +18664 -0
- data/ext/nutcracker/autom4te.cache/output.1 +18664 -0
- data/ext/nutcracker/autom4te.cache/output.2 +18664 -0
- data/ext/nutcracker/autom4te.cache/requests +494 -0
- data/ext/nutcracker/autom4te.cache/traces.0 +2415 -0
- data/ext/nutcracker/autom4te.cache/traces.1 +945 -0
- data/ext/nutcracker/autom4te.cache/traces.2 +2415 -0
- data/ext/nutcracker/conf/nutcracker.leaf.yml +0 -0
- data/ext/nutcracker/conf/nutcracker.root.yml +0 -0
- data/ext/nutcracker/conf/nutcracker.yml +0 -0
- data/ext/nutcracker/config.h +332 -0
- data/ext/nutcracker/config.h.in +15 -0
- data/ext/nutcracker/config.log +2684 -0
- data/ext/nutcracker/config.status +2317 -0
- data/ext/nutcracker/config/config.guess +23 -84
- data/ext/nutcracker/config/config.sub +23 -93
- data/ext/nutcracker/config/depcomp +35 -81
- data/ext/nutcracker/config/install-sh +109 -122
- data/ext/nutcracker/config/ltmain.sh +1053 -721
- data/ext/nutcracker/config/missing +20 -29
- data/ext/nutcracker/configure +2122 -2320
- data/ext/nutcracker/configure.ac +35 -3
- data/ext/nutcracker/contrib/Makefile +494 -0
- data/ext/nutcracker/contrib/Makefile.am +0 -0
- data/ext/nutcracker/contrib/Makefile.in +41 -107
- data/ext/nutcracker/contrib/yaml-0.1.4.tar.gz +0 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/Makefile +736 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/autom4te.cache/output.0 +13102 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/autom4te.cache/output.1 +13085 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/autom4te.cache/output.2 +13085 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/autom4te.cache/requests +476 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/autom4te.cache/traces.0 +2339 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/autom4te.cache/traces.1 +545 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/autom4te.cache/traces.2 +2339 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/config.h +81 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/config.h.in~ +80 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/config.log +688 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/config.status +2032 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/annotated.html +51 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/bc_s.png +0 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/classes.html +41 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/closed.png +0 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/doxygen.css +656 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/doxygen.png +0 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/files.html +40 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions.html +91 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_0x62.html +84 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_0x63.html +87 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_0x64.html +83 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_0x65.html +110 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_0x66.html +79 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_0x68.html +80 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_0x69.html +92 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_0x6b.html +71 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_0x6c.html +88 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_0x6d.html +96 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_0x6e.html +71 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_0x6f.html +80 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_0x70.html +100 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_0x71.html +71 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_0x72.html +87 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_0x73.html +163 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_0x74.html +115 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_0x75.html +71 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_0x76.html +80 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_0x77.html +77 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_vars.html +91 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_vars_0x62.html +84 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_vars_0x63.html +87 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_vars_0x64.html +83 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_vars_0x65.html +110 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_vars_0x66.html +79 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_vars_0x68.html +80 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_vars_0x69.html +92 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_vars_0x6b.html +71 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_vars_0x6c.html +88 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_vars_0x6d.html +96 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_vars_0x6e.html +71 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_vars_0x6f.html +80 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_vars_0x70.html +100 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_vars_0x71.html +71 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_vars_0x72.html +87 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_vars_0x73.html +163 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_vars_0x74.html +115 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_vars_0x75.html +71 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_vars_0x76.html +80 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_vars_0x77.html +77 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/globals.html +667 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/globals_defs.html +81 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/globals_enum.html +78 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/globals_eval.html +373 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/globals_func.html +196 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/globals_type.html +126 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/group__basic.html +320 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/group__emitter.html +819 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/group__events.html +664 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/group__export.html +60 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/group__nodes.html +795 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/group__parser.html +606 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/group__styles.html +222 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/group__tokens.html +246 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/group__version.html +106 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/index.html +31 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/modules.html +42 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/nav_f.png +0 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/nav_h.png +0 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/open.png +0 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/structyaml__alias__data__s.html +108 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/structyaml__document__s.html +235 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/structyaml__emitter__s.html +1300 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/structyaml__event__s.html +496 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/structyaml__mark__s.html +108 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/structyaml__node__pair__s.html +91 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/structyaml__node__s.html +420 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/structyaml__parser__s.html +1229 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/structyaml__simple__key__s.html +97 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/structyaml__tag__directive__s.html +91 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/structyaml__token__s.html +413 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/structyaml__version__directive__s.html +91 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/tab_a.png +0 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/tab_b.png +0 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/tab_h.png +0 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/tab_s.png +0 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/tabs.css +59 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/yaml_8h.html +525 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/include/Makefile.am +17 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/include/Makefile.in +470 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/libtool +8890 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/src/Makefile +484 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/src/api.lo +12 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/src/api.o +0 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/src/dumper.lo +12 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/src/dumper.o +0 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/src/emitter.lo +12 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/src/emitter.o +0 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/src/libyaml.la +41 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/src/loader.lo +12 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/src/loader.o +0 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/src/parser.lo +12 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/src/parser.o +0 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/src/reader.lo +12 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/src/reader.o +0 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/src/scanner.lo +12 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/src/scanner.o +0 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/src/writer.lo +12 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/src/writer.o +0 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/stamp-h1 +1 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/tests/Makefile +675 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/tests/example-deconstructor +0 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/tests/example-deconstructor-alt +0 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/tests/example-deconstructor-alt.o +0 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/tests/example-deconstructor.o +0 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/tests/example-reformatter +0 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/tests/example-reformatter-alt +0 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/tests/example-reformatter-alt.o +0 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/tests/example-reformatter.o +0 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/tests/run-dumper +0 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/tests/run-dumper.o +0 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/tests/run-emitter +0 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/tests/run-emitter.o +0 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/tests/run-loader +0 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/tests/run-loader.o +0 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/tests/run-parser +0 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/tests/run-parser.o +0 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/tests/run-scanner +0 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/tests/run-scanner.o +0 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/yaml-0.1.pc +10 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/yaml-0.1.pc.in +10 -0
- data/ext/nutcracker/extconf.rb +0 -5
- data/ext/nutcracker/libtool +9403 -0
- data/ext/nutcracker/m4/libtool.m4 +553 -492
- data/ext/nutcracker/m4/ltoptions.m4 +7 -6
- data/ext/nutcracker/m4/ltversion.m4 +5 -5
- data/ext/nutcracker/m4/lt~obsolete.m4 +9 -3
- data/ext/nutcracker/notes/c-styleguide.txt +0 -0
- data/ext/nutcracker/notes/debug.txt +0 -0
- data/ext/nutcracker/notes/memcache.txt +0 -0
- data/ext/nutcracker/notes/recommendation.md +21 -2
- data/ext/nutcracker/notes/redis.md +9 -9
- data/ext/nutcracker/notes/socket.txt +0 -0
- data/ext/nutcracker/scripts/nutcracker.init +0 -0
- data/ext/nutcracker/scripts/nutcracker.spec +0 -0
- data/ext/nutcracker/scripts/redis-check.py +0 -0
- data/ext/nutcracker/scripts/redis-check.sh +9 -0
- data/ext/nutcracker/src/Makefile +647 -0
- data/ext/nutcracker/src/Makefile.am +1 -1
- data/ext/nutcracker/src/Makefile.in +74 -153
- data/ext/nutcracker/src/hashkit/Makefile +476 -0
- data/ext/nutcracker/src/hashkit/Makefile.am +1 -0
- data/ext/nutcracker/src/hashkit/Makefile.in +39 -64
- data/ext/nutcracker/src/hashkit/libhashkit.a +0 -0
- data/ext/nutcracker/src/hashkit/nc_crc16.c +66 -0
- data/ext/nutcracker/src/hashkit/nc_crc16.o +0 -0
- data/ext/nutcracker/src/hashkit/nc_crc32.c +0 -0
- data/ext/nutcracker/src/hashkit/nc_crc32.o +0 -0
- data/ext/nutcracker/src/hashkit/nc_fnv.c +0 -0
- data/ext/nutcracker/src/hashkit/nc_fnv.o +0 -0
- data/ext/nutcracker/src/hashkit/nc_hashkit.h +2 -0
- data/ext/nutcracker/src/hashkit/nc_hsieh.c +0 -0
- data/ext/nutcracker/src/hashkit/nc_hsieh.o +0 -0
- data/ext/nutcracker/src/hashkit/nc_jenkins.c +0 -0
- data/ext/nutcracker/src/hashkit/nc_jenkins.o +0 -0
- data/ext/nutcracker/src/hashkit/nc_ketama.c +0 -0
- data/ext/nutcracker/src/hashkit/nc_ketama.o +0 -0
- data/ext/nutcracker/src/hashkit/nc_md5.c +0 -0
- data/ext/nutcracker/src/hashkit/nc_md5.o +0 -0
- data/ext/nutcracker/src/hashkit/nc_modula.c +18 -6
- data/ext/nutcracker/src/hashkit/nc_modula.o +0 -0
- data/ext/nutcracker/src/hashkit/nc_murmur.c +0 -0
- data/ext/nutcracker/src/hashkit/nc_murmur.o +0 -0
- data/ext/nutcracker/src/hashkit/nc_one_at_a_time.c +0 -0
- data/ext/nutcracker/src/hashkit/nc_one_at_a_time.o +0 -0
- data/ext/nutcracker/src/hashkit/nc_random.c +0 -0
- data/ext/nutcracker/src/hashkit/nc_random.o +0 -0
- data/ext/nutcracker/src/nc.c +0 -0
- data/ext/nutcracker/src/nc.o +0 -0
- data/ext/nutcracker/src/nc_array.c +0 -0
- data/ext/nutcracker/src/nc_array.h +0 -0
- data/ext/nutcracker/src/nc_array.o +0 -0
- data/ext/nutcracker/src/nc_client.c +0 -0
- data/ext/nutcracker/src/nc_client.h +0 -0
- data/ext/nutcracker/src/nc_client.o +0 -0
- data/ext/nutcracker/src/nc_conf.c +14 -35
- data/ext/nutcracker/src/nc_conf.h +1 -1
- data/ext/nutcracker/src/nc_conf.o +0 -0
- data/ext/nutcracker/src/nc_connection.c +0 -0
- data/ext/nutcracker/src/nc_connection.h +0 -0
- data/ext/nutcracker/src/nc_connection.o +0 -0
- data/ext/nutcracker/src/nc_core.c +29 -26
- data/ext/nutcracker/src/nc_core.h +13 -5
- data/ext/nutcracker/src/nc_core.o +0 -0
- data/ext/nutcracker/src/{nc_event.c → nc_epoll.c} +94 -30
- data/ext/nutcracker/src/nc_epoll.o +0 -0
- data/ext/nutcracker/src/nc_event.h +33 -13
- data/ext/nutcracker/src/nc_kqueue.c +296 -0
- data/ext/nutcracker/src/nc_kqueue.o +0 -0
- data/ext/nutcracker/src/nc_log.c +0 -0
- data/ext/nutcracker/src/nc_log.h +0 -0
- data/ext/nutcracker/src/nc_log.o +0 -0
- data/ext/nutcracker/src/nc_mbuf.c +0 -0
- data/ext/nutcracker/src/nc_mbuf.h +0 -0
- data/ext/nutcracker/src/nc_mbuf.o +0 -0
- data/ext/nutcracker/src/nc_message.c +0 -0
- data/ext/nutcracker/src/nc_message.h +2 -0
- data/ext/nutcracker/src/nc_message.o +0 -0
- data/ext/nutcracker/src/nc_proxy.c +8 -8
- data/ext/nutcracker/src/nc_proxy.h +0 -0
- data/ext/nutcracker/src/nc_proxy.o +0 -0
- data/ext/nutcracker/src/nc_queue.h +0 -0
- data/ext/nutcracker/src/nc_rbtree.c +0 -0
- data/ext/nutcracker/src/nc_rbtree.h +0 -0
- data/ext/nutcracker/src/nc_rbtree.o +0 -0
- data/ext/nutcracker/src/nc_request.c +3 -3
- data/ext/nutcracker/src/nc_request.o +0 -0
- data/ext/nutcracker/src/nc_response.c +4 -6
- data/ext/nutcracker/src/nc_response.o +0 -0
- data/ext/nutcracker/src/nc_server.c +14 -12
- data/ext/nutcracker/src/nc_server.h +0 -0
- data/ext/nutcracker/src/nc_server.o +0 -0
- data/ext/nutcracker/src/nc_signal.c +0 -0
- data/ext/nutcracker/src/nc_signal.h +0 -0
- data/ext/nutcracker/src/nc_signal.o +0 -0
- data/ext/nutcracker/src/nc_stats.c +16 -21
- data/ext/nutcracker/src/nc_stats.h +3 -4
- data/ext/nutcracker/src/nc_stats.o +0 -0
- data/ext/nutcracker/src/nc_string.c +0 -0
- data/ext/nutcracker/src/nc_string.h +0 -0
- data/ext/nutcracker/src/nc_string.o +0 -0
- data/ext/nutcracker/src/nc_util.c +16 -0
- data/ext/nutcracker/src/nc_util.h +1 -0
- data/ext/nutcracker/src/nc_util.o +0 -0
- data/ext/nutcracker/src/nutcracker +0 -0
- data/ext/nutcracker/src/proto/Makefile +454 -0
- data/ext/nutcracker/src/proto/Makefile.am +0 -0
- data/ext/nutcracker/src/proto/Makefile.in +32 -60
- data/ext/nutcracker/src/proto/libproto.a +0 -0
- data/ext/nutcracker/src/proto/nc_memcache.c +0 -0
- data/ext/nutcracker/src/proto/nc_memcache.o +0 -0
- data/ext/nutcracker/src/proto/nc_proto.h +0 -0
- data/ext/nutcracker/src/proto/nc_redis.c +17 -4
- data/ext/nutcracker/src/proto/nc_redis.o +0 -0
- data/ext/nutcracker/stamp-h1 +1 -0
- data/lib/nutcracker.rb +64 -2
- data/lib/nutcracker/version.rb +1 -1
- metadata +237 -9
Binary file
|
@@ -20,20 +20,40 @@
|
|
20
20
|
|
21
21
|
#include <nc_core.h>
|
22
22
|
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
#define EVENT_SIZE_HINT 1024
|
23
|
+
#define NC_EVENT_SIZE 1024
|
24
|
+
#define EV_READ 0xff
|
25
|
+
#define EV_WRITE 0xff00
|
26
|
+
#define EV_ERR 0xff0000
|
28
27
|
|
29
|
-
|
30
|
-
|
28
|
+
#ifdef NC_HAVE_KQUEUE
|
29
|
+
struct evbase {
|
30
|
+
int kq;
|
31
|
+
struct kevent *changes; /* list of changes to be made */
|
32
|
+
struct kevent *kevents; /* list of events returned from kevent */
|
33
|
+
int n_changes; /* number of changes in our list */
|
34
|
+
int n_returned; /* number of events returned from kevent */
|
35
|
+
int n_processed;
|
36
|
+
int nevent;
|
37
|
+
void (*callback_fp)(void *, uint32_t);
|
38
|
+
};
|
39
|
+
#endif
|
40
|
+
#ifdef NC_HAVE_EPOLL
|
41
|
+
struct evbase {
|
42
|
+
int ep;
|
43
|
+
int nevent;
|
44
|
+
struct epoll_event *event;
|
45
|
+
void (*callback_fp)(void *, uint32_t);
|
46
|
+
};
|
47
|
+
#endif
|
31
48
|
|
32
|
-
|
33
|
-
|
34
|
-
int event_add_conn(int ep, struct conn *c);
|
35
|
-
int event_del_conn(int ep, struct conn *c);
|
49
|
+
struct evbase *evbase_create(int size, void (*callback_fp)(void *, uint32_t));
|
50
|
+
void evbase_destroy(struct evbase *evb);
|
36
51
|
|
37
|
-
int
|
52
|
+
int event_add_out(struct evbase *evb, struct conn *c);
|
53
|
+
int event_del_out(struct evbase *evb, struct conn *c);
|
54
|
+
int event_add_conn(struct evbase *evb, struct conn *c);
|
55
|
+
int event_del_conn(struct evbase *evb, struct conn *c);
|
56
|
+
int event_wait(struct evbase *evb, int timeout);
|
57
|
+
int event_add_st(struct evbase *evb, int fd);
|
38
58
|
|
39
|
-
#endif
|
59
|
+
#endif /* _NC_EVENT_H */
|
@@ -0,0 +1,296 @@
|
|
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
|
+
|
19
|
+
#include <unistd.h>
|
20
|
+
#include <nc_core.h>
|
21
|
+
#include <nc_event.h>
|
22
|
+
|
23
|
+
#ifdef NC_HAVE_KQUEUE
|
24
|
+
#include <sys/event.h>
|
25
|
+
|
26
|
+
struct evbase *
|
27
|
+
evbase_create(int nevent, void (*callback_fp)(void *, uint32_t))
|
28
|
+
{
|
29
|
+
|
30
|
+
struct evbase *evb;
|
31
|
+
int status, kq;
|
32
|
+
struct kevent *changes, *kevents;
|
33
|
+
|
34
|
+
if (nevent <= 0) {
|
35
|
+
log_error("nevent has to be positive %d", nevent);
|
36
|
+
return NULL;
|
37
|
+
}
|
38
|
+
|
39
|
+
/* Initialize the kernel queue */
|
40
|
+
if ((kq = kqueue()) == -1) {
|
41
|
+
log_error("kernel queue create failed: %s", kq, strerror(errno));
|
42
|
+
return NULL;
|
43
|
+
}
|
44
|
+
|
45
|
+
changes = nc_calloc(nevent, sizeof(*changes));
|
46
|
+
if (changes == NULL) {
|
47
|
+
status = close(kq);
|
48
|
+
if (status < 0) {
|
49
|
+
log_error("close kq %d failed, ignored: %s", kq, strerror(errno));
|
50
|
+
}
|
51
|
+
return NULL;
|
52
|
+
}
|
53
|
+
|
54
|
+
kevents = nc_calloc(nevent, sizeof(*kevents));
|
55
|
+
if (kevents == NULL) {
|
56
|
+
nc_free(changes);
|
57
|
+
status = close(kq);
|
58
|
+
if (status < 0) {
|
59
|
+
log_error("close kq %d failed, ignored: %s", kq, strerror(errno));
|
60
|
+
}
|
61
|
+
return NULL;
|
62
|
+
}
|
63
|
+
|
64
|
+
evb = (struct evbase *) nc_alloc(sizeof(*evb));
|
65
|
+
if (evb == NULL) {
|
66
|
+
nc_free(changes);
|
67
|
+
nc_free(kevents);
|
68
|
+
status = close(kq);
|
69
|
+
if (status < 0) {
|
70
|
+
log_error("close kq %d failed, ignored: %s", kq, strerror(errno));
|
71
|
+
}
|
72
|
+
return NULL;
|
73
|
+
}
|
74
|
+
|
75
|
+
evb->kq = kq;
|
76
|
+
evb->changes = changes;
|
77
|
+
evb->kevents = kevents;
|
78
|
+
evb->nevent = nevent;
|
79
|
+
evb->callback_fp = callback_fp;
|
80
|
+
evb->n_changes = 0;
|
81
|
+
|
82
|
+
log_debug(LOG_INFO, "kq %d with nevent %d", evb->kq,
|
83
|
+
evb->nevent);
|
84
|
+
|
85
|
+
return evb;
|
86
|
+
}
|
87
|
+
|
88
|
+
void
|
89
|
+
evbase_destroy(struct evbase *evb)
|
90
|
+
{
|
91
|
+
int status;
|
92
|
+
|
93
|
+
if (evb == NULL) return;
|
94
|
+
|
95
|
+
ASSERT(evb->kq >= 0);
|
96
|
+
|
97
|
+
nc_free(evb->changes);
|
98
|
+
nc_free(evb->kevents);
|
99
|
+
|
100
|
+
status = close(evb->kq);
|
101
|
+
if (status < 0) {
|
102
|
+
log_error("close kq %d failed, ignored: %s", evb->kq, strerror(errno));
|
103
|
+
}
|
104
|
+
nc_free(evb);
|
105
|
+
}
|
106
|
+
|
107
|
+
int
|
108
|
+
event_add_out(struct evbase *evb, struct conn *c)
|
109
|
+
{
|
110
|
+
struct kevent *event;
|
111
|
+
int kq = evb->kq;
|
112
|
+
|
113
|
+
ASSERT(kq > 0);
|
114
|
+
ASSERT(c != NULL);
|
115
|
+
ASSERT(c->sd > 0);
|
116
|
+
ASSERT(c->recv_active);
|
117
|
+
ASSERT(evb->n_changes < evb->nevent);
|
118
|
+
|
119
|
+
if (c->send_active) {
|
120
|
+
return 0;
|
121
|
+
}
|
122
|
+
|
123
|
+
event = &evb->changes[(evb->n_changes)++];
|
124
|
+
EV_SET(event, c->sd, EVFILT_WRITE, EV_ADD | EV_CLEAR, 0, 0, (void *)c);
|
125
|
+
|
126
|
+
c->send_active = 1;
|
127
|
+
|
128
|
+
return 0;
|
129
|
+
}
|
130
|
+
|
131
|
+
int
|
132
|
+
event_del_out(struct evbase *evb, struct conn *c)
|
133
|
+
{
|
134
|
+
struct kevent *event;
|
135
|
+
int kq = evb->kq;
|
136
|
+
|
137
|
+
ASSERT(kq > 0);
|
138
|
+
ASSERT(c != NULL);
|
139
|
+
ASSERT(c->sd > 0);
|
140
|
+
ASSERT(c->recv_active);
|
141
|
+
ASSERT(evb->n_changes < evb->nevent);
|
142
|
+
|
143
|
+
if (!c->send_active) {
|
144
|
+
return 0;
|
145
|
+
}
|
146
|
+
|
147
|
+
event = &evb->changes[(evb->n_changes)++];
|
148
|
+
EV_SET(event, c->sd, EVFILT_WRITE, EV_DELETE, 0, 0, (void *)c);
|
149
|
+
|
150
|
+
c->send_active = 0;
|
151
|
+
|
152
|
+
return 0;
|
153
|
+
}
|
154
|
+
|
155
|
+
int
|
156
|
+
event_add_conn(struct evbase *evb, struct conn *c)
|
157
|
+
{
|
158
|
+
struct kevent *event;
|
159
|
+
int kq = evb->kq;
|
160
|
+
|
161
|
+
ASSERT(kq > 0);
|
162
|
+
ASSERT(c != NULL);
|
163
|
+
ASSERT(c->sd > 0);
|
164
|
+
ASSERT(evb->n_changes < evb->nevent);
|
165
|
+
|
166
|
+
event = &evb->changes[(evb->n_changes)++];
|
167
|
+
EV_SET(event, c->sd, EVFILT_READ, EV_ADD | EV_CLEAR, 0, 0, (void *)c);
|
168
|
+
|
169
|
+
c->recv_active = 1;
|
170
|
+
|
171
|
+
event_add_out(evb, c);
|
172
|
+
c->send_active = 1;
|
173
|
+
|
174
|
+
return 0;
|
175
|
+
}
|
176
|
+
|
177
|
+
int
|
178
|
+
event_del_conn(struct evbase *evb, struct conn *c)
|
179
|
+
{
|
180
|
+
int i;
|
181
|
+
struct kevent *event;
|
182
|
+
int kq = evb->kq;
|
183
|
+
|
184
|
+
ASSERT(kq > 0);
|
185
|
+
ASSERT(c != NULL);
|
186
|
+
ASSERT(c->sd > 0);
|
187
|
+
ASSERT(evb->n_changes < evb->nevent);
|
188
|
+
|
189
|
+
event = &evb->changes[(evb->n_changes)++];
|
190
|
+
EV_SET(event, c->sd, EVFILT_READ, EV_DELETE, 0, 0, (void *)c);
|
191
|
+
|
192
|
+
event_del_out(evb, c);
|
193
|
+
|
194
|
+
c->recv_active = 0;
|
195
|
+
c->send_active = 0;
|
196
|
+
|
197
|
+
/*
|
198
|
+
* Now, eliminate pending events for c->sd (there should be at most one
|
199
|
+
* other event). This is important because we will close c->sd and free
|
200
|
+
* c when we return.
|
201
|
+
*/
|
202
|
+
for (i = evb->n_processed + 1; i < evb->n_returned; i++) {
|
203
|
+
struct kevent *ev = &evb->kevents[i];
|
204
|
+
if (ev->ident == (uintptr_t)c->sd) {
|
205
|
+
ev->flags = 0;
|
206
|
+
ev->filter = 0;
|
207
|
+
break;
|
208
|
+
}
|
209
|
+
}
|
210
|
+
|
211
|
+
return 0;
|
212
|
+
}
|
213
|
+
|
214
|
+
int
|
215
|
+
event_wait(struct evbase *evb, int timeout)
|
216
|
+
{
|
217
|
+
int kq = evb->kq;
|
218
|
+
struct timespec ts = nc_millisec_to_timespec(timeout);
|
219
|
+
void (*callback_fp)(void *, uint32_t) = evb->callback_fp;
|
220
|
+
|
221
|
+
ASSERT(kq > 0);
|
222
|
+
|
223
|
+
for (;;) {
|
224
|
+
evb->n_returned = kevent(kq, evb->changes, evb->n_changes, evb->kevents,
|
225
|
+
evb->nevent, &ts);
|
226
|
+
evb->n_changes = 0;
|
227
|
+
if (evb->n_returned > 0) {
|
228
|
+
for (evb->n_processed = 0; evb->n_processed < evb->n_returned;
|
229
|
+
evb->n_processed++) {
|
230
|
+
struct kevent *ev = &evb->kevents[evb->n_processed];
|
231
|
+
|
232
|
+
uint32_t evflags = 0;
|
233
|
+
if (ev->flags & EV_ERROR) {
|
234
|
+
/*
|
235
|
+
* Error messages that can happen, when a delete fails.
|
236
|
+
* EBADF happens when the file descriptor has been
|
237
|
+
* closed,
|
238
|
+
* ENOENT when the file descriptor was closed and
|
239
|
+
* then reopened.
|
240
|
+
* EINVAL for some reasons not understood; EINVAL
|
241
|
+
* should not be returned ever; but FreeBSD does :-\
|
242
|
+
* An error is also indicated when a callback deletes
|
243
|
+
* an event we are still processing. In that case
|
244
|
+
* the data field is set to ENOENT.
|
245
|
+
*/
|
246
|
+
if (ev->data == EBADF ||
|
247
|
+
ev->data == EINVAL ||
|
248
|
+
ev->data == ENOENT)
|
249
|
+
continue;
|
250
|
+
evflags |= EV_ERR;
|
251
|
+
}
|
252
|
+
|
253
|
+
if (ev->filter == EVFILT_READ)
|
254
|
+
evflags |= EV_READ;
|
255
|
+
|
256
|
+
if (ev->filter == EVFILT_WRITE)
|
257
|
+
evflags |= EV_WRITE;
|
258
|
+
|
259
|
+
if (callback_fp != NULL && evflags != 0)
|
260
|
+
(*callback_fp)((void *)(ev->udata), evflags);
|
261
|
+
}
|
262
|
+
return evb->n_returned;
|
263
|
+
}
|
264
|
+
|
265
|
+
if (evb->n_returned == 0) {
|
266
|
+
if (timeout == -1) {
|
267
|
+
log_error("kqueue on kq %d with %d events and %d timeout "
|
268
|
+
"returned no events", kq, evb->nevent, timeout);
|
269
|
+
return -1;
|
270
|
+
}
|
271
|
+
|
272
|
+
return 0;
|
273
|
+
}
|
274
|
+
|
275
|
+
if (errno == EINTR) {
|
276
|
+
continue;
|
277
|
+
}
|
278
|
+
|
279
|
+
log_error("kevent on kq %d with %d events failed: %s", kq, evb->nevent,
|
280
|
+
strerror(errno));
|
281
|
+
|
282
|
+
return -1;
|
283
|
+
}
|
284
|
+
NOT_REACHED();
|
285
|
+
}
|
286
|
+
|
287
|
+
int
|
288
|
+
event_add_st(struct evbase *evb, int fd)
|
289
|
+
{
|
290
|
+
struct kevent *ev = &evb->changes[(evb->n_changes)++];
|
291
|
+
EV_SET(ev, fd, EVFILT_READ, EV_ADD | EV_CLEAR, 0, 0, NULL);
|
292
|
+
|
293
|
+
return 0;
|
294
|
+
}
|
295
|
+
|
296
|
+
#endif /* NC_HAVE_KQUEUE */
|
Binary file
|
data/ext/nutcracker/src/nc_log.c
CHANGED
File without changes
|
data/ext/nutcracker/src/nc_log.h
CHANGED
File without changes
|
Binary file
|
File without changes
|
File without changes
|
Binary file
|
File without changes
|
@@ -71,6 +71,7 @@ typedef enum msg_type {
|
|
71
71
|
MSG_REQ_REDIS_BITCOUNT,
|
72
72
|
MSG_REQ_REDIS_DECR,
|
73
73
|
MSG_REQ_REDIS_DECRBY,
|
74
|
+
MSG_REQ_REDIS_DUMP,
|
74
75
|
MSG_REQ_REDIS_GET,
|
75
76
|
MSG_REQ_REDIS_GETBIT,
|
76
77
|
MSG_REQ_REDIS_GETRANGE,
|
@@ -80,6 +81,7 @@ typedef enum msg_type {
|
|
80
81
|
MSG_REQ_REDIS_INCRBYFLOAT,
|
81
82
|
MSG_REQ_REDIS_MGET,
|
82
83
|
MSG_REQ_REDIS_PSETEX,
|
84
|
+
MSG_REQ_REDIS_RESTORE,
|
83
85
|
MSG_REQ_REDIS_SET,
|
84
86
|
MSG_REQ_REDIS_SETBIT,
|
85
87
|
MSG_REQ_REDIS_SETEX,
|
Binary file
|
@@ -163,18 +163,18 @@ proxy_listen(struct context *ctx, struct conn *p)
|
|
163
163
|
return NC_ERROR;
|
164
164
|
}
|
165
165
|
|
166
|
-
status = event_add_conn(ctx->
|
166
|
+
status = event_add_conn(ctx->evb, p);
|
167
167
|
if (status < 0) {
|
168
|
-
log_error("event add conn
|
169
|
-
|
168
|
+
log_error("event add conn p %d on addr '%.*s' failed: %s",
|
169
|
+
p->sd, pool->addrstr.len, pool->addrstr.data,
|
170
170
|
strerror(errno));
|
171
171
|
return NC_ERROR;
|
172
172
|
}
|
173
173
|
|
174
|
-
status = event_del_out(ctx->
|
174
|
+
status = event_del_out(ctx->evb, p);
|
175
175
|
if (status < 0) {
|
176
|
-
log_error("event del out
|
177
|
-
|
176
|
+
log_error("event del out p %d on addr '%.*s' failed: %s",
|
177
|
+
p->sd, pool->addrstr.len, pool->addrstr.data,
|
178
178
|
strerror(errno));
|
179
179
|
return NC_ERROR;
|
180
180
|
}
|
@@ -325,9 +325,9 @@ proxy_accept(struct context *ctx, struct conn *p)
|
|
325
325
|
}
|
326
326
|
}
|
327
327
|
|
328
|
-
status = event_add_conn(ctx->
|
328
|
+
status = event_add_conn(ctx->evb, c);
|
329
329
|
if (status < 0) {
|
330
|
-
log_error("event add conn
|
330
|
+
log_error("event add conn from p %d failed: %s", p->sd,
|
331
331
|
strerror(errno));
|
332
332
|
c->close(ctx, c);
|
333
333
|
return status;
|
File without changes
|
Binary file
|
File without changes
|
File without changes
|
File without changes
|
Binary file
|
@@ -413,7 +413,7 @@ req_forward_error(struct context *ctx, struct conn *conn, struct msg *msg)
|
|
413
413
|
}
|
414
414
|
|
415
415
|
if (req_done(conn, TAILQ_FIRST(&conn->omsg_q))) {
|
416
|
-
status = event_add_out(ctx->
|
416
|
+
status = event_add_out(ctx->evb, conn);
|
417
417
|
if (status != NC_OK) {
|
418
418
|
conn->err = errno;
|
419
419
|
}
|
@@ -482,7 +482,7 @@ req_forward(struct context *ctx, struct conn *c_conn, struct msg *msg)
|
|
482
482
|
|
483
483
|
/* enqueue the message (request) into server inq */
|
484
484
|
if (TAILQ_EMPTY(&s_conn->imsg_q)) {
|
485
|
-
status = event_add_out(ctx->
|
485
|
+
status = event_add_out(ctx->evb, s_conn);
|
486
486
|
if (status != NC_OK) {
|
487
487
|
req_forward_error(ctx, c_conn, msg);
|
488
488
|
s_conn->err = errno;
|
@@ -533,7 +533,7 @@ req_send_next(struct context *ctx, struct conn *conn)
|
|
533
533
|
nmsg = TAILQ_FIRST(&conn->imsg_q);
|
534
534
|
if (nmsg == NULL) {
|
535
535
|
/* nothing to send as the server inq is empty */
|
536
|
-
status = event_del_out(ctx->
|
536
|
+
status = event_del_out(ctx->evb, conn);
|
537
537
|
if (status != NC_OK) {
|
538
538
|
conn->err = errno;
|
539
539
|
}
|