vincentchu-handlersocket 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (135) hide show
  1. data/ext/HandlerSocket-Plugin-for-MySQL/AUTHORS +22 -0
  2. data/ext/HandlerSocket-Plugin-for-MySQL/COPYING +30 -0
  3. data/ext/HandlerSocket-Plugin-for-MySQL/ChangeLog +12 -0
  4. data/ext/HandlerSocket-Plugin-for-MySQL/Makefile.am +87 -0
  5. data/ext/HandlerSocket-Plugin-for-MySQL/README +78 -0
  6. data/ext/HandlerSocket-Plugin-for-MySQL/autogen.sh +117 -0
  7. data/ext/HandlerSocket-Plugin-for-MySQL/client/Makefile.am +24 -0
  8. data/ext/HandlerSocket-Plugin-for-MySQL/client/hsclient.cpp +88 -0
  9. data/ext/HandlerSocket-Plugin-for-MySQL/client/hslongrun.cpp +1041 -0
  10. data/ext/HandlerSocket-Plugin-for-MySQL/client/hspool_test.pl +224 -0
  11. data/ext/HandlerSocket-Plugin-for-MySQL/client/hstest.cpp +1532 -0
  12. data/ext/HandlerSocket-Plugin-for-MySQL/client/hstest.pl +228 -0
  13. data/ext/HandlerSocket-Plugin-for-MySQL/client/hstest_hs.sh +4 -0
  14. data/ext/HandlerSocket-Plugin-for-MySQL/client/hstest_hs_more50.sh +4 -0
  15. data/ext/HandlerSocket-Plugin-for-MySQL/client/hstest_md.sh +7 -0
  16. data/ext/HandlerSocket-Plugin-for-MySQL/client/hstest_my.sh +3 -0
  17. data/ext/HandlerSocket-Plugin-for-MySQL/client/hstest_my_more50.sh +3 -0
  18. data/ext/HandlerSocket-Plugin-for-MySQL/configure.ac +144 -0
  19. data/ext/HandlerSocket-Plugin-for-MySQL/docs-en/about-handlersocket.en.txt +72 -0
  20. data/ext/HandlerSocket-Plugin-for-MySQL/docs-en/configuration-options.en.txt +99 -0
  21. data/ext/HandlerSocket-Plugin-for-MySQL/docs-en/installation.en.txt +92 -0
  22. data/ext/HandlerSocket-Plugin-for-MySQL/docs-en/perl-client.en.txt +135 -0
  23. data/ext/HandlerSocket-Plugin-for-MySQL/docs-en/protocol.en.txt +205 -0
  24. data/ext/HandlerSocket-Plugin-for-MySQL/docs-ja/about-handlersocket.ja.txt +51 -0
  25. data/ext/HandlerSocket-Plugin-for-MySQL/docs-ja/installation.ja.txt +88 -0
  26. data/ext/HandlerSocket-Plugin-for-MySQL/docs-ja/perl-client.ja.txt +127 -0
  27. data/ext/HandlerSocket-Plugin-for-MySQL/docs-ja/protocol.ja.txt +180 -0
  28. data/ext/HandlerSocket-Plugin-for-MySQL/handlersocket/COPYRIGHT.txt +27 -0
  29. data/ext/HandlerSocket-Plugin-for-MySQL/handlersocket/Makefile.am +10 -0
  30. data/ext/HandlerSocket-Plugin-for-MySQL/handlersocket/Makefile.plain.template +31 -0
  31. data/ext/HandlerSocket-Plugin-for-MySQL/handlersocket/database.cpp +1190 -0
  32. data/ext/HandlerSocket-Plugin-for-MySQL/handlersocket/database.hpp +142 -0
  33. data/ext/HandlerSocket-Plugin-for-MySQL/handlersocket/handlersocket.cpp +222 -0
  34. data/ext/HandlerSocket-Plugin-for-MySQL/handlersocket/handlersocket.spec.template +29 -0
  35. data/ext/HandlerSocket-Plugin-for-MySQL/handlersocket/hstcpsvr.cpp +149 -0
  36. data/ext/HandlerSocket-Plugin-for-MySQL/handlersocket/hstcpsvr.hpp +58 -0
  37. data/ext/HandlerSocket-Plugin-for-MySQL/handlersocket/hstcpsvr_worker.cpp +951 -0
  38. data/ext/HandlerSocket-Plugin-for-MySQL/handlersocket/hstcpsvr_worker.hpp +35 -0
  39. data/ext/HandlerSocket-Plugin-for-MySQL/handlersocket/mysql_incl.hpp +50 -0
  40. data/ext/HandlerSocket-Plugin-for-MySQL/libhsclient/COPYRIGHT.txt +27 -0
  41. data/ext/HandlerSocket-Plugin-for-MySQL/libhsclient/Makefile.am +12 -0
  42. data/ext/HandlerSocket-Plugin-for-MySQL/libhsclient/Makefile.plain +27 -0
  43. data/ext/HandlerSocket-Plugin-for-MySQL/libhsclient/allocator.hpp +64 -0
  44. data/ext/HandlerSocket-Plugin-for-MySQL/libhsclient/auto_addrinfo.hpp +49 -0
  45. data/ext/HandlerSocket-Plugin-for-MySQL/libhsclient/auto_file.hpp +64 -0
  46. data/ext/HandlerSocket-Plugin-for-MySQL/libhsclient/auto_ptrcontainer.hpp +67 -0
  47. data/ext/HandlerSocket-Plugin-for-MySQL/libhsclient/config.cpp +67 -0
  48. data/ext/HandlerSocket-Plugin-for-MySQL/libhsclient/config.hpp +32 -0
  49. data/ext/HandlerSocket-Plugin-for-MySQL/libhsclient/escape.cpp +127 -0
  50. data/ext/HandlerSocket-Plugin-for-MySQL/libhsclient/escape.hpp +66 -0
  51. data/ext/HandlerSocket-Plugin-for-MySQL/libhsclient/fatal.cpp +36 -0
  52. data/ext/HandlerSocket-Plugin-for-MySQL/libhsclient/fatal.hpp +22 -0
  53. data/ext/HandlerSocket-Plugin-for-MySQL/libhsclient/hstcpcli.cpp +441 -0
  54. data/ext/HandlerSocket-Plugin-for-MySQL/libhsclient/hstcpcli.hpp +62 -0
  55. data/ext/HandlerSocket-Plugin-for-MySQL/libhsclient/libhsclient.spec.template +39 -0
  56. data/ext/HandlerSocket-Plugin-for-MySQL/libhsclient/mutex.hpp +51 -0
  57. data/ext/HandlerSocket-Plugin-for-MySQL/libhsclient/socket.cpp +186 -0
  58. data/ext/HandlerSocket-Plugin-for-MySQL/libhsclient/socket.hpp +51 -0
  59. data/ext/HandlerSocket-Plugin-for-MySQL/libhsclient/string_buffer.hpp +118 -0
  60. data/ext/HandlerSocket-Plugin-for-MySQL/libhsclient/string_ref.hpp +63 -0
  61. data/ext/HandlerSocket-Plugin-for-MySQL/libhsclient/string_util.cpp +182 -0
  62. data/ext/HandlerSocket-Plugin-for-MySQL/libhsclient/string_util.hpp +53 -0
  63. data/ext/HandlerSocket-Plugin-for-MySQL/libhsclient/thread.hpp +84 -0
  64. data/ext/HandlerSocket-Plugin-for-MySQL/libhsclient/util.hpp +25 -0
  65. data/ext/HandlerSocket-Plugin-for-MySQL/misc/microbench-hs.log +130 -0
  66. data/ext/HandlerSocket-Plugin-for-MySQL/misc/microbench-my.log +125 -0
  67. data/ext/HandlerSocket-Plugin-for-MySQL/perl-Net-HandlerSocket/COPYRIGHT.txt +27 -0
  68. data/ext/HandlerSocket-Plugin-for-MySQL/perl-Net-HandlerSocket/Changes +6 -0
  69. data/ext/HandlerSocket-Plugin-for-MySQL/perl-Net-HandlerSocket/HandlerSocket.xs +632 -0
  70. data/ext/HandlerSocket-Plugin-for-MySQL/perl-Net-HandlerSocket/MANIFEST +8 -0
  71. data/ext/HandlerSocket-Plugin-for-MySQL/perl-Net-HandlerSocket/Makefile.PL +18 -0
  72. data/ext/HandlerSocket-Plugin-for-MySQL/perl-Net-HandlerSocket/Makefile.PL.installed +20 -0
  73. data/ext/HandlerSocket-Plugin-for-MySQL/perl-Net-HandlerSocket/README +30 -0
  74. data/ext/HandlerSocket-Plugin-for-MySQL/perl-Net-HandlerSocket/lib/Net/HandlerSocket.pm +68 -0
  75. data/ext/HandlerSocket-Plugin-for-MySQL/perl-Net-HandlerSocket/lib/Net/HandlerSocket/Pool.pm +362 -0
  76. data/ext/HandlerSocket-Plugin-for-MySQL/perl-Net-HandlerSocket/perl-Net-HandlerSocket.spec.template +127 -0
  77. data/ext/HandlerSocket-Plugin-for-MySQL/perl-Net-HandlerSocket/ppport.h +6375 -0
  78. data/ext/HandlerSocket-Plugin-for-MySQL/perl-Net-HandlerSocket/t/Net-HandlerSocket.t +15 -0
  79. data/ext/HandlerSocket-Plugin-for-MySQL/regtest/Makefile +79 -0
  80. data/ext/HandlerSocket-Plugin-for-MySQL/regtest/common/binary_my.cnf +4 -0
  81. data/ext/HandlerSocket-Plugin-for-MySQL/regtest/common/compat.sh +29 -0
  82. data/ext/HandlerSocket-Plugin-for-MySQL/regtest/common/hstest.pm +66 -0
  83. data/ext/HandlerSocket-Plugin-for-MySQL/regtest/test_01_lib/Makefile +4 -0
  84. data/ext/HandlerSocket-Plugin-for-MySQL/regtest/test_01_lib/run.sh +27 -0
  85. data/ext/HandlerSocket-Plugin-for-MySQL/regtest/test_01_lib/test01.expected +100 -0
  86. data/ext/HandlerSocket-Plugin-for-MySQL/regtest/test_01_lib/test01.pl +38 -0
  87. data/ext/HandlerSocket-Plugin-for-MySQL/regtest/test_01_lib/test02.expected +100 -0
  88. data/ext/HandlerSocket-Plugin-for-MySQL/regtest/test_01_lib/test02.pl +49 -0
  89. data/ext/HandlerSocket-Plugin-for-MySQL/regtest/test_01_lib/test03.expected +771 -0
  90. data/ext/HandlerSocket-Plugin-for-MySQL/regtest/test_01_lib/test03.pl +61 -0
  91. data/ext/HandlerSocket-Plugin-for-MySQL/regtest/test_01_lib/test04.expected +0 -0
  92. data/ext/HandlerSocket-Plugin-for-MySQL/regtest/test_01_lib/test04.pl +63 -0
  93. data/ext/HandlerSocket-Plugin-for-MySQL/regtest/test_01_lib/test05.expected +771 -0
  94. data/ext/HandlerSocket-Plugin-for-MySQL/regtest/test_01_lib/test05.pl +59 -0
  95. data/ext/HandlerSocket-Plugin-for-MySQL/regtest/test_01_lib/test06.expected +644 -0
  96. data/ext/HandlerSocket-Plugin-for-MySQL/regtest/test_01_lib/test06.pl +90 -0
  97. data/ext/HandlerSocket-Plugin-for-MySQL/regtest/test_01_lib/test07.expected +304 -0
  98. data/ext/HandlerSocket-Plugin-for-MySQL/regtest/test_01_lib/test07.pl +98 -0
  99. data/ext/HandlerSocket-Plugin-for-MySQL/regtest/test_01_lib/test08.expected +2 -0
  100. data/ext/HandlerSocket-Plugin-for-MySQL/regtest/test_01_lib/test08.pl +48 -0
  101. data/ext/HandlerSocket-Plugin-for-MySQL/regtest/test_01_lib/test09.expected +12 -0
  102. data/ext/HandlerSocket-Plugin-for-MySQL/regtest/test_01_lib/test09.pl +67 -0
  103. data/ext/HandlerSocket-Plugin-for-MySQL/regtest/test_01_lib/test10.expected +771 -0
  104. data/ext/HandlerSocket-Plugin-for-MySQL/regtest/test_01_lib/test10.pl +93 -0
  105. data/ext/HandlerSocket-Plugin-for-MySQL/regtest/test_01_lib/test11.expected +37 -0
  106. data/ext/HandlerSocket-Plugin-for-MySQL/regtest/test_01_lib/test11.pl +112 -0
  107. data/ext/HandlerSocket-Plugin-for-MySQL/regtest/test_01_lib/test12.expected +273 -0
  108. data/ext/HandlerSocket-Plugin-for-MySQL/regtest/test_01_lib/test12.pl +134 -0
  109. data/ext/HandlerSocket-Plugin-for-MySQL/regtest/test_01_lib/test13.expected +92 -0
  110. data/ext/HandlerSocket-Plugin-for-MySQL/regtest/test_01_lib/test13.pl +92 -0
  111. data/ext/HandlerSocket-Plugin-for-MySQL/regtest/test_01_lib/test14.expected +144 -0
  112. data/ext/HandlerSocket-Plugin-for-MySQL/regtest/test_01_lib/test14.pl +80 -0
  113. data/ext/HandlerSocket-Plugin-for-MySQL/regtest/test_01_lib/test15.expected +764 -0
  114. data/ext/HandlerSocket-Plugin-for-MySQL/regtest/test_01_lib/test15.pl +114 -0
  115. data/ext/HandlerSocket-Plugin-for-MySQL/regtest/test_01_lib/test16.expected +66 -0
  116. data/ext/HandlerSocket-Plugin-for-MySQL/regtest/test_01_lib/test16.pl +88 -0
  117. data/ext/HandlerSocket-Plugin-for-MySQL/regtest/test_01_lib/test17.expected +0 -0
  118. data/ext/HandlerSocket-Plugin-for-MySQL/regtest/test_01_lib/test17.pl +125 -0
  119. data/ext/HandlerSocket-Plugin-for-MySQL/regtest/test_01_lib/test18.expected +22 -0
  120. data/ext/HandlerSocket-Plugin-for-MySQL/regtest/test_01_lib/test18.pl +63 -0
  121. data/ext/HandlerSocket-Plugin-for-MySQL/regtest/test_01_lib/test19.expected +14894 -0
  122. data/ext/HandlerSocket-Plugin-for-MySQL/regtest/test_01_lib/test19.pl +190 -0
  123. data/ext/HandlerSocket-Plugin-for-MySQL/regtest/test_01_lib/test20.expected +2 -0
  124. data/ext/HandlerSocket-Plugin-for-MySQL/regtest/test_01_lib/test20.pl +33 -0
  125. data/ext/HandlerSocket-Plugin-for-MySQL/regtest/test_01_lib/test21.expected +11 -0
  126. data/ext/HandlerSocket-Plugin-for-MySQL/regtest/test_01_lib/test21.pl +58 -0
  127. data/ext/HandlerSocket-Plugin-for-MySQL/regtest/test_01_lib/test22.expected +9 -0
  128. data/ext/HandlerSocket-Plugin-for-MySQL/regtest/test_01_lib/test22.pl +61 -0
  129. data/ext/HandlerSocket-Plugin-for-MySQL/regtest/test_01_lib/test23.expected +101 -0
  130. data/ext/HandlerSocket-Plugin-for-MySQL/regtest/test_01_lib/test23.pl +53 -0
  131. data/ext/winebarrel-ruby-handlersocket-c19841e47ea2/README +33 -0
  132. data/ext/winebarrel-ruby-handlersocket-c19841e47ea2/extconf.rb +27 -0
  133. data/ext/winebarrel-ruby-handlersocket-c19841e47ea2/handlersocket.cpp +437 -0
  134. data/ext/winebarrel-ruby-handlersocket-c19841e47ea2/handlersocket.h +32 -0
  135. metadata +200 -0
@@ -0,0 +1,22 @@
1
+ Akira Higuchi (https://github.com/ahiguti)
2
+ - developed HanderSocket plugin, libhsclient, and perl-Net-HandlerSocket
3
+
4
+ Yoshinori Matsunobu (https://github.com/yoshinorim)
5
+ - introduced autotools, added support for MySQL 5.5.6, added statistics
6
+ variables
7
+
8
+ Jeff Hodges (https://github.com/jmhodges)
9
+ - fixed some autotools scripts
10
+
11
+ Toru Yamaguchi (https://github.com/zigorou)
12
+ - ported to MacOS X
13
+
14
+ Moriyoshi Koizumi (https://github.com/moriyoshi)
15
+ - fixed some autotools scripts
16
+
17
+ takeda-at (https://github.com/takada-at)
18
+ - added simple authorization function
19
+
20
+ WheresWardy (https://github.com/WheresWardy)
21
+ - added authentication functions to libhsclient
22
+
@@ -0,0 +1,30 @@
1
+ -----------------------------------------------------------------------------
2
+ HandlerSocket plugin for MySQL
3
+
4
+ Copyright (c) 2010 DeNA Co.,Ltd.
5
+ All rights reserved.
6
+
7
+ Redistribution and use in source and binary forms, with or without
8
+ modification, are permitted provided that the following conditions are met:
9
+
10
+ * Redistributions of source code must retain the above copyright
11
+ notice, this list of conditions and the following disclaimer.
12
+ * Redistributions in binary form must reproduce the above copyright
13
+ notice, this list of conditions and the following disclaimer in the
14
+ documentation and/or other materials provided with the distribution.
15
+ * Neither the name of DeNA Co.,Ltd. nor the names of its contributors
16
+ may be used to endorse or promote products derived from this software
17
+ without specific prior written permission.
18
+
19
+ THIS SOFTWARE IS PROVIDED BY DeNA Co.,Ltd. "AS IS" AND ANY EXPRESS OR
20
+ IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
21
+ MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
22
+ EVENT SHALL DeNA Co.,Ltd. BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
24
+ PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
25
+ OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
26
+ WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
27
+ OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
28
+ ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29
+
30
+
@@ -0,0 +1,12 @@
1
+ 1.0.6 - 2010-10-29
2
+ * Changed build instruction (autoreconf/configure/make), removed auto-generated files (Contributed by jmhodges)
3
+ *
4
+
5
+ 1.0.5 - 2010-10-18
6
+ * Changed build procedures (using typical configure/make)
7
+ * Supported 5.5.6
8
+ * Added status variables
9
+
10
+ 1.0.4 - 2010-08-15
11
+ * Initial public release
12
+
@@ -0,0 +1,87 @@
1
+
2
+ ACLOCAL_AMFLAGS = -I m4
3
+
4
+ SUBDIRS = @HANDLERSOCKET_SUBDIRS@
5
+
6
+ perl:
7
+ cd perl-Net-HandlerSocket && perl Makefile.PL && make
8
+
9
+ install_perl:
10
+ cd perl-Net-HandlerSocket && make install
11
+
12
+ rpms: rpm_cli rpm_perl rpm_c
13
+
14
+ rpm_dir:
15
+ - mkdir dist
16
+ - mkdir dist/BUILD dist/RPMS dist/SOURCES dist/SPECS dist/SRPMS
17
+
18
+ rpm_cli: clean_cli rpm_dir
19
+ sed -e "s/HANDLERSOCKET_VERSION/$(VERSION)/" \
20
+ libhsclient/libhsclient.spec.template \
21
+ > libhsclient/libhsclient.spec
22
+ tar cvfz dist/libhsclient.tar.gz libhsclient
23
+ rpmbuild --define "_topdir `pwd`/dist" -ta \
24
+ dist/libhsclient.tar.gz
25
+
26
+ rpm_perl: clean_perl rpm_dir
27
+ sed -e "s/HANDLERSOCKET_VERSION/$(VERSION)/" \
28
+ perl-Net-HandlerSocket/perl-Net-HandlerSocket.spec.template \
29
+ > perl-Net-HandlerSocket/perl-Net-HandlerSocket.spec
30
+ cd perl-Net-HandlerSocket && perl Makefile.PL && make clean && \
31
+ rm -f Makefile.old
32
+ tar cvfz dist/perl-Net-HandlerSocket.tar.gz perl-Net-HandlerSocket
33
+ rpmbuild --define "_topdir `pwd`/dist" -ta \
34
+ dist/perl-Net-HandlerSocket.tar.gz
35
+
36
+ rpm_c: clean_c rpm_dir
37
+ sed -e "s/HANDLERSOCKET_VERSION/$(VERSION)/" \
38
+ handlersocket/handlersocket.spec.template \
39
+ > handlersocket/handlersocket.spec
40
+ sed -e "s|HANDLERSOCKET_MYSQL_INC|$(MYSQL_CFLAGS) $(MYSQL_INC)|" \
41
+ -e "s|HANDLERSOCKET_MYSQL_LIB|$(MYSQL_LIB)|" \
42
+ handlersocket/Makefile.plain.template \
43
+ > handlersocket/Makefile.plain
44
+ tar cvfz dist/handlersocket.tar.gz handlersocket
45
+ rpmbuild --define "_topdir `pwd`/dist" -ta \
46
+ dist/handlersocket.tar.gz
47
+
48
+ install_rpm_pl:
49
+ - sudo rpm -e perl-Net-HandlerSocket
50
+ - sudo rpm -e perl-Net-HandlerSocket-debuginfo
51
+ make clean
52
+ make rpm_perl
53
+ - sudo rpm -U dist/RPMS/*/perl*.rpm
54
+
55
+ installrpms:
56
+ - sudo rpm -e handlersocket
57
+ - sudo rpm -e handlersocket-debuginfo
58
+ - sudo rpm -e perl-Net-HandlerSocket
59
+ - sudo rpm -e perl-Net-HandlerSocket-debuginfo
60
+ - sudo rpm -e libhsclient
61
+ - sudo rpm -e libhsclient-debuginfo
62
+ make clean
63
+ make rpm_cli
64
+ - sudo rpm -U dist/RPMS/*/libhsclient*.rpm
65
+ make clean
66
+ make rpm_perl
67
+ - sudo rpm -U dist/RPMS/*/perl*.rpm
68
+ make clean
69
+ make rpm_c
70
+ - sudo rpm -U dist/RPMS/*/handlersocket*.rpm
71
+
72
+ clean_cli:
73
+ cd libhsclient && make clean
74
+ cd client && make clean
75
+
76
+ clean_perl:
77
+ cd perl-Net-HandlerSocket && perl Makefile.PL && make clean && \
78
+ rm -f Makefile.old
79
+
80
+ clean_c:
81
+ cd handlersocket && make clean
82
+
83
+ clean_all: clean_cli clean_perl clean_c
84
+ cd regtest && make clean
85
+ rm -rf dist/*/*
86
+ rm -f dist/*.tar.gz
87
+
@@ -0,0 +1,78 @@
1
+
2
+ -----------------------------------------------------------------------------
3
+ HandlerSocket plugin for MySQL
4
+
5
+ Copyright (c) 2010 DeNA Co.,Ltd.
6
+ All rights reserved.
7
+
8
+ Redistribution and use in source and binary forms, with or without
9
+ modification, are permitted provided that the following conditions are met:
10
+
11
+ * Redistributions of source code must retain the above copyright
12
+ notice, this list of conditions and the following disclaimer.
13
+ * Redistributions in binary form must reproduce the above copyright
14
+ notice, this list of conditions and the following disclaimer in the
15
+ documentation and/or other materials provided with the distribution.
16
+ * Neither the name of DeNA Co.,Ltd. nor the names of its contributors
17
+ may be used to endorse or promote products derived from this software
18
+ without specific prior written permission.
19
+
20
+ THIS SOFTWARE IS PROVIDED BY DeNA Co.,Ltd. "AS IS" AND ANY EXPRESS OR
21
+ IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
22
+ MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
23
+ EVENT SHALL DeNA Co.,Ltd. BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
25
+ PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
26
+ OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
27
+ WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
28
+ OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
29
+ ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30
+
31
+
32
+ -----------------------------------------------------------------------------
33
+ About HandlerSocket
34
+
35
+ HandlerSocket is a NoSQL plugin for MySQL. It works as a daemon inside the
36
+ mysqld process, accept tcp connections, and execute requests from clients.
37
+ HandlerSocket does not support SQL queries. Instead, it supports simple CRUD
38
+ operations on tables.
39
+
40
+ Because of the following reasons, HandlerSocket is much faster than the
41
+ mysqld/libmysql pair in some circumstances:
42
+
43
+ - HandlerSocket manipulates data without parsing SQL, which causes less
44
+ CPU usage.
45
+ - HandlerSocket reads many requests from clients and executes their
46
+ requests in bulk, which causes less CPU and disk usage.
47
+ - HandlerSocket client/server protocol is more compact than the
48
+ mysql/libmysql pair, which causes less network usage.
49
+
50
+ The current version of HandlerSocket only works with GNU/Linux. The source
51
+ archive of HandlerSocket includes a C++ and a Perl client libraries.
52
+ Here is a list of client libraries for other languages:
53
+
54
+ - PHP
55
+ http://openpear.org/package/Net_HandlerSocket
56
+ http://github.com/tz-lom/HSPHP
57
+ http://code.google.com/p/php-handlersocket/
58
+ - Java
59
+ http://code.google.com/p/hs4j/
60
+ http://code.google.com/p/handlersocketforjava/
61
+ - Python
62
+ http://pypi.python.org/pypi/python-handler-socket
63
+ https://code.launchpad.net/~songofacandy/+junk/pyhandlersocket
64
+ - Ruby
65
+ https://github.com/winebarrel/ruby-handlersocket
66
+ https://github.com/miyucy/handlersocket
67
+ - JavaScript
68
+ https://github.com/koichik/node-handlersocket
69
+ - Scala
70
+ https://github.com/fujohnwang/hs2client
71
+ - Haskell
72
+ https://github.com/wuxb45/HandlerSocket-Haskell-Client
73
+
74
+ The home of HandlerSocket is here:
75
+ https://github.com/ahiguti/HandlerSocket-Plugin-for-MySQL
76
+
77
+ More documents are available in docs-en/ and docs-ja/ directories.
78
+
@@ -0,0 +1,117 @@
1
+ #!/bin/sh
2
+
3
+ warn() {
4
+ echo -e "\tWARNING: $@" 1>&2
5
+ }
6
+
7
+ # init
8
+
9
+ LIBTOOLIZE=libtoolize
10
+ ACLOCAL=aclocal
11
+ AUTOCONF=autoconf
12
+ AUTOHEADER=autoheader
13
+ AUTOMAKE=automake
14
+
15
+ case `uname -s` in
16
+ Darwin)
17
+ LIBTOOLIZE=glibtoolize
18
+ ;;
19
+ FreeBSD)
20
+ ACLOCAL_ARGS="$ACLOCAL_ARGS -I /usr/local/share/aclocal/"
21
+ ;;
22
+ esac
23
+
24
+
25
+ # libtoolize
26
+ echo "Searching libtoolize..."
27
+ if [ `which $LIBTOOLIZE` ] ; then
28
+ echo -e "\tFOUND: libtoolize -> $LIBTOOLIZE"
29
+ else
30
+ warn "Cannot Found libtoolize... input libtool command"
31
+ read LIBTOOLIZE
32
+ LIBTOOLIZE=`which $LIBTOOLIZE`
33
+ if [ `which $LIBTOOLIZE` ] ; then
34
+ echo -e "\tSET: libtoolize -> $LIBTOOLIZE"
35
+ else
36
+ warn "$LIBTOOLIZE: Command not found."
37
+ exit 1;
38
+ fi
39
+ fi
40
+
41
+ # aclocal
42
+ echo "Searching aclocal..."
43
+ if [ `which $ACLOCAL` ] ; then
44
+ echo -e "\tFOUND: aclocal -> $ACLOCAL"
45
+ else
46
+ warn "Cannot Found aclocal... input aclocal command"
47
+ read ACLOCAL
48
+ ACLOCAL=`which $ACLOCAL`
49
+ if [ `which $ACLOCAL` ] ; then
50
+ echo -e "\tSET: aclocal -> $ACLOCAL"
51
+ else
52
+ warn "$ACLOCAL: Command not found."
53
+ exit 1;
54
+ fi
55
+ fi
56
+
57
+ # automake
58
+ echo "Searching automake..."
59
+ if [ `which $AUTOMAKE` ] ; then
60
+ echo -e "\tFOUND: automake -> $AUTOMAKE"
61
+ else
62
+ warn "Cannot Found automake... input automake command"
63
+ read AUTOMAKE
64
+ ACLOCAL=`which $AUTOMAKE`
65
+ if [ `which $AUTOMAKE` ] ; then
66
+ echo -e "\tSET: automake -> $AUTOMAKE"
67
+ else
68
+ warn "$AUTOMAKE: Command not found."
69
+ exit 1;
70
+ fi
71
+ fi
72
+
73
+ # autoheader
74
+ echo "Searching autoheader..."
75
+ if [ `which $AUTOHEADER` ] ; then
76
+ echo -e "\tFOUND: autoheader -> $AUTOHEADER"
77
+ else
78
+ warn "Cannot Found autoheader... input autoheader command"
79
+ read AUTOHEADER
80
+ ACLOCAL=`which $AUTOHEADER`
81
+ if [ `which $AUTOHEADER` ] ; then
82
+ echo -e "\tSET: autoheader -> $AUTOHEADER"
83
+ else
84
+ warn "$AUTOHEADER: Command not found."
85
+ exit 1;
86
+ fi
87
+ fi
88
+
89
+ # autoconf
90
+ echo "Searching autoconf..."
91
+ if [ `which $AUTOCONF` ] ; then
92
+ echo -e "\tFOUND: autoconf -> $AUTOCONF"
93
+ else
94
+ warn "Cannot Found autoconf... input autoconf command"
95
+ read AUTOCONF
96
+ ACLOCAL=`which $AUTOCONF`
97
+ if [ `which $AUTOCONF` ] ; then
98
+ echo -e "\tSET: autoconf -> $AUTOCONF"
99
+ else
100
+ warn "$AUTOCONF: Command not found."
101
+ exit 1;
102
+ fi
103
+ fi
104
+
105
+ echo "Running libtoolize ..."
106
+ $LIBTOOLIZE --force --copy
107
+ echo "Running aclocal ..."
108
+ $ACLOCAL ${ACLOCAL_ARGS} -I .
109
+ echo "Running autoheader..."
110
+ $AUTOHEADER
111
+ echo "Running automake ..."
112
+ $AUTOMAKE --add-missing --copy
113
+ echo "Running autoconf ..."
114
+ $AUTOCONF
115
+
116
+ mkdir -p m4
117
+
@@ -0,0 +1,24 @@
1
+ AM_INCLUDES= -I../libhsclient
2
+ bin_PROGRAMS=hsclient
3
+ hsclient_SOURCES= hsclient.cpp
4
+ hsclient_LDFLAGS= -static -L../libhsclient -lhsclient
5
+ hsclient_CXXFLAGS= $(AM_INCLUDES)
6
+
7
+ hstest: hstest.o
8
+ $(CXX) $(CXXFLAGS) $(LFLAGS) hstest.o \
9
+ -L../libhsclient/.libs -lhsclient $$(mysql_config --libs_r) \
10
+ -o hstest
11
+
12
+ hstest.o: hstest.cpp
13
+ $(CXX) $(CXXFLAGS) $(AM_INCLUDES) $$(mysql_config --include) \
14
+ -c hstest.cpp
15
+
16
+ hslongrun: hslongrun.o
17
+ $(CXX) $(CXXFLAGS) $(LFLAGS) hslongrun.o \
18
+ -L../libhsclient/.libs -lhsclient $$(mysql_config --libs_r) \
19
+ -o hslongrun
20
+
21
+ hslongrun.o: hslongrun.cpp
22
+ $(CXX) $(CXXFLAGS) $(AM_INCLUDES) $$(mysql_config --include) \
23
+ -c hslongrun.cpp
24
+
@@ -0,0 +1,88 @@
1
+
2
+ // vim:sw=2:ai
3
+
4
+ #include "hstcpcli.hpp"
5
+ #include "string_util.hpp"
6
+
7
+ namespace dena {
8
+
9
+ int
10
+ hstcpcli_main(int argc, char **argv)
11
+ {
12
+ config conf;
13
+ parse_args(argc, argv, conf);
14
+ socket_args sockargs;
15
+ sockargs.set(conf);
16
+ hstcpcli_ptr cli = hstcpcli_i::create(sockargs);
17
+ const std::string dbname = conf.get_str("dbname", "hstest");
18
+ const std::string table = conf.get_str("table", "hstest_table1");
19
+ const std::string index = conf.get_str("index", "PRIMARY");
20
+ const std::string fields = conf.get_str("fields", "k,v");
21
+ const int limit = conf.get_int("limit", 0);
22
+ const int skip = conf.get_int("skip", 0);
23
+ std::vector<std::string> keys;
24
+ std::vector<string_ref> keyrefs;
25
+ size_t num_keys = 0;
26
+ while (true) {
27
+ const std::string conf_key = std::string("k") + to_stdstring(num_keys);
28
+ const std::string k = conf.get_str(conf_key, "");
29
+ const std::string kx = conf.get_str(conf_key, "x");
30
+ if (k.empty() && kx == "x") {
31
+ break;
32
+ }
33
+ ++num_keys;
34
+ keys.push_back(k);
35
+ }
36
+ for (size_t i = 0; i < keys.size(); ++i) {
37
+ const string_ref ref(keys[i].data(), keys[i].size());
38
+ keyrefs.push_back(ref);
39
+ }
40
+ const std::string op = conf.get_str("op", "=");
41
+ const string_ref op_ref(op.data(), op.size());
42
+ cli->request_buf_open_index(0, dbname.c_str(), table.c_str(),
43
+ index.c_str(), fields.c_str());
44
+ cli->request_buf_exec_generic(0, op_ref, num_keys == 0 ? 0 : &keyrefs[0],
45
+ num_keys, limit, skip, string_ref(), 0, 0);
46
+ int code = 0;
47
+ size_t numflds = 0;
48
+ do {
49
+ if (cli->request_send() != 0) {
50
+ fprintf(stderr, "request_send: %s\n", cli->get_error().c_str());
51
+ break;
52
+ }
53
+ if ((code = cli->response_recv(numflds)) != 0) {
54
+ fprintf(stderr, "response_recv: %s\n", cli->get_error().c_str());
55
+ break;
56
+ }
57
+ } while (false);
58
+ cli->response_buf_remove();
59
+ do {
60
+ if ((code = cli->response_recv(numflds)) != 0) {
61
+ fprintf(stderr, "response_recv: %s\n", cli->get_error().c_str());
62
+ break;
63
+ }
64
+ while (true) {
65
+ const string_ref *const row = cli->get_next_row();
66
+ if (row == 0) {
67
+ break;
68
+ }
69
+ printf("REC:");
70
+ for (size_t i = 0; i < numflds; ++i) {
71
+ const std::string val(row[i].begin(), row[i].size());
72
+ printf(" %s", val.c_str());
73
+ }
74
+ printf("\n");
75
+ }
76
+ } while (false);
77
+ cli->response_buf_remove();
78
+ return 0;
79
+ }
80
+
81
+ };
82
+
83
+ int
84
+ main(int argc, char **argv)
85
+ {
86
+ return dena::hstcpcli_main(argc, argv);
87
+ }
88
+