heroku-tokyotyrant 0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/COPYING +504 -0
- data/README.rdoc +231 -0
- data/Rakefile +72 -0
- data/benchmarks/balancer.rb +101 -0
- data/benchmarks/bulk_db.rb +74 -0
- data/benchmarks/bulk_table.rb +87 -0
- data/benchmarks/db.rb +114 -0
- data/benchmarks/table.rb +161 -0
- data/ext/extconf.rb +43 -0
- data/ext/tokyo/bin/tcamgr +0 -0
- data/ext/tokyo/bin/tcamttest +0 -0
- data/ext/tokyo/bin/tcatest +0 -0
- data/ext/tokyo/bin/tcbmgr +0 -0
- data/ext/tokyo/bin/tcbmttest +0 -0
- data/ext/tokyo/bin/tcbtest +0 -0
- data/ext/tokyo/bin/tcfmgr +0 -0
- data/ext/tokyo/bin/tcfmttest +0 -0
- data/ext/tokyo/bin/tcftest +0 -0
- data/ext/tokyo/bin/tchmgr +0 -0
- data/ext/tokyo/bin/tchmttest +0 -0
- data/ext/tokyo/bin/tchtest +0 -0
- data/ext/tokyo/bin/tcrmgr +0 -0
- data/ext/tokyo/bin/tcrmttest +0 -0
- data/ext/tokyo/bin/tcrtest +0 -0
- data/ext/tokyo/bin/tctmgr +0 -0
- data/ext/tokyo/bin/tctmttest +0 -0
- data/ext/tokyo/bin/tcttest +0 -0
- data/ext/tokyo/bin/tcucodec +0 -0
- data/ext/tokyo/bin/tcumttest +0 -0
- data/ext/tokyo/bin/tcutest +0 -0
- data/ext/tokyo/bin/ttserver +0 -0
- data/ext/tokyo/bin/ttulmgr +0 -0
- data/ext/tokyo/bin/ttultest +0 -0
- data/ext/tokyo/include/tcadb.h +548 -0
- data/ext/tokyo/include/tcbdb.h +1101 -0
- data/ext/tokyo/include/tcfdb.h +858 -0
- data/ext/tokyo/include/tchdb.h +871 -0
- data/ext/tokyo/include/tcrdb.h +801 -0
- data/ext/tokyo/include/tctdb.h +1086 -0
- data/ext/tokyo/include/tculog.h +392 -0
- data/ext/tokyo/include/tcutil.h +4184 -0
- data/ext/tokyo/include/ttutil.h +494 -0
- data/ext/tokyo/lib/libtokyocabinet.9.4.0.dylib +0 -0
- data/ext/tokyo/lib/libtokyocabinet.9.dylib +0 -0
- data/ext/tokyo/lib/libtokyocabinet.a +0 -0
- data/ext/tokyo/lib/libtokyocabinet.dylib +0 -0
- data/ext/tokyo/lib/libtokyotyrant.3.22.0.dylib +0 -0
- data/ext/tokyo/lib/libtokyotyrant.3.dylib +0 -0
- data/ext/tokyo/lib/libtokyotyrant.a +0 -0
- data/ext/tokyo/lib/libtokyotyrant.dylib +0 -0
- data/ext/tokyo/lib/pkgconfig/tokyocabinet.pc +14 -0
- data/ext/tokyo/lib/pkgconfig/tokyotyrant.pc +14 -0
- data/ext/tokyo/lib/ttskeldir.bundle +0 -0
- data/ext/tokyo/lib/ttskelmock.bundle +0 -0
- data/ext/tokyo/lib/ttskelnull.bundle +0 -0
- data/ext/tokyo/lib/ttskelproxy.bundle +0 -0
- data/ext/tokyo/libexec/tcawmgr.cgi +0 -0
- data/ext/tokyo/sbin/ttservctl +163 -0
- data/ext/tokyo/share/man/man1/tcamgr.1 +97 -0
- data/ext/tokyo/share/man/man1/tcamttest.1 +35 -0
- data/ext/tokyo/share/man/man1/tcatest.1 +55 -0
- data/ext/tokyo/share/man/man1/tcbmgr.1 +125 -0
- data/ext/tokyo/share/man/man1/tcbmttest.1 +81 -0
- data/ext/tokyo/share/man/man1/tcbtest.1 +107 -0
- data/ext/tokyo/share/man/man1/tcfmgr.1 +98 -0
- data/ext/tokyo/share/man/man1/tcfmttest.1 +62 -0
- data/ext/tokyo/share/man/man1/tcftest.1 +73 -0
- data/ext/tokyo/share/man/man1/tchmgr.1 +110 -0
- data/ext/tokyo/share/man/man1/tchmttest.1 +85 -0
- data/ext/tokyo/share/man/man1/tchtest.1 +95 -0
- data/ext/tokyo/share/man/man1/tcrmgr.1 +164 -0
- data/ext/tokyo/share/man/man1/tcrmttest.1 +55 -0
- data/ext/tokyo/share/man/man1/tcrtest.1 +89 -0
- data/ext/tokyo/share/man/man1/tctmgr.1 +140 -0
- data/ext/tokyo/share/man/man1/tctmttest.1 +92 -0
- data/ext/tokyo/share/man/man1/tcttest.1 +105 -0
- data/ext/tokyo/share/man/man1/tcucodec.1 +162 -0
- data/ext/tokyo/share/man/man1/tcumttest.1 +41 -0
- data/ext/tokyo/share/man/man1/tcutest.1 +81 -0
- data/ext/tokyo/share/man/man1/ttserver.1 +84 -0
- data/ext/tokyo/share/man/man1/ttulmgr.1 +40 -0
- data/ext/tokyo/share/man/man1/ttultest.1 +16 -0
- data/ext/tokyo/share/man/man3/tcadb.3 +676 -0
- data/ext/tokyo/share/man/man3/tcbdb.3 +1355 -0
- data/ext/tokyo/share/man/man3/tcfdb.3 +975 -0
- data/ext/tokyo/share/man/man3/tchdb.3 +898 -0
- data/ext/tokyo/share/man/man3/tclist.3 +1 -0
- data/ext/tokyo/share/man/man3/tcmap.3 +1 -0
- data/ext/tokyo/share/man/man3/tcmdb.3 +1 -0
- data/ext/tokyo/share/man/man3/tcmpool.3 +1 -0
- data/ext/tokyo/share/man/man3/tcrdb.3 +1309 -0
- data/ext/tokyo/share/man/man3/tctdb.3 +1110 -0
- data/ext/tokyo/share/man/man3/tctree.3 +1 -0
- data/ext/tokyo/share/man/man3/tculog.3 +15 -0
- data/ext/tokyo/share/man/man3/tcutil.3 +4518 -0
- data/ext/tokyo/share/man/man3/tcxstr.3 +1 -0
- data/ext/tokyo/share/man/man3/tokyocabinet.3 +132 -0
- data/ext/tokyo/share/man/man3/ttutil.3 +14 -0
- data/ext/tokyo/share/man/man8/ttservctl.8 +37 -0
- data/ext/tokyo/share/tokyocabinet/COPYING +504 -0
- data/ext/tokyo/share/tokyocabinet/ChangeLog +1252 -0
- data/ext/tokyo/share/tokyocabinet/THANKS +12 -0
- data/ext/tokyo/share/tokyocabinet/doc/benchmark.pdf +0 -0
- data/ext/tokyo/share/tokyocabinet/doc/common.css +211 -0
- data/ext/tokyo/share/tokyocabinet/doc/icon16.png +0 -0
- data/ext/tokyo/share/tokyocabinet/doc/index.html +156 -0
- data/ext/tokyo/share/tokyocabinet/doc/index.ja.html +197 -0
- data/ext/tokyo/share/tokyocabinet/doc/logo-ja.png +0 -0
- data/ext/tokyo/share/tokyocabinet/doc/logo.png +0 -0
- data/ext/tokyo/share/tokyocabinet/doc/spex-en.html +7145 -0
- data/ext/tokyo/share/tokyocabinet/doc/spex-ja.html +7476 -0
- data/ext/tokyo/share/tokyocabinet/doc/tokyoproducts.pdf +0 -0
- data/ext/tokyo/share/tokyocabinet/doc/tokyoproducts.ppt +0 -0
- data/ext/tokyo/share/tokyotyrant/COPYING +504 -0
- data/ext/tokyo/share/tokyotyrant/ChangeLog +578 -0
- data/ext/tokyo/share/tokyotyrant/THANKS +15 -0
- data/ext/tokyo/share/tokyotyrant/doc/common.css +211 -0
- data/ext/tokyo/share/tokyotyrant/doc/index.html +79 -0
- data/ext/tokyo/share/tokyotyrant/doc/spex.html +2264 -0
- data/ext/tokyo/share/tokyotyrant/ext/mapreduce.lua +57 -0
- data/ext/tokyo/share/tokyotyrant/ext/queue.lua +55 -0
- data/ext/tokyo/share/tokyotyrant/ext/senatus.lua +532 -0
- data/ext/tokyo/share/tokyotyrant/ext/usherette.lua +438 -0
- data/ext/tokyo_tyrant.c +147 -0
- data/ext/tokyo_tyrant.h +48 -0
- data/ext/tokyo_tyrant_db.c +227 -0
- data/ext/tokyo_tyrant_db.h +8 -0
- data/ext/tokyo_tyrant_module.c +453 -0
- data/ext/tokyo_tyrant_module.h +10 -0
- data/ext/tokyo_tyrant_query.c +226 -0
- data/ext/tokyo_tyrant_query.h +9 -0
- data/ext/tokyo_tyrant_table.c +319 -0
- data/ext/tokyo_tyrant_table.h +8 -0
- data/ext/tokyocabinet-1.4.41/COPYING +504 -0
- data/ext/tokyocabinet-1.4.41/ChangeLog +1252 -0
- data/ext/tokyocabinet-1.4.41/Makefile.in +825 -0
- data/ext/tokyocabinet-1.4.41/README +38 -0
- data/ext/tokyocabinet-1.4.41/THANKS +12 -0
- data/ext/tokyocabinet-1.4.41/bros/Makefile +133 -0
- data/ext/tokyocabinet-1.4.41/bros/bdbtest.c +438 -0
- data/ext/tokyocabinet-1.4.41/bros/cdbtest.c +219 -0
- data/ext/tokyocabinet-1.4.41/bros/cmpsqltctest.c +186 -0
- data/ext/tokyocabinet-1.4.41/bros/gdbmtest.c +216 -0
- data/ext/tokyocabinet-1.4.41/bros/mapreporter +72 -0
- data/ext/tokyocabinet-1.4.41/bros/maptest.cc +677 -0
- data/ext/tokyocabinet-1.4.41/bros/ndbmtest.c +204 -0
- data/ext/tokyocabinet-1.4.41/bros/qdbmtest.c +375 -0
- data/ext/tokyocabinet-1.4.41/bros/reporter +141 -0
- data/ext/tokyocabinet-1.4.41/bros/result.xls +0 -0
- data/ext/tokyocabinet-1.4.41/bros/sdbmtest.c +204 -0
- data/ext/tokyocabinet-1.4.41/bros/sqltest.c +404 -0
- data/ext/tokyocabinet-1.4.41/bros/tctest.c +748 -0
- data/ext/tokyocabinet-1.4.41/bros/tdbtest.c +205 -0
- data/ext/tokyocabinet-1.4.41/configure +7402 -0
- data/ext/tokyocabinet-1.4.41/configure.in +362 -0
- data/ext/tokyocabinet-1.4.41/doc/benchmark.pdf +0 -0
- data/ext/tokyocabinet-1.4.41/doc/common.css +211 -0
- data/ext/tokyocabinet-1.4.41/doc/icon16.png +0 -0
- data/ext/tokyocabinet-1.4.41/doc/index.html +156 -0
- data/ext/tokyocabinet-1.4.41/doc/index.ja.html +197 -0
- data/ext/tokyocabinet-1.4.41/doc/logo-ja.png +0 -0
- data/ext/tokyocabinet-1.4.41/doc/logo.png +0 -0
- data/ext/tokyocabinet-1.4.41/doc/spex-en.html +7145 -0
- data/ext/tokyocabinet-1.4.41/doc/spex-ja.html +7476 -0
- data/ext/tokyocabinet-1.4.41/doc/tokyoproducts.pdf +0 -0
- data/ext/tokyocabinet-1.4.41/doc/tokyoproducts.ppt +0 -0
- data/ext/tokyocabinet-1.4.41/example/Makefile +113 -0
- data/ext/tokyocabinet-1.4.41/example/tcadbex.c +55 -0
- data/ext/tokyocabinet-1.4.41/example/tcbdbex.c +64 -0
- data/ext/tokyocabinet-1.4.41/example/tcfdbex.c +60 -0
- data/ext/tokyocabinet-1.4.41/example/tchdbex.c +60 -0
- data/ext/tokyocabinet-1.4.41/example/tctchat.c +97 -0
- data/ext/tokyocabinet-1.4.41/example/tctchat.tmpl +141 -0
- data/ext/tokyocabinet-1.4.41/example/tctdbex.c +85 -0
- data/ext/tokyocabinet-1.4.41/example/tctsearch.c +95 -0
- data/ext/tokyocabinet-1.4.41/example/tctsearch.tmpl +122 -0
- data/ext/tokyocabinet-1.4.41/example/tcutilex.c +77 -0
- data/ext/tokyocabinet-1.4.41/f.tsv +2 -0
- data/ext/tokyocabinet-1.4.41/lab/calccomp +118 -0
- data/ext/tokyocabinet-1.4.41/lab/datechange +56 -0
- data/ext/tokyocabinet-1.4.41/lab/diffcheck +45 -0
- data/ext/tokyocabinet-1.4.41/lab/htmltotsv +102 -0
- data/ext/tokyocabinet-1.4.41/lab/magic +19 -0
- data/ext/tokyocabinet-1.4.41/lab/printenv.cgi +27 -0
- data/ext/tokyocabinet-1.4.41/lab/stepcount +26 -0
- data/ext/tokyocabinet-1.4.41/lab/stopwatch +61 -0
- data/ext/tokyocabinet-1.4.41/lab/tabcheck +43 -0
- data/ext/tokyocabinet-1.4.41/lab/wgettsv +239 -0
- data/ext/tokyocabinet-1.4.41/lab/widthcheck +57 -0
- data/ext/tokyocabinet-1.4.41/man/htmltoman +104 -0
- data/ext/tokyocabinet-1.4.41/man/tcadb.3 +676 -0
- data/ext/tokyocabinet-1.4.41/man/tcamgr.1 +97 -0
- data/ext/tokyocabinet-1.4.41/man/tcamttest.1 +35 -0
- data/ext/tokyocabinet-1.4.41/man/tcatest.1 +55 -0
- data/ext/tokyocabinet-1.4.41/man/tcbdb.3 +1355 -0
- data/ext/tokyocabinet-1.4.41/man/tcbmgr.1 +125 -0
- data/ext/tokyocabinet-1.4.41/man/tcbmttest.1 +81 -0
- data/ext/tokyocabinet-1.4.41/man/tcbtest.1 +107 -0
- data/ext/tokyocabinet-1.4.41/man/tcfdb.3 +975 -0
- data/ext/tokyocabinet-1.4.41/man/tcfmgr.1 +98 -0
- data/ext/tokyocabinet-1.4.41/man/tcfmttest.1 +62 -0
- data/ext/tokyocabinet-1.4.41/man/tcftest.1 +73 -0
- data/ext/tokyocabinet-1.4.41/man/tchdb.3 +898 -0
- data/ext/tokyocabinet-1.4.41/man/tchmgr.1 +110 -0
- data/ext/tokyocabinet-1.4.41/man/tchmttest.1 +85 -0
- data/ext/tokyocabinet-1.4.41/man/tchtest.1 +95 -0
- data/ext/tokyocabinet-1.4.41/man/tclist.3 +1 -0
- data/ext/tokyocabinet-1.4.41/man/tcmap.3 +1 -0
- data/ext/tokyocabinet-1.4.41/man/tcmdb.3 +1 -0
- data/ext/tokyocabinet-1.4.41/man/tcmpool.3 +1 -0
- data/ext/tokyocabinet-1.4.41/man/tctdb.3 +1110 -0
- data/ext/tokyocabinet-1.4.41/man/tctmgr.1 +140 -0
- data/ext/tokyocabinet-1.4.41/man/tctmttest.1 +92 -0
- data/ext/tokyocabinet-1.4.41/man/tctree.3 +1 -0
- data/ext/tokyocabinet-1.4.41/man/tcttest.1 +105 -0
- data/ext/tokyocabinet-1.4.41/man/tcucodec.1 +162 -0
- data/ext/tokyocabinet-1.4.41/man/tcumttest.1 +41 -0
- data/ext/tokyocabinet-1.4.41/man/tcutest.1 +81 -0
- data/ext/tokyocabinet-1.4.41/man/tcutil.3 +4518 -0
- data/ext/tokyocabinet-1.4.41/man/tcxstr.3 +1 -0
- data/ext/tokyocabinet-1.4.41/man/tokyocabinet.3 +132 -0
- data/ext/tokyocabinet-1.4.41/md5.c +381 -0
- data/ext/tokyocabinet-1.4.41/md5.h +101 -0
- data/ext/tokyocabinet-1.4.41/myconf.c +493 -0
- data/ext/tokyocabinet-1.4.41/myconf.h +549 -0
- data/ext/tokyocabinet-1.4.41/tcadb.c +4339 -0
- data/ext/tokyocabinet-1.4.41/tcadb.h +548 -0
- data/ext/tokyocabinet-1.4.41/tcamgr.c +1019 -0
- data/ext/tokyocabinet-1.4.41/tcamttest.c +542 -0
- data/ext/tokyocabinet-1.4.41/tcatest.c +1845 -0
- data/ext/tokyocabinet-1.4.41/tcawmgr.c +482 -0
- data/ext/tokyocabinet-1.4.41/tcbdb.c +4180 -0
- data/ext/tokyocabinet-1.4.41/tcbdb.h +1101 -0
- data/ext/tokyocabinet-1.4.41/tcbmgr.c +1012 -0
- data/ext/tokyocabinet-1.4.41/tcbmttest.c +1810 -0
- data/ext/tokyocabinet-1.4.41/tcbtest.c +2586 -0
- data/ext/tokyocabinet-1.4.41/tcfdb.c +2746 -0
- data/ext/tokyocabinet-1.4.41/tcfdb.h +858 -0
- data/ext/tokyocabinet-1.4.41/tcfmgr.c +786 -0
- data/ext/tokyocabinet-1.4.41/tcfmttest.c +1220 -0
- data/ext/tokyocabinet-1.4.41/tcftest.c +1695 -0
- data/ext/tokyocabinet-1.4.41/tchdb.c +5153 -0
- data/ext/tokyocabinet-1.4.41/tchdb.h +871 -0
- data/ext/tokyocabinet-1.4.41/tchmgr.c +842 -0
- data/ext/tokyocabinet-1.4.41/tchmttest.c +1757 -0
- data/ext/tokyocabinet-1.4.41/tchtest.c +2129 -0
- data/ext/tokyocabinet-1.4.41/tctdb.c +6199 -0
- data/ext/tokyocabinet-1.4.41/tctdb.h +1086 -0
- data/ext/tokyocabinet-1.4.41/tctmgr.c +1241 -0
- data/ext/tokyocabinet-1.4.41/tctmttest.c +1563 -0
- data/ext/tokyocabinet-1.4.41/tcttest.c +2062 -0
- data/ext/tokyocabinet-1.4.41/tcucodec.c +1357 -0
- data/ext/tokyocabinet-1.4.41/tcumttest.c +578 -0
- data/ext/tokyocabinet-1.4.41/tcutest.c +1875 -0
- data/ext/tokyocabinet-1.4.41/tcutil.c +10528 -0
- data/ext/tokyocabinet-1.4.41/tcutil.h +4184 -0
- data/ext/tokyocabinet-1.4.41/tokyocabinet.idl +336 -0
- data/ext/tokyocabinet-1.4.41/tokyocabinet.pc.in +14 -0
- data/ext/tokyotyrant-1.1.39/COPYING +504 -0
- data/ext/tokyotyrant-1.1.39/ChangeLog +578 -0
- data/ext/tokyotyrant-1.1.39/Makefile.in +365 -0
- data/ext/tokyotyrant-1.1.39/README +38 -0
- data/ext/tokyotyrant-1.1.39/THANKS +15 -0
- data/ext/tokyotyrant-1.1.39/configure +6979 -0
- data/ext/tokyotyrant-1.1.39/configure.in +300 -0
- data/ext/tokyotyrant-1.1.39/doc/common.css +211 -0
- data/ext/tokyotyrant-1.1.39/doc/index.html +79 -0
- data/ext/tokyotyrant-1.1.39/doc/spex.html +2264 -0
- data/ext/tokyotyrant-1.1.39/example/Makefile +68 -0
- data/ext/tokyotyrant-1.1.39/example/httptest.pl +88 -0
- data/ext/tokyotyrant-1.1.39/example/mcftest.pl +39 -0
- data/ext/tokyotyrant-1.1.39/example/mctest.pl +43 -0
- data/ext/tokyotyrant-1.1.39/example/tcrdbex +0 -0
- data/ext/tokyotyrant-1.1.39/example/tcrdbex.c +49 -0
- data/ext/tokyotyrant-1.1.39/example/tcrdbex.o +0 -0
- data/ext/tokyotyrant-1.1.39/example/tcrdbtblex +0 -0
- data/ext/tokyotyrant-1.1.39/example/tcrdbtblex.c +79 -0
- data/ext/tokyotyrant-1.1.39/example/tcrdbtblex.o +0 -0
- data/ext/tokyotyrant-1.1.39/ext/mapreduce.lua +57 -0
- data/ext/tokyotyrant-1.1.39/ext/queue.lua +55 -0
- data/ext/tokyotyrant-1.1.39/ext/senatus.lua +532 -0
- data/ext/tokyotyrant-1.1.39/ext/usherette.lua +438 -0
- data/ext/tokyotyrant-1.1.39/lab/datechange +56 -0
- data/ext/tokyotyrant-1.1.39/lab/diffcheck +45 -0
- data/ext/tokyotyrant-1.1.39/lab/fibonacci.lua +20 -0
- data/ext/tokyotyrant-1.1.39/lab/footprint.lua +67 -0
- data/ext/tokyotyrant-1.1.39/lab/highlow.lua +88 -0
- data/ext/tokyotyrant-1.1.39/lab/killdualmaster +12 -0
- data/ext/tokyotyrant-1.1.39/lab/rundualmaster +38 -0
- data/ext/tokyotyrant-1.1.39/lab/stepcount +26 -0
- data/ext/tokyotyrant-1.1.39/lab/tabcheck +43 -0
- data/ext/tokyotyrant-1.1.39/lab/ushrtregister.pl +55 -0
- data/ext/tokyotyrant-1.1.39/lab/widthcheck +57 -0
- data/ext/tokyotyrant-1.1.39/man/htmltoman +100 -0
- data/ext/tokyotyrant-1.1.39/man/tcrdb.3 +1309 -0
- data/ext/tokyotyrant-1.1.39/man/tcrmgr.1 +164 -0
- data/ext/tokyotyrant-1.1.39/man/tcrmttest.1 +55 -0
- data/ext/tokyotyrant-1.1.39/man/tcrtest.1 +89 -0
- data/ext/tokyotyrant-1.1.39/man/tculog.3 +15 -0
- data/ext/tokyotyrant-1.1.39/man/ttservctl.8 +37 -0
- data/ext/tokyotyrant-1.1.39/man/ttserver.1 +84 -0
- data/ext/tokyotyrant-1.1.39/man/ttulmgr.1 +40 -0
- data/ext/tokyotyrant-1.1.39/man/ttultest.1 +16 -0
- data/ext/tokyotyrant-1.1.39/man/ttutil.3 +14 -0
- data/ext/tokyotyrant-1.1.39/myconf.c +169 -0
- data/ext/tokyotyrant-1.1.39/myconf.h +408 -0
- data/ext/tokyotyrant-1.1.39/scrext.c +2394 -0
- data/ext/tokyotyrant-1.1.39/scrext.h +96 -0
- data/ext/tokyotyrant-1.1.39/tcrdb.c +2637 -0
- data/ext/tokyotyrant-1.1.39/tcrdb.h +801 -0
- data/ext/tokyotyrant-1.1.39/tcrmgr.c +1559 -0
- data/ext/tokyotyrant-1.1.39/tcrmttest.c +915 -0
- data/ext/tokyotyrant-1.1.39/tcrtest.c +1542 -0
- data/ext/tokyotyrant-1.1.39/tculog.c +1211 -0
- data/ext/tokyotyrant-1.1.39/tculog.h +392 -0
- data/ext/tokyotyrant-1.1.39/tokyotyrant.idl +143 -0
- data/ext/tokyotyrant-1.1.39/tokyotyrant.pc.in +14 -0
- data/ext/tokyotyrant-1.1.39/ttservctl +163 -0
- data/ext/tokyotyrant-1.1.39/ttserver.c +3583 -0
- data/ext/tokyotyrant-1.1.39/ttskeldir.c +141 -0
- data/ext/tokyotyrant-1.1.39/ttskelmock.c +64 -0
- data/ext/tokyotyrant-1.1.39/ttskelnull.c +79 -0
- data/ext/tokyotyrant-1.1.39/ttskelproxy.c +74 -0
- data/ext/tokyotyrant-1.1.39/ttulmgr.c +266 -0
- data/ext/tokyotyrant-1.1.39/ttultest.c +371 -0
- data/ext/tokyotyrant-1.1.39/ttutil.c +1510 -0
- data/ext/tokyotyrant-1.1.39/ttutil.h +494 -0
- data/lib/tokyo_tyrant/balancer.rb +189 -0
- data/spec/ext.lua +4 -0
- data/spec/plu_db.rb +538 -0
- data/spec/spec.rb +1 -0
- data/spec/spec_base.rb +17 -0
- data/spec/start_tyrants.sh +36 -0
- data/spec/stop_tyrants.sh +9 -0
- data/spec/tokyo_tyrant_balancer_db_spec.rb +160 -0
- data/spec/tokyo_tyrant_balancer_table_spec.rb +177 -0
- data/spec/tokyo_tyrant_query_spec.rb +159 -0
- data/spec/tokyo_tyrant_spec.rb +254 -0
- data/spec/tokyo_tyrant_table_spec.rb +301 -0
- metadata +402 -0
@@ -0,0 +1,542 @@
|
|
1
|
+
/*************************************************************************************************
|
2
|
+
* The test cases of the abstract database API
|
3
|
+
* Copyright (C) 2006-2009 Mikio Hirabayashi
|
4
|
+
* This file is part of Tokyo Cabinet.
|
5
|
+
* Tokyo Cabinet is free software; you can redistribute it and/or modify it under the terms of
|
6
|
+
* the GNU Lesser General Public License as published by the Free Software Foundation; either
|
7
|
+
* version 2.1 of the License or any later version. Tokyo Cabinet is distributed in the hope
|
8
|
+
* that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
|
9
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
|
10
|
+
* License for more details.
|
11
|
+
* You should have received a copy of the GNU Lesser General Public License along with Tokyo
|
12
|
+
* Cabinet; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
|
13
|
+
* Boston, MA 02111-1307 USA.
|
14
|
+
*************************************************************************************************/
|
15
|
+
|
16
|
+
|
17
|
+
#include <tcutil.h>
|
18
|
+
#include <tcadb.h>
|
19
|
+
#include "myconf.h"
|
20
|
+
|
21
|
+
#define MULDIVNUM 8 // division number of multiple database
|
22
|
+
#define RECBUFSIZ 48 // buffer for records
|
23
|
+
|
24
|
+
typedef struct { // type of structure for write thread
|
25
|
+
TCADB *adb;
|
26
|
+
int rnum;
|
27
|
+
int id;
|
28
|
+
} TARGWRITE;
|
29
|
+
|
30
|
+
typedef struct { // type of structure for read thread
|
31
|
+
TCADB *adb;
|
32
|
+
int rnum;
|
33
|
+
int id;
|
34
|
+
} TARGREAD;
|
35
|
+
|
36
|
+
typedef struct { // type of structure for remove thread
|
37
|
+
TCADB *adb;
|
38
|
+
int rnum;
|
39
|
+
int id;
|
40
|
+
} TARGREMOVE;
|
41
|
+
|
42
|
+
|
43
|
+
/* global variables */
|
44
|
+
const char *g_progname; // program name
|
45
|
+
unsigned int g_randseed; // random seed
|
46
|
+
int g_dbgfd; // debugging output
|
47
|
+
|
48
|
+
|
49
|
+
/* function prototypes */
|
50
|
+
int main(int argc, char **argv);
|
51
|
+
static void usage(void);
|
52
|
+
static void iprintf(const char *format, ...);
|
53
|
+
static void iputchar(int c);
|
54
|
+
static void eprint(TCADB *adb, int line, const char *func);
|
55
|
+
static void sysprint(void);
|
56
|
+
static void setskeltran(ADBSKEL *skel);
|
57
|
+
static int runwrite(int argc, char **argv);
|
58
|
+
static int runread(int argc, char **argv);
|
59
|
+
static int runremove(int argc, char **argv);
|
60
|
+
static int procwrite(const char *name, int tnum, int rnum);
|
61
|
+
static int procread(const char *name, int tnum);
|
62
|
+
static int procremove(const char *name, int tnum);
|
63
|
+
static void *threadwrite(void *targ);
|
64
|
+
static void *threadread(void *targ);
|
65
|
+
static void *threadremove(void *targ);
|
66
|
+
|
67
|
+
|
68
|
+
/* main routine */
|
69
|
+
int main(int argc, char **argv){
|
70
|
+
g_progname = argv[0];
|
71
|
+
const char *ebuf = getenv("TCRNDSEED");
|
72
|
+
g_randseed = ebuf ? tcatoix(ebuf) : tctime() * 1000;
|
73
|
+
srand(g_randseed);
|
74
|
+
ebuf = getenv("TCDBGFD");
|
75
|
+
g_dbgfd = ebuf ? tcatoix(ebuf) : UINT16_MAX;
|
76
|
+
if(argc < 2) usage();
|
77
|
+
int rv = 0;
|
78
|
+
if(!strcmp(argv[1], "write")){
|
79
|
+
rv = runwrite(argc, argv);
|
80
|
+
} else if(!strcmp(argv[1], "read")){
|
81
|
+
rv = runread(argc, argv);
|
82
|
+
} else if(!strcmp(argv[1], "remove")){
|
83
|
+
rv = runremove(argc, argv);
|
84
|
+
} else {
|
85
|
+
usage();
|
86
|
+
}
|
87
|
+
if(rv != 0){
|
88
|
+
printf("FAILED: TCRNDSEED=%u PID=%d", g_randseed, (int)getpid());
|
89
|
+
for(int i = 0; i < argc; i++){
|
90
|
+
printf(" %s", argv[i]);
|
91
|
+
}
|
92
|
+
printf("\n\n");
|
93
|
+
}
|
94
|
+
return rv;
|
95
|
+
}
|
96
|
+
|
97
|
+
|
98
|
+
/* print the usage and exit */
|
99
|
+
static void usage(void){
|
100
|
+
fprintf(stderr, "%s: test cases of the abstract database API of Tokyo Cabinet\n", g_progname);
|
101
|
+
fprintf(stderr, "\n");
|
102
|
+
fprintf(stderr, "usage:\n");
|
103
|
+
fprintf(stderr, " %s write name tnum rnum\n", g_progname);
|
104
|
+
fprintf(stderr, " %s read name tnum\n", g_progname);
|
105
|
+
fprintf(stderr, " %s remove name tnum\n", g_progname);
|
106
|
+
fprintf(stderr, "\n");
|
107
|
+
exit(1);
|
108
|
+
}
|
109
|
+
|
110
|
+
|
111
|
+
/* print formatted information string and flush the buffer */
|
112
|
+
static void iprintf(const char *format, ...){
|
113
|
+
va_list ap;
|
114
|
+
va_start(ap, format);
|
115
|
+
vprintf(format, ap);
|
116
|
+
fflush(stdout);
|
117
|
+
va_end(ap);
|
118
|
+
}
|
119
|
+
|
120
|
+
|
121
|
+
/* print a character and flush the buffer */
|
122
|
+
static void iputchar(int c){
|
123
|
+
putchar(c);
|
124
|
+
fflush(stdout);
|
125
|
+
}
|
126
|
+
|
127
|
+
|
128
|
+
/* print error message of abstract database */
|
129
|
+
static void eprint(TCADB *adb, int line, const char *func){
|
130
|
+
const char *path = adb ? tcadbpath(adb) : NULL;
|
131
|
+
fprintf(stderr, "%s: %s: %d: %s: error\n", g_progname, path ? path : "-", line, func);
|
132
|
+
}
|
133
|
+
|
134
|
+
|
135
|
+
/* print system information */
|
136
|
+
static void sysprint(void){
|
137
|
+
TCMAP *info = tcsysinfo();
|
138
|
+
if(info){
|
139
|
+
tcmapiterinit(info);
|
140
|
+
const char *kbuf;
|
141
|
+
while((kbuf = tcmapiternext2(info)) != NULL){
|
142
|
+
iprintf("sys_%s: %s\n", kbuf, tcmapiterval2(kbuf));
|
143
|
+
}
|
144
|
+
tcmapdel(info);
|
145
|
+
}
|
146
|
+
}
|
147
|
+
|
148
|
+
|
149
|
+
/* set the transparent skeleton database */
|
150
|
+
static void setskeltran(ADBSKEL *skel){
|
151
|
+
memset(skel, 0, sizeof(*skel));
|
152
|
+
skel->opq = tcadbnew();
|
153
|
+
skel->del = (void (*)(void *))tcadbdel;
|
154
|
+
skel->open = (bool (*)(void *, const char *))tcadbopen;
|
155
|
+
skel->close = (bool (*)(void *))tcadbclose;
|
156
|
+
skel->put = (bool (*)(void *, const void *, int, const void *, int))tcadbput;
|
157
|
+
skel->putkeep = (bool (*)(void *, const void *, int, const void *, int))tcadbputkeep;
|
158
|
+
skel->putcat = (bool (*)(void *, const void *, int, const void *, int))tcadbputcat;
|
159
|
+
skel->out = (bool (*)(void *, const void *, int))tcadbout;
|
160
|
+
skel->get = (void *(*)(void *, const void *, int, int *))tcadbget;
|
161
|
+
skel->vsiz = (int (*)(void *, const void *, int))tcadbvsiz;
|
162
|
+
skel->iterinit = (bool (*)(void *))tcadbiterinit;
|
163
|
+
skel->iternext = (void *(*)(void *, int *))tcadbiternext;
|
164
|
+
skel->fwmkeys = (TCLIST *(*)(void *, const void *, int, int))tcadbfwmkeys;
|
165
|
+
skel->addint = (int (*)(void *, const void *, int, int))tcadbaddint;
|
166
|
+
skel->adddouble = (double (*)(void *, const void *, int, double))tcadbadddouble;
|
167
|
+
skel->sync = (bool (*)(void *))tcadbsync;
|
168
|
+
skel->optimize = (bool (*)(void *, const char *))tcadboptimize;
|
169
|
+
skel->vanish = (bool (*)(void *))tcadbvanish;
|
170
|
+
skel->copy = (bool (*)(void *, const char *))tcadbcopy;
|
171
|
+
skel->tranbegin = (bool (*)(void *))tcadbtranbegin;
|
172
|
+
skel->trancommit = (bool (*)(void *))tcadbtrancommit;
|
173
|
+
skel->tranabort = (bool (*)(void *))tcadbtranabort;
|
174
|
+
skel->path = (const char *(*)(void *))tcadbpath;
|
175
|
+
skel->rnum = (uint64_t (*)(void *))tcadbrnum;
|
176
|
+
skel->size = (uint64_t (*)(void *))tcadbsize;
|
177
|
+
skel->misc = (TCLIST *(*)(void *, const char *, const TCLIST *))tcadbmisc;
|
178
|
+
skel->putproc =
|
179
|
+
(bool (*)(void *, const void *, int, const void *, int, TCPDPROC, void *))tcadbputproc;
|
180
|
+
skel->foreach = (bool (*)(void *, TCITER, void *))tcadbforeach;
|
181
|
+
}
|
182
|
+
|
183
|
+
|
184
|
+
/* parse arguments of write command */
|
185
|
+
static int runwrite(int argc, char **argv){
|
186
|
+
char *name = NULL;
|
187
|
+
char *tstr = NULL;
|
188
|
+
char *rstr = NULL;
|
189
|
+
for(int i = 2; i < argc; i++){
|
190
|
+
if(!name && argv[i][0] == '-'){
|
191
|
+
usage();
|
192
|
+
} else if(!name){
|
193
|
+
name = argv[i];
|
194
|
+
} else if(!tstr){
|
195
|
+
tstr = argv[i];
|
196
|
+
} else if(!rstr){
|
197
|
+
rstr = argv[i];
|
198
|
+
} else {
|
199
|
+
usage();
|
200
|
+
}
|
201
|
+
}
|
202
|
+
if(!name || !tstr || !rstr) usage();
|
203
|
+
int tnum = tcatoix(tstr);
|
204
|
+
int rnum = tcatoix(rstr);
|
205
|
+
if(tnum < 1 || rnum < 1) usage();
|
206
|
+
int rv = procwrite(name, tnum, rnum);
|
207
|
+
return rv;
|
208
|
+
}
|
209
|
+
|
210
|
+
|
211
|
+
/* parse arguments of read command */
|
212
|
+
static int runread(int argc, char **argv){
|
213
|
+
char *name = NULL;
|
214
|
+
char *tstr = NULL;
|
215
|
+
for(int i = 2; i < argc; i++){
|
216
|
+
if(!name && argv[i][0] == '-'){
|
217
|
+
usage();
|
218
|
+
} else if(!name){
|
219
|
+
name = argv[i];
|
220
|
+
} else if(!tstr){
|
221
|
+
tstr = argv[i];
|
222
|
+
} else {
|
223
|
+
usage();
|
224
|
+
}
|
225
|
+
}
|
226
|
+
if(!name || !tstr) usage();
|
227
|
+
int tnum = tcatoix(tstr);
|
228
|
+
if(tnum < 1) usage();
|
229
|
+
int rv = procread(name, tnum);
|
230
|
+
return rv;
|
231
|
+
}
|
232
|
+
|
233
|
+
|
234
|
+
/* parse arguments of remove command */
|
235
|
+
static int runremove(int argc, char **argv){
|
236
|
+
char *name = NULL;
|
237
|
+
char *tstr = NULL;
|
238
|
+
for(int i = 2; i < argc; i++){
|
239
|
+
if(!name && argv[i][0] == '-'){
|
240
|
+
usage();
|
241
|
+
} else if(!name){
|
242
|
+
name = argv[i];
|
243
|
+
} else if(!tstr){
|
244
|
+
tstr = argv[i];
|
245
|
+
} else {
|
246
|
+
usage();
|
247
|
+
}
|
248
|
+
}
|
249
|
+
if(!name || !tstr) usage();
|
250
|
+
int tnum = tcatoix(tstr);
|
251
|
+
if(tnum < 1) usage();
|
252
|
+
int rv = procremove(name, tnum);
|
253
|
+
return rv;
|
254
|
+
}
|
255
|
+
|
256
|
+
|
257
|
+
/* perform write command */
|
258
|
+
static int procwrite(const char *name, int tnum, int rnum){
|
259
|
+
iprintf("<Writing Test>\n seed=%u name=%s tnum=%d rnum=%d\n\n",
|
260
|
+
g_randseed, name, tnum, rnum);
|
261
|
+
bool err = false;
|
262
|
+
double stime = tctime();
|
263
|
+
TCADB *adb = tcadbnew();
|
264
|
+
ADBSKEL skel;
|
265
|
+
if(*name == '@'){
|
266
|
+
setskeltran(&skel);
|
267
|
+
if(!tcadbsetskel(adb, &skel)){
|
268
|
+
eprint(adb, __LINE__, "tcadbsetskel");
|
269
|
+
err = true;
|
270
|
+
skel.del(skel.opq);
|
271
|
+
}
|
272
|
+
name++;
|
273
|
+
} else if(*name == '%'){
|
274
|
+
if(!tcadbsetskelmulti(adb, MULDIVNUM)){
|
275
|
+
eprint(adb, __LINE__, "tcadbsetskelmulti");
|
276
|
+
err = true;
|
277
|
+
}
|
278
|
+
name++;
|
279
|
+
}
|
280
|
+
if(!tcadbopen(adb, name)){
|
281
|
+
eprint(adb, __LINE__, "tcadbopen");
|
282
|
+
err = true;
|
283
|
+
}
|
284
|
+
TARGWRITE targs[tnum];
|
285
|
+
pthread_t threads[tnum];
|
286
|
+
if(tnum == 1){
|
287
|
+
targs[0].adb = adb;
|
288
|
+
targs[0].rnum = rnum;
|
289
|
+
targs[0].id = 0;
|
290
|
+
if(threadwrite(targs) != NULL) err = true;
|
291
|
+
} else {
|
292
|
+
for(int i = 0; i < tnum; i++){
|
293
|
+
targs[i].adb = adb;
|
294
|
+
targs[i].rnum = rnum;
|
295
|
+
targs[i].id = i;
|
296
|
+
if(pthread_create(threads + i, NULL, threadwrite, targs + i) != 0){
|
297
|
+
eprint(adb, __LINE__, "pthread_create");
|
298
|
+
targs[i].id = -1;
|
299
|
+
err = true;
|
300
|
+
}
|
301
|
+
}
|
302
|
+
for(int i = 0; i < tnum; i++){
|
303
|
+
if(targs[i].id == -1) continue;
|
304
|
+
void *rv;
|
305
|
+
if(pthread_join(threads[i], &rv) != 0){
|
306
|
+
eprint(adb, __LINE__, "pthread_join");
|
307
|
+
err = true;
|
308
|
+
} else if(rv){
|
309
|
+
err = true;
|
310
|
+
}
|
311
|
+
}
|
312
|
+
}
|
313
|
+
iprintf("record number: %llu\n", (unsigned long long)tcadbrnum(adb));
|
314
|
+
iprintf("size: %llu\n", (unsigned long long)tcadbsize(adb));
|
315
|
+
sysprint();
|
316
|
+
if(!tcadbclose(adb)){
|
317
|
+
eprint(adb, __LINE__, "tcadbclose");
|
318
|
+
err = true;
|
319
|
+
}
|
320
|
+
tcadbdel(adb);
|
321
|
+
iprintf("time: %.3f\n", tctime() - stime);
|
322
|
+
iprintf("%s\n\n", err ? "error" : "ok");
|
323
|
+
return err ? 1 : 0;
|
324
|
+
}
|
325
|
+
|
326
|
+
|
327
|
+
/* perform read command */
|
328
|
+
static int procread(const char *name, int tnum){
|
329
|
+
iprintf("<Reading Test>\n seed=%u name=%s tnum=%d\n\n", g_randseed, name, tnum);
|
330
|
+
bool err = false;
|
331
|
+
double stime = tctime();
|
332
|
+
TCADB *adb = tcadbnew();
|
333
|
+
ADBSKEL skel;
|
334
|
+
if(*name == '@'){
|
335
|
+
setskeltran(&skel);
|
336
|
+
if(!tcadbsetskel(adb, &skel)){
|
337
|
+
eprint(adb, __LINE__, "tcadbsetskel");
|
338
|
+
err = true;
|
339
|
+
skel.del(skel.opq);
|
340
|
+
}
|
341
|
+
name++;
|
342
|
+
} else if(*name == '%'){
|
343
|
+
if(!tcadbsetskelmulti(adb, MULDIVNUM)){
|
344
|
+
eprint(adb, __LINE__, "tcadbsetskelmulti");
|
345
|
+
err = true;
|
346
|
+
}
|
347
|
+
name++;
|
348
|
+
}
|
349
|
+
if(!tcadbopen(adb, name)){
|
350
|
+
eprint(adb, __LINE__, "tcadbopen");
|
351
|
+
err = true;
|
352
|
+
}
|
353
|
+
int rnum = tcadbrnum(adb) / tnum;
|
354
|
+
TARGREAD targs[tnum];
|
355
|
+
pthread_t threads[tnum];
|
356
|
+
if(tnum == 1){
|
357
|
+
targs[0].adb = adb;
|
358
|
+
targs[0].rnum = rnum;
|
359
|
+
targs[0].id = 0;
|
360
|
+
if(threadread(targs) != NULL) err = true;
|
361
|
+
} else {
|
362
|
+
for(int i = 0; i < tnum; i++){
|
363
|
+
targs[i].adb = adb;
|
364
|
+
targs[i].rnum = rnum;
|
365
|
+
targs[i].id = i;
|
366
|
+
if(pthread_create(threads + i, NULL, threadread, targs + i) != 0){
|
367
|
+
eprint(adb, __LINE__, "pthread_create");
|
368
|
+
targs[i].id = -1;
|
369
|
+
err = true;
|
370
|
+
}
|
371
|
+
}
|
372
|
+
for(int i = 0; i < tnum; i++){
|
373
|
+
if(targs[i].id == -1) continue;
|
374
|
+
void *rv;
|
375
|
+
if(pthread_join(threads[i], &rv) != 0){
|
376
|
+
eprint(adb, __LINE__, "pthread_join");
|
377
|
+
err = true;
|
378
|
+
} else if(rv){
|
379
|
+
err = true;
|
380
|
+
}
|
381
|
+
}
|
382
|
+
}
|
383
|
+
iprintf("record number: %llu\n", (unsigned long long)tcadbrnum(adb));
|
384
|
+
iprintf("size: %llu\n", (unsigned long long)tcadbsize(adb));
|
385
|
+
sysprint();
|
386
|
+
if(!tcadbclose(adb)){
|
387
|
+
eprint(adb, __LINE__, "tcadbclose");
|
388
|
+
err = true;
|
389
|
+
}
|
390
|
+
tcadbdel(adb);
|
391
|
+
iprintf("time: %.3f\n", tctime() - stime);
|
392
|
+
iprintf("%s\n\n", err ? "error" : "ok");
|
393
|
+
return err ? 1 : 0;
|
394
|
+
}
|
395
|
+
|
396
|
+
|
397
|
+
/* perform remove command */
|
398
|
+
static int procremove(const char *name, int tnum){
|
399
|
+
iprintf("<Removing Test>\n seed=%u name=%s tnum=%d\n\n", g_randseed, name, tnum);
|
400
|
+
bool err = false;
|
401
|
+
double stime = tctime();
|
402
|
+
TCADB *adb = tcadbnew();
|
403
|
+
ADBSKEL skel;
|
404
|
+
if(*name == '@'){
|
405
|
+
setskeltran(&skel);
|
406
|
+
if(!tcadbsetskel(adb, &skel)){
|
407
|
+
eprint(adb, __LINE__, "tcadbsetskel");
|
408
|
+
err = true;
|
409
|
+
skel.del(skel.opq);
|
410
|
+
}
|
411
|
+
name++;
|
412
|
+
} else if(*name == '%'){
|
413
|
+
if(!tcadbsetskelmulti(adb, MULDIVNUM)){
|
414
|
+
eprint(adb, __LINE__, "tcadbsetskelmulti");
|
415
|
+
err = true;
|
416
|
+
}
|
417
|
+
name++;
|
418
|
+
}
|
419
|
+
if(!tcadbopen(adb, name)){
|
420
|
+
eprint(adb, __LINE__, "tcadbopen");
|
421
|
+
err = true;
|
422
|
+
}
|
423
|
+
int rnum = tcadbrnum(adb) / tnum;
|
424
|
+
TARGREMOVE targs[tnum];
|
425
|
+
pthread_t threads[tnum];
|
426
|
+
if(tnum == 1){
|
427
|
+
targs[0].adb = adb;
|
428
|
+
targs[0].rnum = rnum;
|
429
|
+
targs[0].id = 0;
|
430
|
+
if(threadremove(targs) != NULL) err = true;
|
431
|
+
} else {
|
432
|
+
for(int i = 0; i < tnum; i++){
|
433
|
+
targs[i].adb = adb;
|
434
|
+
targs[i].rnum = rnum;
|
435
|
+
targs[i].id = i;
|
436
|
+
if(pthread_create(threads + i, NULL, threadremove, targs + i) != 0){
|
437
|
+
eprint(adb, __LINE__, "pthread_create");
|
438
|
+
targs[i].id = -1;
|
439
|
+
err = true;
|
440
|
+
}
|
441
|
+
}
|
442
|
+
for(int i = 0; i < tnum; i++){
|
443
|
+
if(targs[i].id == -1) continue;
|
444
|
+
void *rv;
|
445
|
+
if(pthread_join(threads[i], &rv) != 0){
|
446
|
+
eprint(adb, __LINE__, "pthread_join");
|
447
|
+
err = true;
|
448
|
+
} else if(rv){
|
449
|
+
err = true;
|
450
|
+
}
|
451
|
+
}
|
452
|
+
}
|
453
|
+
iprintf("record number: %llu\n", (unsigned long long)tcadbrnum(adb));
|
454
|
+
iprintf("size: %llu\n", (unsigned long long)tcadbsize(adb));
|
455
|
+
sysprint();
|
456
|
+
if(!tcadbclose(adb)){
|
457
|
+
eprint(adb, __LINE__, "tcadbclose");
|
458
|
+
err = true;
|
459
|
+
}
|
460
|
+
tcadbdel(adb);
|
461
|
+
iprintf("time: %.3f\n", tctime() - stime);
|
462
|
+
iprintf("%s\n\n", err ? "error" : "ok");
|
463
|
+
return err ? 1 : 0;
|
464
|
+
}
|
465
|
+
|
466
|
+
|
467
|
+
/* thread the write function */
|
468
|
+
static void *threadwrite(void *targ){
|
469
|
+
TCADB *adb = ((TARGWRITE *)targ)->adb;
|
470
|
+
int rnum = ((TARGWRITE *)targ)->rnum;
|
471
|
+
int id = ((TARGWRITE *)targ)->id;
|
472
|
+
bool err = false;
|
473
|
+
int base = id * rnum;
|
474
|
+
for(int i = 1; i <= rnum; i++){
|
475
|
+
char buf[RECBUFSIZ];
|
476
|
+
int len = sprintf(buf, "%08d", base + i + 1);
|
477
|
+
if(!tcadbput(adb, buf, len, buf, len)){
|
478
|
+
eprint(adb, __LINE__, "tcadbput");
|
479
|
+
err = true;
|
480
|
+
break;
|
481
|
+
}
|
482
|
+
if(id == 0 && rnum > 250 && i % (rnum / 250) == 0){
|
483
|
+
iputchar('.');
|
484
|
+
if(i == rnum || i % (rnum / 10) == 0) iprintf(" (%08d)\n", i);
|
485
|
+
}
|
486
|
+
}
|
487
|
+
return err ? "error" : NULL;
|
488
|
+
}
|
489
|
+
|
490
|
+
|
491
|
+
/* thread the read function */
|
492
|
+
static void *threadread(void *targ){
|
493
|
+
TCADB *adb = ((TARGREAD *)targ)->adb;
|
494
|
+
int rnum = ((TARGREAD *)targ)->rnum;
|
495
|
+
int id = ((TARGREAD *)targ)->id;
|
496
|
+
bool err = false;
|
497
|
+
int base = id * rnum;
|
498
|
+
for(int i = 1; i <= rnum && !err; i++){
|
499
|
+
char kbuf[RECBUFSIZ];
|
500
|
+
int ksiz = sprintf(kbuf, "%08d", base + i + 1);
|
501
|
+
int vsiz;
|
502
|
+
char *vbuf = tcadbget(adb, kbuf, ksiz, &vsiz);
|
503
|
+
if(!vbuf){
|
504
|
+
eprint(adb, __LINE__, "tcadbget");
|
505
|
+
err = true;
|
506
|
+
}
|
507
|
+
tcfree(vbuf);
|
508
|
+
if(id == 0 && rnum > 250 && i % (rnum / 250) == 0){
|
509
|
+
iputchar('.');
|
510
|
+
if(i == rnum || i % (rnum / 10) == 0) iprintf(" (%08d)\n", i);
|
511
|
+
}
|
512
|
+
}
|
513
|
+
return err ? "error" : NULL;
|
514
|
+
}
|
515
|
+
|
516
|
+
|
517
|
+
/* thread the remove function */
|
518
|
+
static void *threadremove(void *targ){
|
519
|
+
TCADB *adb = ((TARGREMOVE *)targ)->adb;
|
520
|
+
int rnum = ((TARGREMOVE *)targ)->rnum;
|
521
|
+
int id = ((TARGREMOVE *)targ)->id;
|
522
|
+
bool err = false;
|
523
|
+
int base = id * rnum;
|
524
|
+
for(int i = 1; i <= rnum; i++){
|
525
|
+
char kbuf[RECBUFSIZ];
|
526
|
+
int ksiz = sprintf(kbuf, "%08d", base + i + 1);
|
527
|
+
if(!tcadbout(adb, kbuf, ksiz)){
|
528
|
+
eprint(adb, __LINE__, "tcadbout");
|
529
|
+
err = true;
|
530
|
+
break;
|
531
|
+
}
|
532
|
+
if(id == 0 && rnum > 250 && i % (rnum / 250) == 0){
|
533
|
+
iputchar('.');
|
534
|
+
if(i == rnum || i % (rnum / 10) == 0) iprintf(" (%08d)\n", i);
|
535
|
+
}
|
536
|
+
}
|
537
|
+
return err ? "error" : NULL;
|
538
|
+
}
|
539
|
+
|
540
|
+
|
541
|
+
|
542
|
+
// END OF FILE
|