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
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -0,0 +1,548 @@
|
|
1
|
+
/*************************************************************************************************
|
2
|
+
* The abstract database API of Tokyo Cabinet
|
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
|
+
#ifndef _TCADB_H /* duplication check */
|
18
|
+
#define _TCADB_H
|
19
|
+
|
20
|
+
#if defined(__cplusplus)
|
21
|
+
#define __TCADB_CLINKAGEBEGIN extern "C" {
|
22
|
+
#define __TCADB_CLINKAGEEND }
|
23
|
+
#else
|
24
|
+
#define __TCADB_CLINKAGEBEGIN
|
25
|
+
#define __TCADB_CLINKAGEEND
|
26
|
+
#endif
|
27
|
+
__TCADB_CLINKAGEBEGIN
|
28
|
+
|
29
|
+
|
30
|
+
#include <tcutil.h>
|
31
|
+
#include <tchdb.h>
|
32
|
+
#include <tcbdb.h>
|
33
|
+
#include <tcfdb.h>
|
34
|
+
#include <tctdb.h>
|
35
|
+
|
36
|
+
|
37
|
+
|
38
|
+
/*************************************************************************************************
|
39
|
+
* API
|
40
|
+
*************************************************************************************************/
|
41
|
+
|
42
|
+
|
43
|
+
typedef struct { /* type of structure for an abstract database */
|
44
|
+
int omode; /* open mode */
|
45
|
+
TCMDB *mdb; /* on-memory hash database object */
|
46
|
+
TCNDB *ndb; /* on-memory tree database object */
|
47
|
+
TCHDB *hdb; /* hash database object */
|
48
|
+
TCBDB *bdb; /* B+ tree database object */
|
49
|
+
TCFDB *fdb; /* fixed-length databae object */
|
50
|
+
TCTDB *tdb; /* table database object */
|
51
|
+
int64_t capnum; /* capacity number of records */
|
52
|
+
int64_t capsiz; /* capacity size of using memory */
|
53
|
+
uint32_t capcnt; /* count for capacity check */
|
54
|
+
BDBCUR *cur; /* cursor of B+ tree */
|
55
|
+
void *skel; /* skeleton database */
|
56
|
+
} TCADB;
|
57
|
+
|
58
|
+
enum { /* enumeration for open modes */
|
59
|
+
ADBOVOID, /* not opened */
|
60
|
+
ADBOMDB, /* on-memory hash database */
|
61
|
+
ADBONDB, /* on-memory tree database */
|
62
|
+
ADBOHDB, /* hash database */
|
63
|
+
ADBOBDB, /* B+ tree database */
|
64
|
+
ADBOFDB, /* fixed-length database */
|
65
|
+
ADBOTDB, /* table database */
|
66
|
+
ADBOSKEL /* skeleton database */
|
67
|
+
};
|
68
|
+
|
69
|
+
|
70
|
+
/* Create an abstract database object.
|
71
|
+
The return value is the new abstract database object. */
|
72
|
+
TCADB *tcadbnew(void);
|
73
|
+
|
74
|
+
|
75
|
+
/* Delete an abstract database object.
|
76
|
+
`adb' specifies the abstract database object. */
|
77
|
+
void tcadbdel(TCADB *adb);
|
78
|
+
|
79
|
+
|
80
|
+
/* Open an abstract database.
|
81
|
+
`adb' specifies the abstract database object.
|
82
|
+
`name' specifies the name of the database. If it is "*", the database will be an on-memory
|
83
|
+
hash database. If it is "+", the database will be an on-memory tree database. If its suffix
|
84
|
+
is ".tch", the database will be a hash database. If its suffix is ".tcb", the database will
|
85
|
+
be a B+ tree database. If its suffix is ".tcf", the database will be a fixed-length database.
|
86
|
+
If its suffix is ".tct", the database will be a table database. Otherwise, this function
|
87
|
+
fails. Tuning parameters can trail the name, separated by "#". Each parameter is composed of
|
88
|
+
the name and the value, separated by "=". On-memory hash database supports "bnum", "capnum",
|
89
|
+
and "capsiz". On-memory tree database supports "capnum" and "capsiz". Hash database supports
|
90
|
+
"mode", "bnum", "apow", "fpow", "opts", "rcnum", "xmsiz", and "dfunit". B+ tree database
|
91
|
+
supports "mode", "lmemb", "nmemb", "bnum", "apow", "fpow", "opts", "lcnum", "ncnum", "xmsiz",
|
92
|
+
and "dfunit". Fixed-length database supports "mode", "width", and "limsiz". Table database
|
93
|
+
supports "mode", "bnum", "apow", "fpow", "opts", "rcnum", "lcnum", "ncnum", "xmsiz", "dfunit",
|
94
|
+
and "idx".
|
95
|
+
If successful, the return value is true, else, it is false.
|
96
|
+
The tuning parameter "capnum" specifies the capacity number of records. "capsiz" specifies
|
97
|
+
the capacity size of using memory. Records spilled the capacity are removed by the storing
|
98
|
+
order. "mode" can contain "w" of writer, "r" of reader, "c" of creating, "t" of truncating,
|
99
|
+
"e" of no locking, and "f" of non-blocking lock. The default mode is relevant to "wc".
|
100
|
+
"opts" can contains "l" of large option, "d" of Deflate option, "b" of BZIP2 option, and "t"
|
101
|
+
of TCBS option. "idx" specifies the column name of an index and its type separated by ":".
|
102
|
+
For example, "casket.tch#bnum=1000000#opts=ld" means that the name of the database file is
|
103
|
+
"casket.tch", and the bucket number is 1000000, and the options are large and Deflate. */
|
104
|
+
bool tcadbopen(TCADB *adb, const char *name);
|
105
|
+
|
106
|
+
|
107
|
+
/* Close an abstract database object.
|
108
|
+
`adb' specifies the abstract database object.
|
109
|
+
If successful, the return value is true, else, it is false.
|
110
|
+
Update of a database is assured to be written when the database is closed. If a writer opens
|
111
|
+
a database but does not close it appropriately, the database will be broken. */
|
112
|
+
bool tcadbclose(TCADB *adb);
|
113
|
+
|
114
|
+
|
115
|
+
/* Store a record into an abstract database object.
|
116
|
+
`adb' specifies the abstract database object.
|
117
|
+
`kbuf' specifies the pointer to the region of the key.
|
118
|
+
`ksiz' specifies the size of the region of the key.
|
119
|
+
`vbuf' specifies the pointer to the region of the value.
|
120
|
+
`vsiz' specifies the size of the region of the value.
|
121
|
+
If successful, the return value is true, else, it is false.
|
122
|
+
If a record with the same key exists in the database, it is overwritten. */
|
123
|
+
bool tcadbput(TCADB *adb, const void *kbuf, int ksiz, const void *vbuf, int vsiz);
|
124
|
+
|
125
|
+
|
126
|
+
/* Store a string record into an abstract object.
|
127
|
+
`adb' specifies the abstract database object.
|
128
|
+
`kstr' specifies the string of the key.
|
129
|
+
`vstr' specifies the string of the value.
|
130
|
+
If successful, the return value is true, else, it is false.
|
131
|
+
If a record with the same key exists in the database, it is overwritten. */
|
132
|
+
bool tcadbput2(TCADB *adb, const char *kstr, const char *vstr);
|
133
|
+
|
134
|
+
|
135
|
+
/* Store a new record into an abstract database object.
|
136
|
+
`adb' specifies the abstract database object.
|
137
|
+
`kbuf' specifies the pointer to the region of the key.
|
138
|
+
`ksiz' specifies the size of the region of the key.
|
139
|
+
`vbuf' specifies the pointer to the region of the value.
|
140
|
+
`vsiz' specifies the size of the region of the value.
|
141
|
+
If successful, the return value is true, else, it is false.
|
142
|
+
If a record with the same key exists in the database, this function has no effect. */
|
143
|
+
bool tcadbputkeep(TCADB *adb, const void *kbuf, int ksiz, const void *vbuf, int vsiz);
|
144
|
+
|
145
|
+
|
146
|
+
/* Store a new string record into an abstract database object.
|
147
|
+
`adb' specifies the abstract database object.
|
148
|
+
`kstr' specifies the string of the key.
|
149
|
+
`vstr' specifies the string of the value.
|
150
|
+
If successful, the return value is true, else, it is false.
|
151
|
+
If a record with the same key exists in the database, this function has no effect. */
|
152
|
+
bool tcadbputkeep2(TCADB *adb, const char *kstr, const char *vstr);
|
153
|
+
|
154
|
+
|
155
|
+
/* Concatenate a value at the end of the existing record in an abstract database object.
|
156
|
+
`adb' specifies the abstract database object.
|
157
|
+
`kbuf' specifies the pointer to the region of the key.
|
158
|
+
`ksiz' specifies the size of the region of the key.
|
159
|
+
`vbuf' specifies the pointer to the region of the value.
|
160
|
+
`vsiz' specifies the size of the region of the value.
|
161
|
+
If successful, the return value is true, else, it is false.
|
162
|
+
If there is no corresponding record, a new record is created. */
|
163
|
+
bool tcadbputcat(TCADB *adb, const void *kbuf, int ksiz, const void *vbuf, int vsiz);
|
164
|
+
|
165
|
+
|
166
|
+
/* Concatenate a string value at the end of the existing record in an abstract database object.
|
167
|
+
`adb' specifies the abstract database object.
|
168
|
+
`kstr' specifies the string of the key.
|
169
|
+
`vstr' specifies the string of the value.
|
170
|
+
If successful, the return value is true, else, it is false.
|
171
|
+
If there is no corresponding record, a new record is created. */
|
172
|
+
bool tcadbputcat2(TCADB *adb, const char *kstr, const char *vstr);
|
173
|
+
|
174
|
+
|
175
|
+
/* Remove a record of an abstract database object.
|
176
|
+
`adb' specifies the abstract database object.
|
177
|
+
`kbuf' specifies the pointer to the region of the key.
|
178
|
+
`ksiz' specifies the size of the region of the key.
|
179
|
+
If successful, the return value is true, else, it is false. */
|
180
|
+
bool tcadbout(TCADB *adb, const void *kbuf, int ksiz);
|
181
|
+
|
182
|
+
|
183
|
+
/* Remove a string record of an abstract database object.
|
184
|
+
`adb' specifies the abstract database object.
|
185
|
+
`kstr' specifies the string of the key.
|
186
|
+
If successful, the return value is true, else, it is false. */
|
187
|
+
bool tcadbout2(TCADB *adb, const char *kstr);
|
188
|
+
|
189
|
+
|
190
|
+
/* Retrieve a record in an abstract database object.
|
191
|
+
`adb' specifies the abstract database object.
|
192
|
+
`kbuf' specifies the pointer to the region of the key.
|
193
|
+
`ksiz' specifies the size of the region of the key.
|
194
|
+
`sp' specifies the pointer to the variable into which the size of the region of the return
|
195
|
+
value is assigned.
|
196
|
+
If successful, the return value is the pointer to the region of the value of the corresponding
|
197
|
+
record. `NULL' is returned if no record corresponds.
|
198
|
+
Because an additional zero code is appended at the end of the region of the return value,
|
199
|
+
the return value can be treated as a character string. Because the region of the return
|
200
|
+
value is allocated with the `malloc' call, it should be released with the `free' call when
|
201
|
+
it is no longer in use. */
|
202
|
+
void *tcadbget(TCADB *adb, const void *kbuf, int ksiz, int *sp);
|
203
|
+
|
204
|
+
|
205
|
+
/* Retrieve a string record in an abstract database object.
|
206
|
+
`adb' specifies the abstract database object.
|
207
|
+
`kstr' specifies the string of the key.
|
208
|
+
If successful, the return value is the string of the value of the corresponding record.
|
209
|
+
`NULL' is returned if no record corresponds.
|
210
|
+
Because the region of the return value is allocated with the `malloc' call, it should be
|
211
|
+
released with the `free' call when it is no longer in use. */
|
212
|
+
char *tcadbget2(TCADB *adb, const char *kstr);
|
213
|
+
|
214
|
+
|
215
|
+
/* Get the size of the value of a record in an abstract database object.
|
216
|
+
`adb' specifies the abstract database object.
|
217
|
+
`kbuf' specifies the pointer to the region of the key.
|
218
|
+
`ksiz' specifies the size of the region of the key.
|
219
|
+
If successful, the return value is the size of the value of the corresponding record, else,
|
220
|
+
it is -1. */
|
221
|
+
int tcadbvsiz(TCADB *adb, const void *kbuf, int ksiz);
|
222
|
+
|
223
|
+
|
224
|
+
/* Get the size of the value of a string record in an abstract database object.
|
225
|
+
`adb' specifies the abstract database object.
|
226
|
+
`kstr' specifies the string of the key.
|
227
|
+
If successful, the return value is the size of the value of the corresponding record, else,
|
228
|
+
it is -1. */
|
229
|
+
int tcadbvsiz2(TCADB *adb, const char *kstr);
|
230
|
+
|
231
|
+
|
232
|
+
/* Initialize the iterator of an abstract database object.
|
233
|
+
`adb' specifies the abstract database object.
|
234
|
+
If successful, the return value is true, else, it is false.
|
235
|
+
The iterator is used in order to access the key of every record stored in a database. */
|
236
|
+
bool tcadbiterinit(TCADB *adb);
|
237
|
+
|
238
|
+
|
239
|
+
/* Get the next key of the iterator of an abstract database object.
|
240
|
+
`adb' specifies the abstract database object.
|
241
|
+
`sp' specifies the pointer to the variable into which the size of the region of the return
|
242
|
+
value is assigned.
|
243
|
+
If successful, the return value is the pointer to the region of the next key, else, it is
|
244
|
+
`NULL'. `NULL' is returned when no record is to be get out of the iterator.
|
245
|
+
Because an additional zero code is appended at the end of the region of the return value, the
|
246
|
+
return value can be treated as a character string. Because the region of the return value is
|
247
|
+
allocated with the `malloc' call, it should be released with the `free' call when it is no
|
248
|
+
longer in use. It is possible to access every record by iteration of calling this function.
|
249
|
+
It is allowed to update or remove records whose keys are fetched while the iteration.
|
250
|
+
However, it is not assured if updating the database is occurred while the iteration. Besides,
|
251
|
+
the order of this traversal access method is arbitrary, so it is not assured that the order of
|
252
|
+
storing matches the one of the traversal access. */
|
253
|
+
void *tcadbiternext(TCADB *adb, int *sp);
|
254
|
+
|
255
|
+
|
256
|
+
/* Get the next key string of the iterator of an abstract database object.
|
257
|
+
`adb' specifies the abstract database object.
|
258
|
+
If successful, the return value is the string of the next key, else, it is `NULL'. `NULL' is
|
259
|
+
returned when no record is to be get out of the iterator.
|
260
|
+
Because the region of the return value is allocated with the `malloc' call, it should be
|
261
|
+
released with the `free' call when it is no longer in use. It is possible to access every
|
262
|
+
record by iteration of calling this function. However, it is not assured if updating the
|
263
|
+
database is occurred while the iteration. Besides, the order of this traversal access method
|
264
|
+
is arbitrary, so it is not assured that the order of storing matches the one of the traversal
|
265
|
+
access. */
|
266
|
+
char *tcadbiternext2(TCADB *adb);
|
267
|
+
|
268
|
+
|
269
|
+
/* Get forward matching keys in an abstract database object.
|
270
|
+
`adb' specifies the abstract database object.
|
271
|
+
`pbuf' specifies the pointer to the region of the prefix.
|
272
|
+
`psiz' specifies the size of the region of the prefix.
|
273
|
+
`max' specifies the maximum number of keys to be fetched. If it is negative, no limit is
|
274
|
+
specified.
|
275
|
+
The return value is a list object of the corresponding keys. This function does never fail.
|
276
|
+
It returns an empty list even if no key corresponds.
|
277
|
+
Because the object of the return value is created with the function `tclistnew', it should be
|
278
|
+
deleted with the function `tclistdel' when it is no longer in use. Note that this function
|
279
|
+
may be very slow because every key in the database is scanned. */
|
280
|
+
TCLIST *tcadbfwmkeys(TCADB *adb, const void *pbuf, int psiz, int max);
|
281
|
+
|
282
|
+
|
283
|
+
/* Get forward matching string keys in an abstract database object.
|
284
|
+
`adb' specifies the abstract database object.
|
285
|
+
`pstr' specifies the string of the prefix.
|
286
|
+
`max' specifies the maximum number of keys to be fetched. If it is negative, no limit is
|
287
|
+
specified.
|
288
|
+
The return value is a list object of the corresponding keys. This function does never fail.
|
289
|
+
It returns an empty list even if no key corresponds.
|
290
|
+
Because the object of the return value is created with the function `tclistnew', it should be
|
291
|
+
deleted with the function `tclistdel' when it is no longer in use. Note that this function
|
292
|
+
may be very slow because every key in the database is scanned. */
|
293
|
+
TCLIST *tcadbfwmkeys2(TCADB *adb, const char *pstr, int max);
|
294
|
+
|
295
|
+
|
296
|
+
/* Add an integer to a record in an abstract database object.
|
297
|
+
`adb' specifies the abstract database object.
|
298
|
+
`kbuf' specifies the pointer to the region of the key.
|
299
|
+
`ksiz' specifies the size of the region of the key.
|
300
|
+
`num' specifies the additional value.
|
301
|
+
If successful, the return value is the summation value, else, it is `INT_MIN'.
|
302
|
+
If the corresponding record exists, the value is treated as an integer and is added to. If no
|
303
|
+
record corresponds, a new record of the additional value is stored. */
|
304
|
+
int tcadbaddint(TCADB *adb, const void *kbuf, int ksiz, int num);
|
305
|
+
|
306
|
+
|
307
|
+
/* Add a real number to a record in an abstract database object.
|
308
|
+
`adb' specifies the abstract database object.
|
309
|
+
`kbuf' specifies the pointer to the region of the key.
|
310
|
+
`ksiz' specifies the size of the region of the key.
|
311
|
+
`num' specifies the additional value.
|
312
|
+
If successful, the return value is the summation value, else, it is Not-a-Number.
|
313
|
+
If the corresponding record exists, the value is treated as a real number and is added to. If
|
314
|
+
no record corresponds, a new record of the additional value is stored. */
|
315
|
+
double tcadbadddouble(TCADB *adb, const void *kbuf, int ksiz, double num);
|
316
|
+
|
317
|
+
|
318
|
+
/* Synchronize updated contents of an abstract database object with the file and the device.
|
319
|
+
`adb' specifies the abstract database object.
|
320
|
+
If successful, the return value is true, else, it is false. */
|
321
|
+
bool tcadbsync(TCADB *adb);
|
322
|
+
|
323
|
+
|
324
|
+
/* Optimize the storage of an abstract database object.
|
325
|
+
`adb' specifies the abstract database object.
|
326
|
+
`params' specifies the string of the tuning parameters, which works as with the tuning
|
327
|
+
of parameters the function `tcadbopen'. If it is `NULL', it is not used.
|
328
|
+
If successful, the return value is true, else, it is false.
|
329
|
+
This function is useful to reduce the size of the database storage with data fragmentation by
|
330
|
+
successive updating. */
|
331
|
+
bool tcadboptimize(TCADB *adb, const char *params);
|
332
|
+
|
333
|
+
|
334
|
+
/* Remove all records of an abstract database object.
|
335
|
+
`adb' specifies the abstract database object.
|
336
|
+
If successful, the return value is true, else, it is false. */
|
337
|
+
bool tcadbvanish(TCADB *adb);
|
338
|
+
|
339
|
+
|
340
|
+
/* Copy the database file of an abstract database object.
|
341
|
+
`adb' specifies the abstract database object.
|
342
|
+
`path' specifies the path of the destination file. If it begins with `@', the trailing
|
343
|
+
substring is executed as a command line.
|
344
|
+
If successful, the return value is true, else, it is false. False is returned if the executed
|
345
|
+
command returns non-zero code.
|
346
|
+
The database file is assured to be kept synchronized and not modified while the copying or
|
347
|
+
executing operation is in progress. So, this function is useful to create a backup file of
|
348
|
+
the database file. */
|
349
|
+
bool tcadbcopy(TCADB *adb, const char *path);
|
350
|
+
|
351
|
+
|
352
|
+
/* Begin the transaction of an abstract database object.
|
353
|
+
`adb' specifies the abstract database object.
|
354
|
+
If successful, the return value is true, else, it is false.
|
355
|
+
The database is locked by the thread while the transaction so that only one transaction can be
|
356
|
+
activated with a database object at the same time. Thus, the serializable isolation level is
|
357
|
+
assumed if every database operation is performed in the transaction. All updated regions are
|
358
|
+
kept track of by write ahead logging while the transaction. If the database is closed during
|
359
|
+
transaction, the transaction is aborted implicitly. */
|
360
|
+
bool tcadbtranbegin(TCADB *adb);
|
361
|
+
|
362
|
+
|
363
|
+
/* Commit the transaction of an abstract database object.
|
364
|
+
`adb' specifies the abstract database object.
|
365
|
+
If successful, the return value is true, else, it is false.
|
366
|
+
Update in the transaction is fixed when it is committed successfully. */
|
367
|
+
bool tcadbtrancommit(TCADB *adb);
|
368
|
+
|
369
|
+
|
370
|
+
/* Abort the transaction of an abstract database object.
|
371
|
+
`adb' specifies the abstract database object.
|
372
|
+
If successful, the return value is true, else, it is false.
|
373
|
+
Update in the transaction is discarded when it is aborted. The state of the database is
|
374
|
+
rollbacked to before transaction. */
|
375
|
+
bool tcadbtranabort(TCADB *adb);
|
376
|
+
|
377
|
+
|
378
|
+
/* Get the file path of an abstract database object.
|
379
|
+
`adb' specifies the abstract database object.
|
380
|
+
The return value is the path of the database file or `NULL' if the object does not connect to
|
381
|
+
any database. "*" stands for on-memory hash database. "+" stands for on-memory tree
|
382
|
+
database. */
|
383
|
+
const char *tcadbpath(TCADB *adb);
|
384
|
+
|
385
|
+
|
386
|
+
/* Get the number of records of an abstract database object.
|
387
|
+
`adb' specifies the abstract database object.
|
388
|
+
The return value is the number of records or 0 if the object does not connect to any database
|
389
|
+
instance. */
|
390
|
+
uint64_t tcadbrnum(TCADB *adb);
|
391
|
+
|
392
|
+
|
393
|
+
/* Get the size of the database of an abstract database object.
|
394
|
+
`adb' specifies the abstract database object.
|
395
|
+
The return value is the size of the database or 0 if the object does not connect to any
|
396
|
+
database instance. */
|
397
|
+
uint64_t tcadbsize(TCADB *adb);
|
398
|
+
|
399
|
+
|
400
|
+
/* Call a versatile function for miscellaneous operations of an abstract database object.
|
401
|
+
`adb' specifies the abstract database object.
|
402
|
+
`name' specifies the name of the function. All databases support "put", "out", "get",
|
403
|
+
"putlist", "outlist", "getlist", and "getpart". "put" is to store a record. It receives a
|
404
|
+
key and a value, and returns an empty list. "out" is to remove a record. It receives a key,
|
405
|
+
and returns an empty list. "get" is to retrieve a record. It receives a key, and returns a
|
406
|
+
list of the values. "putlist" is to store records. It receives keys and values one after the
|
407
|
+
other, and returns an empty list. "outlist" is to remove records. It receives keys, and
|
408
|
+
returns an empty list. "getlist" is to retrieve records. It receives keys, and returns keys
|
409
|
+
and values of corresponding records one after the other. "getpart" is to retrieve the partial
|
410
|
+
value of a record. It receives a key, the offset of the region, and the length of the region.
|
411
|
+
`args' specifies a list object containing arguments.
|
412
|
+
If successful, the return value is a list object of the result. `NULL' is returned on failure.
|
413
|
+
Because the object of the return value is created with the function `tclistnew', it
|
414
|
+
should be deleted with the function `tclistdel' when it is no longer in use. */
|
415
|
+
TCLIST *tcadbmisc(TCADB *adb, const char *name, const TCLIST *args);
|
416
|
+
|
417
|
+
|
418
|
+
|
419
|
+
/*************************************************************************************************
|
420
|
+
* features for experts
|
421
|
+
*************************************************************************************************/
|
422
|
+
|
423
|
+
|
424
|
+
typedef struct { /* type of structure for a extra database skeleton */
|
425
|
+
void *opq; /* opaque pointer */
|
426
|
+
void (*del)(void *); /* destructor */
|
427
|
+
bool (*open)(void *, const char *);
|
428
|
+
bool (*close)(void *);
|
429
|
+
bool (*put)(void *, const void *, int, const void *, int);
|
430
|
+
bool (*putkeep)(void *, const void *, int, const void *, int);
|
431
|
+
bool (*putcat)(void *, const void *, int, const void *, int);
|
432
|
+
bool (*out)(void *, const void *, int);
|
433
|
+
void *(*get)(void *, const void *, int, int *);
|
434
|
+
int (*vsiz)(void *, const void *, int);
|
435
|
+
bool (*iterinit)(void *);
|
436
|
+
void *(*iternext)(void *, int *);
|
437
|
+
TCLIST *(*fwmkeys)(void *, const void *, int, int);
|
438
|
+
int (*addint)(void *, const void *, int, int);
|
439
|
+
double (*adddouble)(void *, const void *, int, double);
|
440
|
+
bool (*sync)(void *);
|
441
|
+
bool (*optimize)(void *, const char *);
|
442
|
+
bool (*vanish)(void *);
|
443
|
+
bool (*copy)(void *, const char *);
|
444
|
+
bool (*tranbegin)(void *);
|
445
|
+
bool (*trancommit)(void *);
|
446
|
+
bool (*tranabort)(void *);
|
447
|
+
const char *(*path)(void *);
|
448
|
+
uint64_t (*rnum)(void *);
|
449
|
+
uint64_t (*size)(void *);
|
450
|
+
TCLIST *(*misc)(void *, const char *, const TCLIST *);
|
451
|
+
bool (*putproc)(void *, const void *, int, const void *, int, TCPDPROC, void *);
|
452
|
+
bool (*foreach)(void *, TCITER, void *);
|
453
|
+
} ADBSKEL;
|
454
|
+
|
455
|
+
/* type of the pointer to a mapping function.
|
456
|
+
`map' specifies the pointer to the destination manager.
|
457
|
+
`kbuf' specifies the pointer to the region of the key.
|
458
|
+
`ksiz' specifies the size of the region of the key.
|
459
|
+
`vbuf' specifies the pointer to the region of the value.
|
460
|
+
`vsiz' specifies the size of the region of the value.
|
461
|
+
`op' specifies the pointer to the optional opaque object.
|
462
|
+
The return value is true to continue iteration or false to stop iteration. */
|
463
|
+
typedef bool (*ADBMAPPROC)(void *map, const char *kbuf, int ksiz, const char *vbuf, int vsiz,
|
464
|
+
void *op);
|
465
|
+
|
466
|
+
|
467
|
+
/* Set an extra database sleleton to an abstract database object.
|
468
|
+
`adb' specifies the abstract database object.
|
469
|
+
`skel' specifies the extra database skeleton.
|
470
|
+
If successful, the return value is true, else, it is false. */
|
471
|
+
bool tcadbsetskel(TCADB *adb, ADBSKEL *skel);
|
472
|
+
|
473
|
+
|
474
|
+
/* Set the multiple database skeleton to an abstract database object.
|
475
|
+
`adb' specifies the abstract database object.
|
476
|
+
`num' specifies the number of inner databases.
|
477
|
+
If successful, the return value is true, else, it is false. */
|
478
|
+
bool tcadbsetskelmulti(TCADB *adb, int num);
|
479
|
+
|
480
|
+
|
481
|
+
/* Get the open mode of an abstract database object.
|
482
|
+
`adb' specifies the abstract database object.
|
483
|
+
The return value is `ADBOVOID' for not opened database, `ADBOMDB' for on-memory hash database,
|
484
|
+
`ADBONDB' for on-memory tree database, `ADBOHDB' for hash database, `ADBOBDB' for B+ tree
|
485
|
+
database, `ADBOFDB' for fixed-length database, `ADBOTDB' for table database. */
|
486
|
+
int tcadbomode(TCADB *adb);
|
487
|
+
|
488
|
+
|
489
|
+
/* Get the concrete database object of an abstract database object.
|
490
|
+
`adb' specifies the abstract database object.
|
491
|
+
The return value is the concrete database object depend on the open mode or 0 if the object
|
492
|
+
does not connect to any database instance. */
|
493
|
+
void *tcadbreveal(TCADB *adb);
|
494
|
+
|
495
|
+
|
496
|
+
/* Store a record into an abstract database object with a duplication handler.
|
497
|
+
`adb' specifies the abstract database object.
|
498
|
+
`kbuf' specifies the pointer to the region of the key.
|
499
|
+
`ksiz' specifies the size of the region of the key.
|
500
|
+
`vbuf' specifies the pointer to the region of the value.
|
501
|
+
`vsiz' specifies the size of the region of the value.
|
502
|
+
`proc' specifies the pointer to the callback function to process duplication.
|
503
|
+
`op' specifies an arbitrary pointer to be given as a parameter of the callback function. If
|
504
|
+
it is not needed, `NULL' can be specified.
|
505
|
+
If successful, the return value is true, else, it is false.
|
506
|
+
This function does not work for the table database. */
|
507
|
+
bool tcadbputproc(TCADB *adb, const void *kbuf, int ksiz, const void *vbuf, int vsiz,
|
508
|
+
TCPDPROC proc, void *op);
|
509
|
+
|
510
|
+
|
511
|
+
/* Process each record atomically of an abstract database object.
|
512
|
+
`adb' specifies the abstract database object.
|
513
|
+
`iter' specifies the pointer to the iterator function called for each record.
|
514
|
+
`op' specifies an arbitrary pointer to be given as a parameter of the iterator function. If
|
515
|
+
it is not needed, `NULL' can be specified.
|
516
|
+
If successful, the return value is true, else, it is false. */
|
517
|
+
bool tcadbforeach(TCADB *adb, TCITER iter, void *op);
|
518
|
+
|
519
|
+
|
520
|
+
/* Map records of an abstract database object into another B+ tree database.
|
521
|
+
`adb' specifies the abstract database object.
|
522
|
+
`keys' specifies a list object of the keys of the target records. If it is `NULL', every
|
523
|
+
record is processed.
|
524
|
+
`bdb' specifies the B+ tree database object into which records emitted by the mapping function
|
525
|
+
are stored.
|
526
|
+
`proc' specifies the pointer to the mapping function called for each record.
|
527
|
+
`op' specifies specifies the pointer to the optional opaque object for the mapping function.
|
528
|
+
`csiz' specifies the size of the cache to sort emitted records. If it is negative, the
|
529
|
+
default size is specified. The default size is 268435456.
|
530
|
+
If successful, the return value is true, else, it is false. */
|
531
|
+
bool tcadbmapbdb(TCADB *adb, TCLIST *keys, TCBDB *bdb, ADBMAPPROC proc, void *op, int64_t csiz);
|
532
|
+
|
533
|
+
|
534
|
+
/* Emit records generated by the mapping function into the result map.
|
535
|
+
`kbuf' specifies the pointer to the region of the key.
|
536
|
+
`ksiz' specifies the size of the region of the key.
|
537
|
+
`vbuf' specifies the pointer to the region of the value.
|
538
|
+
`vsiz' specifies the size of the region of the value.
|
539
|
+
If successful, the return value is true, else, it is false. */
|
540
|
+
bool tcadbmapbdbemit(void *map, const char *kbuf, int ksiz, const char *vbuf, int vsiz);
|
541
|
+
|
542
|
+
|
543
|
+
|
544
|
+
__TCADB_CLINKAGEEND
|
545
|
+
#endif /* duplication check */
|
546
|
+
|
547
|
+
|
548
|
+
/* END OF FILE */
|