heroku-tokyotyrant 0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (340) hide show
  1. data/COPYING +504 -0
  2. data/README.rdoc +231 -0
  3. data/Rakefile +72 -0
  4. data/benchmarks/balancer.rb +101 -0
  5. data/benchmarks/bulk_db.rb +74 -0
  6. data/benchmarks/bulk_table.rb +87 -0
  7. data/benchmarks/db.rb +114 -0
  8. data/benchmarks/table.rb +161 -0
  9. data/ext/extconf.rb +43 -0
  10. data/ext/tokyo/bin/tcamgr +0 -0
  11. data/ext/tokyo/bin/tcamttest +0 -0
  12. data/ext/tokyo/bin/tcatest +0 -0
  13. data/ext/tokyo/bin/tcbmgr +0 -0
  14. data/ext/tokyo/bin/tcbmttest +0 -0
  15. data/ext/tokyo/bin/tcbtest +0 -0
  16. data/ext/tokyo/bin/tcfmgr +0 -0
  17. data/ext/tokyo/bin/tcfmttest +0 -0
  18. data/ext/tokyo/bin/tcftest +0 -0
  19. data/ext/tokyo/bin/tchmgr +0 -0
  20. data/ext/tokyo/bin/tchmttest +0 -0
  21. data/ext/tokyo/bin/tchtest +0 -0
  22. data/ext/tokyo/bin/tcrmgr +0 -0
  23. data/ext/tokyo/bin/tcrmttest +0 -0
  24. data/ext/tokyo/bin/tcrtest +0 -0
  25. data/ext/tokyo/bin/tctmgr +0 -0
  26. data/ext/tokyo/bin/tctmttest +0 -0
  27. data/ext/tokyo/bin/tcttest +0 -0
  28. data/ext/tokyo/bin/tcucodec +0 -0
  29. data/ext/tokyo/bin/tcumttest +0 -0
  30. data/ext/tokyo/bin/tcutest +0 -0
  31. data/ext/tokyo/bin/ttserver +0 -0
  32. data/ext/tokyo/bin/ttulmgr +0 -0
  33. data/ext/tokyo/bin/ttultest +0 -0
  34. data/ext/tokyo/include/tcadb.h +548 -0
  35. data/ext/tokyo/include/tcbdb.h +1101 -0
  36. data/ext/tokyo/include/tcfdb.h +858 -0
  37. data/ext/tokyo/include/tchdb.h +871 -0
  38. data/ext/tokyo/include/tcrdb.h +801 -0
  39. data/ext/tokyo/include/tctdb.h +1086 -0
  40. data/ext/tokyo/include/tculog.h +392 -0
  41. data/ext/tokyo/include/tcutil.h +4184 -0
  42. data/ext/tokyo/include/ttutil.h +494 -0
  43. data/ext/tokyo/lib/libtokyocabinet.9.4.0.dylib +0 -0
  44. data/ext/tokyo/lib/libtokyocabinet.9.dylib +0 -0
  45. data/ext/tokyo/lib/libtokyocabinet.a +0 -0
  46. data/ext/tokyo/lib/libtokyocabinet.dylib +0 -0
  47. data/ext/tokyo/lib/libtokyotyrant.3.22.0.dylib +0 -0
  48. data/ext/tokyo/lib/libtokyotyrant.3.dylib +0 -0
  49. data/ext/tokyo/lib/libtokyotyrant.a +0 -0
  50. data/ext/tokyo/lib/libtokyotyrant.dylib +0 -0
  51. data/ext/tokyo/lib/pkgconfig/tokyocabinet.pc +14 -0
  52. data/ext/tokyo/lib/pkgconfig/tokyotyrant.pc +14 -0
  53. data/ext/tokyo/lib/ttskeldir.bundle +0 -0
  54. data/ext/tokyo/lib/ttskelmock.bundle +0 -0
  55. data/ext/tokyo/lib/ttskelnull.bundle +0 -0
  56. data/ext/tokyo/lib/ttskelproxy.bundle +0 -0
  57. data/ext/tokyo/libexec/tcawmgr.cgi +0 -0
  58. data/ext/tokyo/sbin/ttservctl +163 -0
  59. data/ext/tokyo/share/man/man1/tcamgr.1 +97 -0
  60. data/ext/tokyo/share/man/man1/tcamttest.1 +35 -0
  61. data/ext/tokyo/share/man/man1/tcatest.1 +55 -0
  62. data/ext/tokyo/share/man/man1/tcbmgr.1 +125 -0
  63. data/ext/tokyo/share/man/man1/tcbmttest.1 +81 -0
  64. data/ext/tokyo/share/man/man1/tcbtest.1 +107 -0
  65. data/ext/tokyo/share/man/man1/tcfmgr.1 +98 -0
  66. data/ext/tokyo/share/man/man1/tcfmttest.1 +62 -0
  67. data/ext/tokyo/share/man/man1/tcftest.1 +73 -0
  68. data/ext/tokyo/share/man/man1/tchmgr.1 +110 -0
  69. data/ext/tokyo/share/man/man1/tchmttest.1 +85 -0
  70. data/ext/tokyo/share/man/man1/tchtest.1 +95 -0
  71. data/ext/tokyo/share/man/man1/tcrmgr.1 +164 -0
  72. data/ext/tokyo/share/man/man1/tcrmttest.1 +55 -0
  73. data/ext/tokyo/share/man/man1/tcrtest.1 +89 -0
  74. data/ext/tokyo/share/man/man1/tctmgr.1 +140 -0
  75. data/ext/tokyo/share/man/man1/tctmttest.1 +92 -0
  76. data/ext/tokyo/share/man/man1/tcttest.1 +105 -0
  77. data/ext/tokyo/share/man/man1/tcucodec.1 +162 -0
  78. data/ext/tokyo/share/man/man1/tcumttest.1 +41 -0
  79. data/ext/tokyo/share/man/man1/tcutest.1 +81 -0
  80. data/ext/tokyo/share/man/man1/ttserver.1 +84 -0
  81. data/ext/tokyo/share/man/man1/ttulmgr.1 +40 -0
  82. data/ext/tokyo/share/man/man1/ttultest.1 +16 -0
  83. data/ext/tokyo/share/man/man3/tcadb.3 +676 -0
  84. data/ext/tokyo/share/man/man3/tcbdb.3 +1355 -0
  85. data/ext/tokyo/share/man/man3/tcfdb.3 +975 -0
  86. data/ext/tokyo/share/man/man3/tchdb.3 +898 -0
  87. data/ext/tokyo/share/man/man3/tclist.3 +1 -0
  88. data/ext/tokyo/share/man/man3/tcmap.3 +1 -0
  89. data/ext/tokyo/share/man/man3/tcmdb.3 +1 -0
  90. data/ext/tokyo/share/man/man3/tcmpool.3 +1 -0
  91. data/ext/tokyo/share/man/man3/tcrdb.3 +1309 -0
  92. data/ext/tokyo/share/man/man3/tctdb.3 +1110 -0
  93. data/ext/tokyo/share/man/man3/tctree.3 +1 -0
  94. data/ext/tokyo/share/man/man3/tculog.3 +15 -0
  95. data/ext/tokyo/share/man/man3/tcutil.3 +4518 -0
  96. data/ext/tokyo/share/man/man3/tcxstr.3 +1 -0
  97. data/ext/tokyo/share/man/man3/tokyocabinet.3 +132 -0
  98. data/ext/tokyo/share/man/man3/ttutil.3 +14 -0
  99. data/ext/tokyo/share/man/man8/ttservctl.8 +37 -0
  100. data/ext/tokyo/share/tokyocabinet/COPYING +504 -0
  101. data/ext/tokyo/share/tokyocabinet/ChangeLog +1252 -0
  102. data/ext/tokyo/share/tokyocabinet/THANKS +12 -0
  103. data/ext/tokyo/share/tokyocabinet/doc/benchmark.pdf +0 -0
  104. data/ext/tokyo/share/tokyocabinet/doc/common.css +211 -0
  105. data/ext/tokyo/share/tokyocabinet/doc/icon16.png +0 -0
  106. data/ext/tokyo/share/tokyocabinet/doc/index.html +156 -0
  107. data/ext/tokyo/share/tokyocabinet/doc/index.ja.html +197 -0
  108. data/ext/tokyo/share/tokyocabinet/doc/logo-ja.png +0 -0
  109. data/ext/tokyo/share/tokyocabinet/doc/logo.png +0 -0
  110. data/ext/tokyo/share/tokyocabinet/doc/spex-en.html +7145 -0
  111. data/ext/tokyo/share/tokyocabinet/doc/spex-ja.html +7476 -0
  112. data/ext/tokyo/share/tokyocabinet/doc/tokyoproducts.pdf +0 -0
  113. data/ext/tokyo/share/tokyocabinet/doc/tokyoproducts.ppt +0 -0
  114. data/ext/tokyo/share/tokyotyrant/COPYING +504 -0
  115. data/ext/tokyo/share/tokyotyrant/ChangeLog +578 -0
  116. data/ext/tokyo/share/tokyotyrant/THANKS +15 -0
  117. data/ext/tokyo/share/tokyotyrant/doc/common.css +211 -0
  118. data/ext/tokyo/share/tokyotyrant/doc/index.html +79 -0
  119. data/ext/tokyo/share/tokyotyrant/doc/spex.html +2264 -0
  120. data/ext/tokyo/share/tokyotyrant/ext/mapreduce.lua +57 -0
  121. data/ext/tokyo/share/tokyotyrant/ext/queue.lua +55 -0
  122. data/ext/tokyo/share/tokyotyrant/ext/senatus.lua +532 -0
  123. data/ext/tokyo/share/tokyotyrant/ext/usherette.lua +438 -0
  124. data/ext/tokyo_tyrant.c +147 -0
  125. data/ext/tokyo_tyrant.h +48 -0
  126. data/ext/tokyo_tyrant_db.c +227 -0
  127. data/ext/tokyo_tyrant_db.h +8 -0
  128. data/ext/tokyo_tyrant_module.c +453 -0
  129. data/ext/tokyo_tyrant_module.h +10 -0
  130. data/ext/tokyo_tyrant_query.c +226 -0
  131. data/ext/tokyo_tyrant_query.h +9 -0
  132. data/ext/tokyo_tyrant_table.c +319 -0
  133. data/ext/tokyo_tyrant_table.h +8 -0
  134. data/ext/tokyocabinet-1.4.41/COPYING +504 -0
  135. data/ext/tokyocabinet-1.4.41/ChangeLog +1252 -0
  136. data/ext/tokyocabinet-1.4.41/Makefile.in +825 -0
  137. data/ext/tokyocabinet-1.4.41/README +38 -0
  138. data/ext/tokyocabinet-1.4.41/THANKS +12 -0
  139. data/ext/tokyocabinet-1.4.41/bros/Makefile +133 -0
  140. data/ext/tokyocabinet-1.4.41/bros/bdbtest.c +438 -0
  141. data/ext/tokyocabinet-1.4.41/bros/cdbtest.c +219 -0
  142. data/ext/tokyocabinet-1.4.41/bros/cmpsqltctest.c +186 -0
  143. data/ext/tokyocabinet-1.4.41/bros/gdbmtest.c +216 -0
  144. data/ext/tokyocabinet-1.4.41/bros/mapreporter +72 -0
  145. data/ext/tokyocabinet-1.4.41/bros/maptest.cc +677 -0
  146. data/ext/tokyocabinet-1.4.41/bros/ndbmtest.c +204 -0
  147. data/ext/tokyocabinet-1.4.41/bros/qdbmtest.c +375 -0
  148. data/ext/tokyocabinet-1.4.41/bros/reporter +141 -0
  149. data/ext/tokyocabinet-1.4.41/bros/result.xls +0 -0
  150. data/ext/tokyocabinet-1.4.41/bros/sdbmtest.c +204 -0
  151. data/ext/tokyocabinet-1.4.41/bros/sqltest.c +404 -0
  152. data/ext/tokyocabinet-1.4.41/bros/tctest.c +748 -0
  153. data/ext/tokyocabinet-1.4.41/bros/tdbtest.c +205 -0
  154. data/ext/tokyocabinet-1.4.41/configure +7402 -0
  155. data/ext/tokyocabinet-1.4.41/configure.in +362 -0
  156. data/ext/tokyocabinet-1.4.41/doc/benchmark.pdf +0 -0
  157. data/ext/tokyocabinet-1.4.41/doc/common.css +211 -0
  158. data/ext/tokyocabinet-1.4.41/doc/icon16.png +0 -0
  159. data/ext/tokyocabinet-1.4.41/doc/index.html +156 -0
  160. data/ext/tokyocabinet-1.4.41/doc/index.ja.html +197 -0
  161. data/ext/tokyocabinet-1.4.41/doc/logo-ja.png +0 -0
  162. data/ext/tokyocabinet-1.4.41/doc/logo.png +0 -0
  163. data/ext/tokyocabinet-1.4.41/doc/spex-en.html +7145 -0
  164. data/ext/tokyocabinet-1.4.41/doc/spex-ja.html +7476 -0
  165. data/ext/tokyocabinet-1.4.41/doc/tokyoproducts.pdf +0 -0
  166. data/ext/tokyocabinet-1.4.41/doc/tokyoproducts.ppt +0 -0
  167. data/ext/tokyocabinet-1.4.41/example/Makefile +113 -0
  168. data/ext/tokyocabinet-1.4.41/example/tcadbex.c +55 -0
  169. data/ext/tokyocabinet-1.4.41/example/tcbdbex.c +64 -0
  170. data/ext/tokyocabinet-1.4.41/example/tcfdbex.c +60 -0
  171. data/ext/tokyocabinet-1.4.41/example/tchdbex.c +60 -0
  172. data/ext/tokyocabinet-1.4.41/example/tctchat.c +97 -0
  173. data/ext/tokyocabinet-1.4.41/example/tctchat.tmpl +141 -0
  174. data/ext/tokyocabinet-1.4.41/example/tctdbex.c +85 -0
  175. data/ext/tokyocabinet-1.4.41/example/tctsearch.c +95 -0
  176. data/ext/tokyocabinet-1.4.41/example/tctsearch.tmpl +122 -0
  177. data/ext/tokyocabinet-1.4.41/example/tcutilex.c +77 -0
  178. data/ext/tokyocabinet-1.4.41/f.tsv +2 -0
  179. data/ext/tokyocabinet-1.4.41/lab/calccomp +118 -0
  180. data/ext/tokyocabinet-1.4.41/lab/datechange +56 -0
  181. data/ext/tokyocabinet-1.4.41/lab/diffcheck +45 -0
  182. data/ext/tokyocabinet-1.4.41/lab/htmltotsv +102 -0
  183. data/ext/tokyocabinet-1.4.41/lab/magic +19 -0
  184. data/ext/tokyocabinet-1.4.41/lab/printenv.cgi +27 -0
  185. data/ext/tokyocabinet-1.4.41/lab/stepcount +26 -0
  186. data/ext/tokyocabinet-1.4.41/lab/stopwatch +61 -0
  187. data/ext/tokyocabinet-1.4.41/lab/tabcheck +43 -0
  188. data/ext/tokyocabinet-1.4.41/lab/wgettsv +239 -0
  189. data/ext/tokyocabinet-1.4.41/lab/widthcheck +57 -0
  190. data/ext/tokyocabinet-1.4.41/man/htmltoman +104 -0
  191. data/ext/tokyocabinet-1.4.41/man/tcadb.3 +676 -0
  192. data/ext/tokyocabinet-1.4.41/man/tcamgr.1 +97 -0
  193. data/ext/tokyocabinet-1.4.41/man/tcamttest.1 +35 -0
  194. data/ext/tokyocabinet-1.4.41/man/tcatest.1 +55 -0
  195. data/ext/tokyocabinet-1.4.41/man/tcbdb.3 +1355 -0
  196. data/ext/tokyocabinet-1.4.41/man/tcbmgr.1 +125 -0
  197. data/ext/tokyocabinet-1.4.41/man/tcbmttest.1 +81 -0
  198. data/ext/tokyocabinet-1.4.41/man/tcbtest.1 +107 -0
  199. data/ext/tokyocabinet-1.4.41/man/tcfdb.3 +975 -0
  200. data/ext/tokyocabinet-1.4.41/man/tcfmgr.1 +98 -0
  201. data/ext/tokyocabinet-1.4.41/man/tcfmttest.1 +62 -0
  202. data/ext/tokyocabinet-1.4.41/man/tcftest.1 +73 -0
  203. data/ext/tokyocabinet-1.4.41/man/tchdb.3 +898 -0
  204. data/ext/tokyocabinet-1.4.41/man/tchmgr.1 +110 -0
  205. data/ext/tokyocabinet-1.4.41/man/tchmttest.1 +85 -0
  206. data/ext/tokyocabinet-1.4.41/man/tchtest.1 +95 -0
  207. data/ext/tokyocabinet-1.4.41/man/tclist.3 +1 -0
  208. data/ext/tokyocabinet-1.4.41/man/tcmap.3 +1 -0
  209. data/ext/tokyocabinet-1.4.41/man/tcmdb.3 +1 -0
  210. data/ext/tokyocabinet-1.4.41/man/tcmpool.3 +1 -0
  211. data/ext/tokyocabinet-1.4.41/man/tctdb.3 +1110 -0
  212. data/ext/tokyocabinet-1.4.41/man/tctmgr.1 +140 -0
  213. data/ext/tokyocabinet-1.4.41/man/tctmttest.1 +92 -0
  214. data/ext/tokyocabinet-1.4.41/man/tctree.3 +1 -0
  215. data/ext/tokyocabinet-1.4.41/man/tcttest.1 +105 -0
  216. data/ext/tokyocabinet-1.4.41/man/tcucodec.1 +162 -0
  217. data/ext/tokyocabinet-1.4.41/man/tcumttest.1 +41 -0
  218. data/ext/tokyocabinet-1.4.41/man/tcutest.1 +81 -0
  219. data/ext/tokyocabinet-1.4.41/man/tcutil.3 +4518 -0
  220. data/ext/tokyocabinet-1.4.41/man/tcxstr.3 +1 -0
  221. data/ext/tokyocabinet-1.4.41/man/tokyocabinet.3 +132 -0
  222. data/ext/tokyocabinet-1.4.41/md5.c +381 -0
  223. data/ext/tokyocabinet-1.4.41/md5.h +101 -0
  224. data/ext/tokyocabinet-1.4.41/myconf.c +493 -0
  225. data/ext/tokyocabinet-1.4.41/myconf.h +549 -0
  226. data/ext/tokyocabinet-1.4.41/tcadb.c +4339 -0
  227. data/ext/tokyocabinet-1.4.41/tcadb.h +548 -0
  228. data/ext/tokyocabinet-1.4.41/tcamgr.c +1019 -0
  229. data/ext/tokyocabinet-1.4.41/tcamttest.c +542 -0
  230. data/ext/tokyocabinet-1.4.41/tcatest.c +1845 -0
  231. data/ext/tokyocabinet-1.4.41/tcawmgr.c +482 -0
  232. data/ext/tokyocabinet-1.4.41/tcbdb.c +4180 -0
  233. data/ext/tokyocabinet-1.4.41/tcbdb.h +1101 -0
  234. data/ext/tokyocabinet-1.4.41/tcbmgr.c +1012 -0
  235. data/ext/tokyocabinet-1.4.41/tcbmttest.c +1810 -0
  236. data/ext/tokyocabinet-1.4.41/tcbtest.c +2586 -0
  237. data/ext/tokyocabinet-1.4.41/tcfdb.c +2746 -0
  238. data/ext/tokyocabinet-1.4.41/tcfdb.h +858 -0
  239. data/ext/tokyocabinet-1.4.41/tcfmgr.c +786 -0
  240. data/ext/tokyocabinet-1.4.41/tcfmttest.c +1220 -0
  241. data/ext/tokyocabinet-1.4.41/tcftest.c +1695 -0
  242. data/ext/tokyocabinet-1.4.41/tchdb.c +5153 -0
  243. data/ext/tokyocabinet-1.4.41/tchdb.h +871 -0
  244. data/ext/tokyocabinet-1.4.41/tchmgr.c +842 -0
  245. data/ext/tokyocabinet-1.4.41/tchmttest.c +1757 -0
  246. data/ext/tokyocabinet-1.4.41/tchtest.c +2129 -0
  247. data/ext/tokyocabinet-1.4.41/tctdb.c +6199 -0
  248. data/ext/tokyocabinet-1.4.41/tctdb.h +1086 -0
  249. data/ext/tokyocabinet-1.4.41/tctmgr.c +1241 -0
  250. data/ext/tokyocabinet-1.4.41/tctmttest.c +1563 -0
  251. data/ext/tokyocabinet-1.4.41/tcttest.c +2062 -0
  252. data/ext/tokyocabinet-1.4.41/tcucodec.c +1357 -0
  253. data/ext/tokyocabinet-1.4.41/tcumttest.c +578 -0
  254. data/ext/tokyocabinet-1.4.41/tcutest.c +1875 -0
  255. data/ext/tokyocabinet-1.4.41/tcutil.c +10528 -0
  256. data/ext/tokyocabinet-1.4.41/tcutil.h +4184 -0
  257. data/ext/tokyocabinet-1.4.41/tokyocabinet.idl +336 -0
  258. data/ext/tokyocabinet-1.4.41/tokyocabinet.pc.in +14 -0
  259. data/ext/tokyotyrant-1.1.39/COPYING +504 -0
  260. data/ext/tokyotyrant-1.1.39/ChangeLog +578 -0
  261. data/ext/tokyotyrant-1.1.39/Makefile.in +365 -0
  262. data/ext/tokyotyrant-1.1.39/README +38 -0
  263. data/ext/tokyotyrant-1.1.39/THANKS +15 -0
  264. data/ext/tokyotyrant-1.1.39/configure +6979 -0
  265. data/ext/tokyotyrant-1.1.39/configure.in +300 -0
  266. data/ext/tokyotyrant-1.1.39/doc/common.css +211 -0
  267. data/ext/tokyotyrant-1.1.39/doc/index.html +79 -0
  268. data/ext/tokyotyrant-1.1.39/doc/spex.html +2264 -0
  269. data/ext/tokyotyrant-1.1.39/example/Makefile +68 -0
  270. data/ext/tokyotyrant-1.1.39/example/httptest.pl +88 -0
  271. data/ext/tokyotyrant-1.1.39/example/mcftest.pl +39 -0
  272. data/ext/tokyotyrant-1.1.39/example/mctest.pl +43 -0
  273. data/ext/tokyotyrant-1.1.39/example/tcrdbex +0 -0
  274. data/ext/tokyotyrant-1.1.39/example/tcrdbex.c +49 -0
  275. data/ext/tokyotyrant-1.1.39/example/tcrdbex.o +0 -0
  276. data/ext/tokyotyrant-1.1.39/example/tcrdbtblex +0 -0
  277. data/ext/tokyotyrant-1.1.39/example/tcrdbtblex.c +79 -0
  278. data/ext/tokyotyrant-1.1.39/example/tcrdbtblex.o +0 -0
  279. data/ext/tokyotyrant-1.1.39/ext/mapreduce.lua +57 -0
  280. data/ext/tokyotyrant-1.1.39/ext/queue.lua +55 -0
  281. data/ext/tokyotyrant-1.1.39/ext/senatus.lua +532 -0
  282. data/ext/tokyotyrant-1.1.39/ext/usherette.lua +438 -0
  283. data/ext/tokyotyrant-1.1.39/lab/datechange +56 -0
  284. data/ext/tokyotyrant-1.1.39/lab/diffcheck +45 -0
  285. data/ext/tokyotyrant-1.1.39/lab/fibonacci.lua +20 -0
  286. data/ext/tokyotyrant-1.1.39/lab/footprint.lua +67 -0
  287. data/ext/tokyotyrant-1.1.39/lab/highlow.lua +88 -0
  288. data/ext/tokyotyrant-1.1.39/lab/killdualmaster +12 -0
  289. data/ext/tokyotyrant-1.1.39/lab/rundualmaster +38 -0
  290. data/ext/tokyotyrant-1.1.39/lab/stepcount +26 -0
  291. data/ext/tokyotyrant-1.1.39/lab/tabcheck +43 -0
  292. data/ext/tokyotyrant-1.1.39/lab/ushrtregister.pl +55 -0
  293. data/ext/tokyotyrant-1.1.39/lab/widthcheck +57 -0
  294. data/ext/tokyotyrant-1.1.39/man/htmltoman +100 -0
  295. data/ext/tokyotyrant-1.1.39/man/tcrdb.3 +1309 -0
  296. data/ext/tokyotyrant-1.1.39/man/tcrmgr.1 +164 -0
  297. data/ext/tokyotyrant-1.1.39/man/tcrmttest.1 +55 -0
  298. data/ext/tokyotyrant-1.1.39/man/tcrtest.1 +89 -0
  299. data/ext/tokyotyrant-1.1.39/man/tculog.3 +15 -0
  300. data/ext/tokyotyrant-1.1.39/man/ttservctl.8 +37 -0
  301. data/ext/tokyotyrant-1.1.39/man/ttserver.1 +84 -0
  302. data/ext/tokyotyrant-1.1.39/man/ttulmgr.1 +40 -0
  303. data/ext/tokyotyrant-1.1.39/man/ttultest.1 +16 -0
  304. data/ext/tokyotyrant-1.1.39/man/ttutil.3 +14 -0
  305. data/ext/tokyotyrant-1.1.39/myconf.c +169 -0
  306. data/ext/tokyotyrant-1.1.39/myconf.h +408 -0
  307. data/ext/tokyotyrant-1.1.39/scrext.c +2394 -0
  308. data/ext/tokyotyrant-1.1.39/scrext.h +96 -0
  309. data/ext/tokyotyrant-1.1.39/tcrdb.c +2637 -0
  310. data/ext/tokyotyrant-1.1.39/tcrdb.h +801 -0
  311. data/ext/tokyotyrant-1.1.39/tcrmgr.c +1559 -0
  312. data/ext/tokyotyrant-1.1.39/tcrmttest.c +915 -0
  313. data/ext/tokyotyrant-1.1.39/tcrtest.c +1542 -0
  314. data/ext/tokyotyrant-1.1.39/tculog.c +1211 -0
  315. data/ext/tokyotyrant-1.1.39/tculog.h +392 -0
  316. data/ext/tokyotyrant-1.1.39/tokyotyrant.idl +143 -0
  317. data/ext/tokyotyrant-1.1.39/tokyotyrant.pc.in +14 -0
  318. data/ext/tokyotyrant-1.1.39/ttservctl +163 -0
  319. data/ext/tokyotyrant-1.1.39/ttserver.c +3583 -0
  320. data/ext/tokyotyrant-1.1.39/ttskeldir.c +141 -0
  321. data/ext/tokyotyrant-1.1.39/ttskelmock.c +64 -0
  322. data/ext/tokyotyrant-1.1.39/ttskelnull.c +79 -0
  323. data/ext/tokyotyrant-1.1.39/ttskelproxy.c +74 -0
  324. data/ext/tokyotyrant-1.1.39/ttulmgr.c +266 -0
  325. data/ext/tokyotyrant-1.1.39/ttultest.c +371 -0
  326. data/ext/tokyotyrant-1.1.39/ttutil.c +1510 -0
  327. data/ext/tokyotyrant-1.1.39/ttutil.h +494 -0
  328. data/lib/tokyo_tyrant/balancer.rb +189 -0
  329. data/spec/ext.lua +4 -0
  330. data/spec/plu_db.rb +538 -0
  331. data/spec/spec.rb +1 -0
  332. data/spec/spec_base.rb +17 -0
  333. data/spec/start_tyrants.sh +36 -0
  334. data/spec/stop_tyrants.sh +9 -0
  335. data/spec/tokyo_tyrant_balancer_db_spec.rb +160 -0
  336. data/spec/tokyo_tyrant_balancer_table_spec.rb +177 -0
  337. data/spec/tokyo_tyrant_query_spec.rb +159 -0
  338. data/spec/tokyo_tyrant_spec.rb +254 -0
  339. data/spec/tokyo_tyrant_table_spec.rb +301 -0
  340. metadata +402 -0
@@ -0,0 +1,1542 @@
1
+ /*************************************************************************************************
2
+ * The test cases of the remote database API
3
+ * Copyright (C) 2006-2009 Mikio Hirabayashi
4
+ * This file is part of Tokyo Tyrant.
5
+ * Tokyo Tyrant 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 Tyrant 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
+ * Tyrant; 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 <tcrdb.h>
18
+ #include "myconf.h"
19
+
20
+ #define RECBUFSIZ 32 // buffer for records
21
+
22
+
23
+ /* global variables */
24
+ const char *g_progname; // program name
25
+
26
+
27
+ /* function prototypes */
28
+ int main(int argc, char **argv);
29
+ static void usage(void);
30
+ static void iprintf(const char *format, ...);
31
+ static void iputchar(int c);
32
+ static void eprint(TCRDB *rdb, int line, const char *func);
33
+ static int myrand(int range);
34
+ static bool myopen(TCRDB *rdb, const char *host, int port);
35
+ static int runwrite(int argc, char **argv);
36
+ static int runread(int argc, char **argv);
37
+ static int runremove(int argc, char **argv);
38
+ static int runrcat(int argc, char **argv);
39
+ static int runmisc(int argc, char **argv);
40
+ static int runwicked(int argc, char **argv);
41
+ static int runtable(int argc, char **argv);
42
+ static int procwrite(const char *host, int port, int cnum, int tout,
43
+ int rnum, bool nr, bool rnd);
44
+ static int procread(const char *host, int port, int cnum, int tout, int mul, bool rnd);
45
+ static int procremove(const char *host, int port, int cnum, int tout, bool rnd);
46
+ static int procrcat(const char *host, int port, int cnum, int tout, int rnum,
47
+ int shl, bool dai, bool dad, const char *ext, int xopts);
48
+ static int procmisc(const char *host, int port, int cnum, int tout, int rnum);
49
+ static int procwicked(const char *host, int port, int cnum, int tout, int rnum);
50
+ static int proctable(const char *host, int port, int cnum, int tout, int rnum, int exp);
51
+
52
+
53
+ /* main routine */
54
+ int main(int argc, char **argv){
55
+ g_progname = argv[0];
56
+ srand((unsigned int)(tctime() * 1000) % UINT_MAX);
57
+ signal(SIGPIPE, SIG_IGN);
58
+ if(argc < 2) usage();
59
+ int rv = 0;
60
+ if(!strcmp(argv[1], "write")){
61
+ rv = runwrite(argc, argv);
62
+ } else if(!strcmp(argv[1], "read")){
63
+ rv = runread(argc, argv);
64
+ } else if(!strcmp(argv[1], "remove")){
65
+ rv = runremove(argc, argv);
66
+ } else if(!strcmp(argv[1], "rcat")){
67
+ rv = runrcat(argc, argv);
68
+ } else if(!strcmp(argv[1], "misc")){
69
+ rv = runmisc(argc, argv);
70
+ } else if(!strcmp(argv[1], "wicked")){
71
+ rv = runwicked(argc, argv);
72
+ } else if(!strcmp(argv[1], "table")){
73
+ rv = runtable(argc, argv);
74
+ } else {
75
+ usage();
76
+ }
77
+ return rv;
78
+ }
79
+
80
+
81
+ /* print the usage and exit */
82
+ static void usage(void){
83
+ fprintf(stderr, "%s: test cases of the remote database API of Tokyo Tyrant\n", g_progname);
84
+ fprintf(stderr, "\n");
85
+ fprintf(stderr, "usage:\n");
86
+ fprintf(stderr, " %s write [-port num] [-cnum num] [-tout num] [-nr] [-rnd] host rnum\n",
87
+ g_progname);
88
+ fprintf(stderr, " %s read [-port num] [-cnum num] [-tout num] [-mul num] [-rnd] host\n",
89
+ g_progname);
90
+ fprintf(stderr, " %s remove [-port num] [-cnum num] [-tout num] [-rnd] host\n", g_progname);
91
+ fprintf(stderr, " %s rcat [-port num] [-cnum num] [-tout num] [-shl num] [-dai|-dad]"
92
+ " [-ext name] [-xlr|-xlg] host rnum\n", g_progname);
93
+ fprintf(stderr, " %s misc [-port num] [-cnum num] [-tout num] host rnum\n", g_progname);
94
+ fprintf(stderr, " %s wicked [-port num] [-cnum num] [-tout num] host rnum\n", g_progname);
95
+ fprintf(stderr, " %s table [-port num] [-cnum num] [-tout num] [-exp num] host rnum\n",
96
+ g_progname);
97
+ fprintf(stderr, "\n");
98
+ exit(1);
99
+ }
100
+
101
+
102
+ /* print formatted information string and flush the buffer */
103
+ static void iprintf(const char *format, ...){
104
+ va_list ap;
105
+ va_start(ap, format);
106
+ vprintf(format, ap);
107
+ fflush(stdout);
108
+ va_end(ap);
109
+ }
110
+
111
+
112
+ /* print a character and flush the buffer */
113
+ static void iputchar(int c){
114
+ putchar(c);
115
+ fflush(stdout);
116
+ }
117
+
118
+
119
+ /* print error message of abstract database */
120
+ static void eprint(TCRDB *rdb, int line, const char *func){
121
+ int ecode = tcrdbecode(rdb);
122
+ fprintf(stderr, "%s: %d: %s: error: %d: %s\n",
123
+ g_progname, line, func, ecode, tcrdberrmsg(ecode));
124
+ }
125
+
126
+
127
+ /* get a random number */
128
+ static int myrand(int range){
129
+ if(range < 2) return 0;
130
+ int high = (unsigned int)rand() >> 4;
131
+ int low = range * (rand() / (RAND_MAX + 1.0));
132
+ low &= (unsigned int)INT_MAX >> 4;
133
+ return (high + low) % range;
134
+ }
135
+
136
+
137
+ /* open the remote database */
138
+ static bool myopen(TCRDB *rdb, const char *host, int port){
139
+ bool err = false;
140
+ if(strchr(host, ':') || strchr(host, '#')){
141
+ if(!tcrdbopen2(rdb, host)) err = true;
142
+ } else {
143
+ if(!tcrdbopen(rdb, host, port)) err = true;
144
+ }
145
+ return !err;
146
+ }
147
+
148
+
149
+ /* parse arguments of write command */
150
+ static int runwrite(int argc, char **argv){
151
+ char *host = NULL;
152
+ char *rstr = NULL;
153
+ int port = TTDEFPORT;
154
+ int cnum = 1;
155
+ int tout = 0;
156
+ bool nr = false;
157
+ bool rnd = false;
158
+ for(int i = 2; i < argc; i++){
159
+ if(!host && argv[i][0] == '-'){
160
+ if(!strcmp(argv[i], "-port")){
161
+ if(++i >= argc) usage();
162
+ port = tcatoi(argv[i]);
163
+ } else if(!strcmp(argv[i], "-cnum")){
164
+ if(++i >= argc) usage();
165
+ cnum = tcatoi(argv[i]);
166
+ } else if(!strcmp(argv[i], "-tout")){
167
+ if(++i >= argc) usage();
168
+ tout = tcatoi(argv[i]);
169
+ } else if(!strcmp(argv[i], "-nr")){
170
+ nr = true;
171
+ } else if(!strcmp(argv[i], "-rnd")){
172
+ rnd = true;
173
+ } else {
174
+ usage();
175
+ }
176
+ } else if(!host){
177
+ host = argv[i];
178
+ } else if(!rstr){
179
+ rstr = argv[i];
180
+ } else {
181
+ usage();
182
+ }
183
+ }
184
+ if(!host || !rstr || cnum < 1) usage();
185
+ int rnum = tcatoi(rstr);
186
+ if(rnum < 1) usage();
187
+ int rv = procwrite(host, port, cnum, tout, rnum, nr, rnd);
188
+ return rv;
189
+ }
190
+
191
+
192
+ /* parse arguments of read command */
193
+ static int runread(int argc, char **argv){
194
+ char *host = NULL;
195
+ int port = TTDEFPORT;
196
+ int cnum = 1;
197
+ int tout = 0;
198
+ int mul = 0;
199
+ bool rnd = false;
200
+ for(int i = 2; i < argc; i++){
201
+ if(!host && argv[i][0] == '-'){
202
+ if(!strcmp(argv[i], "-port")){
203
+ if(++i >= argc) usage();
204
+ port = tcatoi(argv[i]);
205
+ } else if(!strcmp(argv[i], "-cnum")){
206
+ if(++i >= argc) usage();
207
+ cnum = tcatoi(argv[i]);
208
+ } else if(!strcmp(argv[i], "-tout")){
209
+ if(++i >= argc) usage();
210
+ tout = tcatoi(argv[i]);
211
+ } else if(!strcmp(argv[i], "-mul")){
212
+ if(++i >= argc) usage();
213
+ mul = tcatoi(argv[i]);
214
+ } else if(!strcmp(argv[i], "-rnd")){
215
+ rnd = true;
216
+ } else {
217
+ usage();
218
+ }
219
+ } else if(!host){
220
+ host = argv[i];
221
+ } else {
222
+ usage();
223
+ }
224
+ }
225
+ if(!host || cnum < 1) usage();
226
+ int rv = procread(host, port, cnum, tout, mul, rnd);
227
+ return rv;
228
+ }
229
+
230
+
231
+ /* parse arguments of remove command */
232
+ static int runremove(int argc, char **argv){
233
+ char *host = NULL;
234
+ int port = TTDEFPORT;
235
+ int cnum = 1;
236
+ int tout = 0;
237
+ bool rnd = false;
238
+ for(int i = 2; i < argc; i++){
239
+ if(!host && argv[i][0] == '-'){
240
+ if(!strcmp(argv[i], "-port")){
241
+ if(++i >= argc) usage();
242
+ port = tcatoi(argv[i]);
243
+ } else if(!strcmp(argv[i], "-cnum")){
244
+ if(++i >= argc) usage();
245
+ cnum = tcatoi(argv[i]);
246
+ } else if(!strcmp(argv[i], "-tout")){
247
+ if(++i >= argc) usage();
248
+ tout = tcatoi(argv[i]);
249
+ } else if(!strcmp(argv[i], "-rnd")){
250
+ rnd = true;
251
+ } else {
252
+ usage();
253
+ }
254
+ } else if(!host){
255
+ host = argv[i];
256
+ } else {
257
+ usage();
258
+ }
259
+ }
260
+ if(!host || cnum < 1) usage();
261
+ int rv = procremove(host, port, cnum, tout, rnd);
262
+ return rv;
263
+ }
264
+
265
+
266
+ /* parse arguments of rcat command */
267
+ static int runrcat(int argc, char **argv){
268
+ char *host = NULL;
269
+ char *rstr = NULL;
270
+ int port = TTDEFPORT;
271
+ int cnum = 1;
272
+ int tout = 0;
273
+ int shl = 0;
274
+ bool dai = false;
275
+ bool dad = false;
276
+ char *ext = NULL;
277
+ int xopts = 0;
278
+ for(int i = 2; i < argc; i++){
279
+ if(!host && argv[i][0] == '-'){
280
+ if(!strcmp(argv[i], "-port")){
281
+ if(++i >= argc) usage();
282
+ port = tcatoi(argv[i]);
283
+ } else if(!strcmp(argv[i], "-cnum")){
284
+ if(++i >= argc) usage();
285
+ cnum = tcatoi(argv[i]);
286
+ } else if(!strcmp(argv[i], "-tout")){
287
+ if(++i >= argc) usage();
288
+ tout = tcatoi(argv[i]);
289
+ } else if(!strcmp(argv[i], "-shl")){
290
+ if(++i >= argc) usage();
291
+ shl = tcatoi(argv[i]);
292
+ } else if(!strcmp(argv[i], "-dai")){
293
+ dai = true;
294
+ } else if(!strcmp(argv[i], "-dad")){
295
+ dad = true;
296
+ } else if(!strcmp(argv[i], "-ext")){
297
+ if(++i >= argc) usage();
298
+ ext = argv[i];
299
+ } else if(!strcmp(argv[i], "-xlr")){
300
+ xopts |= RDBXOLCKREC;
301
+ } else if(!strcmp(argv[i], "-xlg")){
302
+ xopts |= RDBXOLCKGLB;
303
+ } else {
304
+ usage();
305
+ }
306
+ } else if(!host){
307
+ host = argv[i];
308
+ } else if(!rstr){
309
+ rstr = argv[i];
310
+ } else {
311
+ usage();
312
+ }
313
+ }
314
+ if(!host || !rstr || cnum < 1) usage();
315
+ int rnum = tcatoi(rstr);
316
+ if(rnum < 1) usage();
317
+ int rv = procrcat(host, port, cnum, tout, rnum, shl, dai, dad, ext, xopts);
318
+ return rv;
319
+ }
320
+
321
+
322
+ /* parse arguments of misc command */
323
+ static int runmisc(int argc, char **argv){
324
+ char *host = NULL;
325
+ char *rstr = NULL;
326
+ int port = TTDEFPORT;
327
+ int cnum = 1;
328
+ int tout = 0;
329
+ for(int i = 2; i < argc; i++){
330
+ if(!host && argv[i][0] == '-'){
331
+ if(!strcmp(argv[i], "-port")){
332
+ if(++i >= argc) usage();
333
+ port = tcatoi(argv[i]);
334
+ } else if(!strcmp(argv[i], "-cnum")){
335
+ if(++i >= argc) usage();
336
+ cnum = tcatoi(argv[i]);
337
+ } else if(!strcmp(argv[i], "-tout")){
338
+ if(++i >= argc) usage();
339
+ tout = tcatoi(argv[i]);
340
+ } else {
341
+ usage();
342
+ }
343
+ } else if(!host){
344
+ host = argv[i];
345
+ } else if(!rstr){
346
+ rstr = argv[i];
347
+ } else {
348
+ usage();
349
+ }
350
+ }
351
+ if(!host || !rstr || cnum < 1) usage();
352
+ int rnum = tcatoi(rstr);
353
+ if(rnum < 1) usage();
354
+ int rv = procmisc(host, port, cnum, tout, rnum);
355
+ return rv;
356
+ }
357
+
358
+
359
+ /* parse arguments of wicked command */
360
+ static int runwicked(int argc, char **argv){
361
+ char *host = NULL;
362
+ char *rstr = NULL;
363
+ int port = TTDEFPORT;
364
+ int cnum = 1;
365
+ int tout = 0;
366
+ for(int i = 2; i < argc; i++){
367
+ if(!host && argv[i][0] == '-'){
368
+ if(!strcmp(argv[i], "-port")){
369
+ if(++i >= argc) usage();
370
+ port = tcatoi(argv[i]);
371
+ } else if(!strcmp(argv[i], "-cnum")){
372
+ if(++i >= argc) usage();
373
+ cnum = tcatoi(argv[i]);
374
+ } else if(!strcmp(argv[i], "-tout")){
375
+ if(++i >= argc) usage();
376
+ tout = tcatoi(argv[i]);
377
+ } else {
378
+ usage();
379
+ }
380
+ } else if(!host){
381
+ host = argv[i];
382
+ } else if(!rstr){
383
+ rstr = argv[i];
384
+ } else {
385
+ usage();
386
+ }
387
+ }
388
+ if(!host || !rstr || cnum < 1) usage();
389
+ int rnum = tcatoi(rstr);
390
+ if(rnum < 1) usage();
391
+ int rv = procwicked(host, port, cnum, tout, rnum);
392
+ return rv;
393
+ }
394
+
395
+
396
+ /* parse arguments of table command */
397
+ static int runtable(int argc, char **argv){
398
+ char *host = NULL;
399
+ char *rstr = NULL;
400
+ int port = TTDEFPORT;
401
+ int cnum = 1;
402
+ int tout = 0;
403
+ int exp = 0;
404
+ for(int i = 2; i < argc; i++){
405
+ if(!host && argv[i][0] == '-'){
406
+ if(!strcmp(argv[i], "-port")){
407
+ if(++i >= argc) usage();
408
+ port = tcatoi(argv[i]);
409
+ } else if(!strcmp(argv[i], "-cnum")){
410
+ if(++i >= argc) usage();
411
+ cnum = tcatoi(argv[i]);
412
+ } else if(!strcmp(argv[i], "-tout")){
413
+ if(++i >= argc) usage();
414
+ tout = tcatoi(argv[i]);
415
+ } else if(!strcmp(argv[i], "-exp")){
416
+ if(++i >= argc) usage();
417
+ exp = tcatoi(argv[i]);
418
+ } else {
419
+ usage();
420
+ }
421
+ } else if(!host){
422
+ host = argv[i];
423
+ } else if(!rstr){
424
+ rstr = argv[i];
425
+ } else {
426
+ usage();
427
+ }
428
+ }
429
+ if(!host || !rstr || cnum < 1) usage();
430
+ int rnum = tcatoi(rstr);
431
+ if(rnum < 1) usage();
432
+ int rv = proctable(host, port, cnum, tout, rnum, exp);
433
+ return rv;
434
+ }
435
+
436
+
437
+ /* perform write command */
438
+ static int procwrite(const char *host, int port, int cnum, int tout,
439
+ int rnum, bool nr, bool rnd){
440
+ iprintf("<Writing Test>\n host=%s port=%d cnum=%d tout=%d rnum=%d nr=%d rnd=%d\n\n",
441
+ host, port, cnum, tout, rnum, nr, rnd);
442
+ bool err = false;
443
+ double stime = tctime();
444
+ TCRDB *rdbs[cnum];
445
+ for(int i = 0; i < cnum; i++){
446
+ rdbs[i] = tcrdbnew();
447
+ if(tout > 0) tcrdbtune(rdbs[i], tout, RDBTRECON);
448
+ if(!myopen(rdbs[i], host, port)){
449
+ eprint(rdbs[i], __LINE__, "tcrdbopen");
450
+ err = true;
451
+ }
452
+ }
453
+ TCRDB *rdb = rdbs[0];
454
+ if(!rnd && !tcrdbvanish(rdb)){
455
+ eprint(rdb, __LINE__, "tcrdbvanish");
456
+ err = true;
457
+ }
458
+ for(int i = 1; i <= rnum; i++){
459
+ char buf[RECBUFSIZ];
460
+ int len = sprintf(buf, "%08d", rnd ? myrand(rnum) + 1 : i);
461
+ if(nr){
462
+ if(!tcrdbputnr(rdb, buf, len, buf, len)){
463
+ eprint(rdb, __LINE__, "tcrdbputnr");
464
+ err = true;
465
+ break;
466
+ }
467
+ } else {
468
+ if(!tcrdbput(rdb, buf, len, buf, len)){
469
+ eprint(rdb, __LINE__, "tcrdbput");
470
+ err = true;
471
+ break;
472
+ }
473
+ }
474
+ if(rnum > 250 && i % (rnum / 250) == 0){
475
+ iputchar('.');
476
+ if(i == rnum || i % (rnum / 10) == 0) iprintf(" (%08d)\n", i);
477
+ rdb = rdbs[myrand(rnum)%cnum];
478
+ }
479
+ }
480
+ iprintf("record number: %llu\n", (unsigned long long)tcrdbrnum(rdb));
481
+ iprintf("size: %llu\n", (unsigned long long)tcrdbsize(rdb));
482
+ for(int i = 0; i < cnum; i++){
483
+ if(!tcrdbclose(rdbs[i])){
484
+ eprint(rdbs[i], __LINE__, "tcrdbclose");
485
+ err = true;
486
+ }
487
+ tcrdbdel(rdbs[i]);
488
+ }
489
+ iprintf("time: %.3f\n", tctime() - stime);
490
+ iprintf("%s\n\n", err ? "error" : "ok");
491
+ return err ? 1 : 0;
492
+ }
493
+
494
+
495
+ /* perform read command */
496
+ static int procread(const char *host, int port, int cnum, int tout, int mul, bool rnd){
497
+ iprintf("<Reading Test>\n host=%s port=%d cnum=%d tout=%d mul=%d rnd=%d\n\n",
498
+ host, port, cnum, tout, mul, rnd);
499
+ bool err = false;
500
+ double stime = tctime();
501
+ TCRDB *rdbs[cnum];
502
+ for(int i = 0; i < cnum; i++){
503
+ rdbs[i] = tcrdbnew();
504
+ if(tout > 0) tcrdbtune(rdbs[i], tout, RDBTRECON);
505
+ if(!myopen(rdbs[i], host, port)){
506
+ eprint(rdbs[i], __LINE__, "tcrdbopen");
507
+ err = true;
508
+ }
509
+ }
510
+ TCRDB *rdb = rdbs[0];
511
+ TCMAP *recs = (mul > 1) ? tcmapnew() : NULL;
512
+ int rnum = tcrdbrnum(rdb);
513
+ for(int i = 1; i <= rnum; i++){
514
+ char kbuf[RECBUFSIZ];
515
+ int ksiz = sprintf(kbuf, "%08d", rnd ? myrand(rnum) + 1 : i);
516
+ if(mul > 1){
517
+ tcmapput(recs, kbuf, ksiz, kbuf, ksiz);
518
+ if(i % mul == 0){
519
+ if(!tcrdbget3(rdb, recs)){
520
+ eprint(rdb, __LINE__, "tcrdbget3");
521
+ err = true;
522
+ break;
523
+ }
524
+ tcmapclear(recs);
525
+ }
526
+ } else {
527
+ int vsiz;
528
+ char *vbuf = tcrdbget(rdb, kbuf, ksiz, &vsiz);
529
+ if(!vbuf && !rnd){
530
+ eprint(rdb, __LINE__, "tcrdbget");
531
+ err = true;
532
+ break;
533
+ }
534
+ tcfree(vbuf);
535
+ }
536
+ if(rnum > 250 && i % (rnum / 250) == 0){
537
+ iputchar('.');
538
+ if(i == rnum || i % (rnum / 10) == 0) iprintf(" (%08d)\n", i);
539
+ rdb = rdbs[myrand(rnum)%cnum];
540
+ }
541
+ }
542
+ if(recs) tcmapdel(recs);
543
+ iprintf("record number: %llu\n", (unsigned long long)tcrdbrnum(rdb));
544
+ iprintf("size: %llu\n", (unsigned long long)tcrdbsize(rdb));
545
+ for(int i = 0; i < cnum; i++){
546
+ if(!tcrdbclose(rdbs[i])){
547
+ eprint(rdbs[i], __LINE__, "tcrdbclose");
548
+ err = true;
549
+ }
550
+ tcrdbdel(rdbs[i]);
551
+ }
552
+ iprintf("time: %.3f\n", tctime() - stime);
553
+ iprintf("%s\n\n", err ? "error" : "ok");
554
+ return err ? 1 : 0;
555
+ }
556
+
557
+
558
+ /* perform remove command */
559
+ static int procremove(const char *host, int port, int cnum, int tout, bool rnd){
560
+ iprintf("<Removing Test>\n host=%s port=%d cnum=%d tout=%d rnd=%d\n\n",
561
+ host, port, cnum, tout, rnd);
562
+ bool err = false;
563
+ double stime = tctime();
564
+ TCRDB *rdbs[cnum];
565
+ for(int i = 0; i < cnum; i++){
566
+ rdbs[i] = tcrdbnew();
567
+ if(tout > 0) tcrdbtune(rdbs[i], tout, RDBTRECON);
568
+ if(!myopen(rdbs[i], host, port)){
569
+ eprint(rdbs[i], __LINE__, "tcrdbopen");
570
+ err = true;
571
+ }
572
+ }
573
+ TCRDB *rdb = rdbs[0];
574
+ int rnum = tcrdbrnum(rdb);
575
+ for(int i = 1; i <= rnum; i++){
576
+ char kbuf[RECBUFSIZ];
577
+ int ksiz = sprintf(kbuf, "%08d", rnd ? myrand(rnum) + 1 : i);
578
+ if(!tcrdbout(rdb, kbuf, ksiz) && !rnd){
579
+ eprint(rdb, __LINE__, "tcrdbout");
580
+ err = true;
581
+ break;
582
+ }
583
+ if(rnum > 250 && i % (rnum / 250) == 0){
584
+ iputchar('.');
585
+ if(i == rnum || i % (rnum / 10) == 0) iprintf(" (%08d)\n", i);
586
+ rdb = rdbs[myrand(rnum)%cnum];
587
+ }
588
+ }
589
+ iprintf("record number: %llu\n", (unsigned long long)tcrdbrnum(rdb));
590
+ iprintf("size: %llu\n", (unsigned long long)tcrdbsize(rdb));
591
+ for(int i = 0; i < cnum; i++){
592
+ if(!tcrdbclose(rdbs[i])){
593
+ eprint(rdbs[i], __LINE__, "tcrdbclose");
594
+ err = true;
595
+ }
596
+ tcrdbdel(rdbs[i]);
597
+ }
598
+ iprintf("time: %.3f\n", tctime() - stime);
599
+ iprintf("%s\n\n", err ? "error" : "ok");
600
+ return err ? 1 : 0;
601
+ }
602
+
603
+
604
+ /* perform rcat command */
605
+ static int procrcat(const char *host, int port, int cnum, int tout, int rnum,
606
+ int shl, bool dai, bool dad, const char *ext, int xopts){
607
+ iprintf("<Random Concatenating Test>\n host=%s port=%d cnum=%d tout=%d rnum=%d"
608
+ " shl=%d dai=%d dad=%d ext=%s xopts=%d\n\n",
609
+ host, port, cnum, tout, rnum, shl, dai, dad, ext ? ext : "", xopts);
610
+ int pnum = rnum / 5 + 1;
611
+ bool err = false;
612
+ double stime = tctime();
613
+ TCRDB *rdbs[cnum];
614
+ for(int i = 0; i < cnum; i++){
615
+ rdbs[i] = tcrdbnew();
616
+ if(tout > 0) tcrdbtune(rdbs[i], tout, RDBTRECON);
617
+ if(!myopen(rdbs[i], host, port)){
618
+ eprint(rdbs[i], __LINE__, "tcrdbopen");
619
+ err = true;
620
+ }
621
+ }
622
+ TCRDB *rdb = rdbs[0];
623
+ for(int i = 1; i <= rnum; i++){
624
+ char kbuf[RECBUFSIZ];
625
+ int ksiz = sprintf(kbuf, "%d", myrand(pnum) + 1);
626
+ if(shl > 0){
627
+ if(!tcrdbputshl(rdb, kbuf, ksiz, kbuf, ksiz, shl)){
628
+ eprint(rdb, __LINE__, "tcrdbputshl");
629
+ err = true;
630
+ break;
631
+ }
632
+ } else if(dai){
633
+ if(tcrdbaddint(rdb, kbuf, ksiz, 1) == INT_MIN){
634
+ eprint(rdb, __LINE__, "tcrdbaddint");
635
+ err = true;
636
+ break;
637
+ }
638
+ } else if(dad){
639
+ if(isnan(tcrdbadddouble(rdb, kbuf, ksiz, 1.0))){
640
+ eprint(rdb, __LINE__, "tcrdbadddouble");
641
+ err = true;
642
+ break;
643
+ }
644
+ } else if(ext){
645
+ int xsiz;
646
+ char *xbuf = tcrdbext(rdb, ext, xopts, kbuf, ksiz, kbuf, ksiz, &xsiz);
647
+ if(!xbuf && tcrdbecode(rdb) != TTEMISC){
648
+ eprint(rdb, __LINE__, "tcrdbext");
649
+ err = true;
650
+ break;
651
+ }
652
+ tcfree(xbuf);
653
+ } else {
654
+ if(!tcrdbputcat(rdb, kbuf, ksiz, kbuf, ksiz)){
655
+ eprint(rdb, __LINE__, "tcrdbputcat");
656
+ err = true;
657
+ break;
658
+ }
659
+ }
660
+ if(rnum > 250 && i % (rnum / 250) == 0){
661
+ iputchar('.');
662
+ if(i == rnum || i % (rnum / 10) == 0) iprintf(" (%08d)\n", i);
663
+ rdb = rdbs[myrand(rnum)%cnum];
664
+ }
665
+ }
666
+ iprintf("record number: %llu\n", (unsigned long long)tcrdbrnum(rdb));
667
+ iprintf("size: %llu\n", (unsigned long long)tcrdbsize(rdb));
668
+ for(int i = 0; i < cnum; i++){
669
+ if(!tcrdbclose(rdbs[i])){
670
+ eprint(rdbs[i], __LINE__, "tcrdbclose");
671
+ err = true;
672
+ }
673
+ tcrdbdel(rdbs[i]);
674
+ }
675
+ iprintf("time: %.3f\n", tctime() - stime);
676
+ iprintf("%s\n\n", err ? "error" : "ok");
677
+ return err ? 1 : 0;
678
+ }
679
+
680
+
681
+ /* perform misc command */
682
+ static int procmisc(const char *host, int port, int cnum, int tout, int rnum){
683
+ iprintf("<Miscellaneous Test>\n host=%s port=%d cnum=%d tout=%d rnum=%d\n\n",
684
+ host, port, cnum, tout, rnum);
685
+ bool err = false;
686
+ double stime = tctime();
687
+ TCRDB *rdbs[cnum];
688
+ for(int i = 0; i < cnum; i++){
689
+ rdbs[i] = tcrdbnew();
690
+ if(tout > 0) tcrdbtune(rdbs[i], tout, RDBTRECON);
691
+ if(!myopen(rdbs[i], host, port)){
692
+ eprint(rdbs[i], __LINE__, "tcrdbopen");
693
+ err = true;
694
+ }
695
+ }
696
+ TCRDB *rdb = rdbs[0];
697
+ if(!tcrdbvanish(rdb)){
698
+ eprint(rdb, __LINE__, "tcrdbvanish");
699
+ err = true;
700
+ }
701
+ iprintf("writing:\n");
702
+ for(int i = 1; i <= rnum; i++){
703
+ char buf[RECBUFSIZ];
704
+ int len = sprintf(buf, "%08d", i);
705
+ if(myrand(10) > 0){
706
+ if(!tcrdbputkeep(rdb, buf, len, buf, len)){
707
+ eprint(rdb, __LINE__, "tcrdbputkeep");
708
+ err = true;
709
+ break;
710
+ }
711
+ } else {
712
+ if(!tcrdbputnr(rdb, buf, len, buf, len)){
713
+ eprint(rdb, __LINE__, "tcrdbputnr");
714
+ err = true;
715
+ break;
716
+ }
717
+ }
718
+ if(rnum > 250 && i % (rnum / 250) == 0){
719
+ iputchar('.');
720
+ if(i == rnum || i % (rnum / 10) == 0) iprintf(" (%08d)\n", i);
721
+ rdb = rdbs[myrand(rnum)%cnum];
722
+ }
723
+ }
724
+ for(int i = 0; i < cnum; i++){
725
+ if(tcrdbrnum(rdbs[i]) < 1){
726
+ eprint(rdb, __LINE__, "tcrdbrnum");
727
+ err = true;
728
+ break;
729
+ }
730
+ }
731
+ iprintf("reading:\n");
732
+ for(int i = 1; i <= rnum; i++){
733
+ char kbuf[RECBUFSIZ];
734
+ int ksiz = sprintf(kbuf, "%08d", i);
735
+ int vsiz;
736
+ char *vbuf = tcrdbget(rdb, kbuf, ksiz, &vsiz);
737
+ if(!vbuf){
738
+ eprint(rdb, __LINE__, "tcrdbget");
739
+ err = true;
740
+ break;
741
+ } else if(vsiz != ksiz || memcmp(vbuf, kbuf, vsiz)){
742
+ eprint(rdb, __LINE__, "(validation)");
743
+ err = true;
744
+ tcfree(vbuf);
745
+ break;
746
+ }
747
+ tcfree(vbuf);
748
+ if(rnum > 250 && i % (rnum / 250) == 0){
749
+ iputchar('.');
750
+ if(i == rnum || i % (rnum / 10) == 0) iprintf(" (%08d)\n", i);
751
+ rdb = rdbs[myrand(rnum)%cnum];
752
+ }
753
+ }
754
+ if(tcrdbrnum(rdb) != rnum){
755
+ eprint(rdb, __LINE__, "(validation)");
756
+ err = true;
757
+ }
758
+ iprintf("random writing:\n");
759
+ for(int i = 1; i <= rnum; i++){
760
+ char kbuf[RECBUFSIZ];
761
+ int ksiz = sprintf(kbuf, "%d", myrand(rnum) + 1);
762
+ char vbuf[RECBUFSIZ];
763
+ int vsiz = myrand(RECBUFSIZ);
764
+ memset(vbuf, '*', vsiz);
765
+ if(!tcrdbput(rdb, kbuf, ksiz, vbuf, vsiz)){
766
+ eprint(rdb, __LINE__, "tcrdbput");
767
+ err = true;
768
+ break;
769
+ }
770
+ int rsiz;
771
+ char *rbuf = tcrdbget(rdb, kbuf, ksiz, &rsiz);
772
+ if(!rbuf){
773
+ eprint(rdb, __LINE__, "tcrdbget");
774
+ err = true;
775
+ break;
776
+ }
777
+ if(rsiz != vsiz || memcmp(rbuf, vbuf, rsiz)){
778
+ eprint(rdb, __LINE__, "(validation)");
779
+ err = true;
780
+ tcfree(rbuf);
781
+ break;
782
+ }
783
+ if(rnum > 250 && i % (rnum / 250) == 0){
784
+ iputchar('.');
785
+ if(i == rnum || i % (rnum / 10) == 0) iprintf(" (%08d)\n", i);
786
+ rdb = rdbs[myrand(rnum)%cnum];
787
+ }
788
+ tcfree(rbuf);
789
+ }
790
+ iprintf("word writing:\n");
791
+ const char *words[] = {
792
+ "a", "A", "bb", "BB", "ccc", "CCC", "dddd", "DDDD", "eeeee", "EEEEEE",
793
+ "mikio", "hirabayashi", "tokyo", "cabinet", "hyper", "estraier", "19780211", "birth day",
794
+ "one", "first", "two", "second", "three", "third", "four", "fourth", "five", "fifth",
795
+ "_[1]_", "uno", "_[2]_", "dos", "_[3]_", "tres", "_[4]_", "cuatro", "_[5]_", "cinco",
796
+ "[\xe5\xb9\xb3\xe6\x9e\x97\xe5\xb9\xb9\xe9\x9b\x84]", "[\xe9\xa6\xac\xe9\xb9\xbf]", NULL
797
+ };
798
+ for(int i = 0; words[i] != NULL; i += 2){
799
+ const char *kbuf = words[i];
800
+ int ksiz = strlen(kbuf);
801
+ const char *vbuf = words[i+1];
802
+ int vsiz = strlen(vbuf);
803
+ if(!tcrdbputkeep(rdb, kbuf, ksiz, vbuf, vsiz)){
804
+ eprint(rdb, __LINE__, "tcrdbputkeep");
805
+ err = true;
806
+ break;
807
+ }
808
+ if(rnum > 250) putchar('.');
809
+ }
810
+ if(rnum > 250) iprintf(" (%08d)\n", (int)(sizeof(words) / sizeof(*words)));
811
+ iprintf("random erasing:\n");
812
+ for(int i = 1; i <= rnum; i++){
813
+ char kbuf[RECBUFSIZ];
814
+ int ksiz = sprintf(kbuf, "%d", myrand(rnum));
815
+ if(!tcrdbout(rdb, kbuf, ksiz) && tcrdbecode(rdb) != TTENOREC){
816
+ eprint(rdb, __LINE__, "tcrdbout");
817
+ err = true;
818
+ break;
819
+ }
820
+ if(rnum > 250 && i % (rnum / 250) == 0){
821
+ iputchar('.');
822
+ if(i == rnum || i % (rnum / 10) == 0) iprintf(" (%08d)\n", i);
823
+ rdb = rdbs[myrand(rnum)%cnum];
824
+ }
825
+ }
826
+ iprintf("writing:\n");
827
+ for(int i = 1; i <= rnum; i++){
828
+ char kbuf[RECBUFSIZ];
829
+ int ksiz = sprintf(kbuf, "[%d]", i);
830
+ char vbuf[RECBUFSIZ];
831
+ int vsiz = i % RECBUFSIZ;
832
+ memset(vbuf, '*', vsiz);
833
+ if(!tcrdbputkeep(rdb, kbuf, ksiz, vbuf, vsiz)){
834
+ eprint(rdb, __LINE__, "tcrdbputkeep");
835
+ err = true;
836
+ break;
837
+ }
838
+ if(vsiz < 1){
839
+ char tbuf[PATH_MAX];
840
+ for(int j = 0; j < PATH_MAX; j++){
841
+ tbuf[j] = myrand(0x100);
842
+ }
843
+ if(!tcrdbput(rdb, kbuf, ksiz, tbuf, PATH_MAX)){
844
+ eprint(rdb, __LINE__, "tcrdbput");
845
+ err = true;
846
+ break;
847
+ }
848
+ }
849
+ if(rnum > 250 && i % (rnum / 250) == 0){
850
+ iputchar('.');
851
+ if(i == rnum || i % (rnum / 10) == 0) iprintf(" (%08d)\n", i);
852
+ rdb = rdbs[myrand(rnum)%cnum];
853
+ }
854
+ }
855
+ iprintf("erasing:\n");
856
+ for(int i = 1; i <= rnum; i++){
857
+ if(i % 2 == 1){
858
+ char kbuf[RECBUFSIZ];
859
+ int ksiz = sprintf(kbuf, "[%d]", i);
860
+ if(!tcrdbout(rdb, kbuf, ksiz)){
861
+ eprint(rdb, __LINE__, "tcrdbout");
862
+ err = true;
863
+ break;
864
+ }
865
+ tcrdbout(rdb, kbuf, ksiz);
866
+ }
867
+ if(rnum > 250 && i % (rnum / 250) == 0){
868
+ iputchar('.');
869
+ if(i == rnum || i % (rnum / 10) == 0) iprintf(" (%08d)\n", i);
870
+ rdb = rdbs[myrand(rnum)%cnum];
871
+ }
872
+ }
873
+ iprintf("random multi reading:\n");
874
+ for(int i = 1; i <= rnum; i++){
875
+ if(i % 10 == 1){
876
+ TCMAP *recs = tcmapnew();
877
+ int num = myrand(10);
878
+ if(myrand(2) == 0){
879
+ char pbuf[RECBUFSIZ];
880
+ int psiz = sprintf(pbuf, "%d", myrand(100) + 1);
881
+ TCLIST *keys = tcrdbfwmkeys(rdb, pbuf, psiz, num);
882
+ for(int j = 0; j < tclistnum(keys); j++){
883
+ int ksiz;
884
+ const char *kbuf = tclistval(keys, j, &ksiz);
885
+ tcmapput(recs, kbuf, ksiz, kbuf, ksiz);
886
+ }
887
+ tclistdel(keys);
888
+ } else {
889
+ for(int j = 0; j < num; j++){
890
+ char kbuf[RECBUFSIZ];
891
+ int ksiz = sprintf(kbuf, "%d", myrand(rnum) + 1);
892
+ tcmapput(recs, kbuf, ksiz, kbuf, ksiz);
893
+ }
894
+ }
895
+ if(tcrdbget3(rdb, recs)){
896
+ tcmapiterinit(recs);
897
+ const char *kbuf;
898
+ int ksiz;
899
+ while((kbuf = tcmapiternext(recs, &ksiz))){
900
+ int vsiz;
901
+ const char *vbuf = tcmapiterval(kbuf, &vsiz);
902
+ int rsiz;
903
+ char *rbuf = tcrdbget(rdb, kbuf, ksiz, &rsiz);
904
+ if(rbuf){
905
+ if(rsiz != vsiz || memcmp(rbuf, vbuf, rsiz)){
906
+ eprint(rdb, __LINE__, "(validation)");
907
+ err = true;
908
+ }
909
+ tcfree(rbuf);
910
+ } else {
911
+ eprint(rdb, __LINE__, "tcrdbget");
912
+ err = true;
913
+ }
914
+ }
915
+ } else {
916
+ eprint(rdb, __LINE__, "tcrdbget3");
917
+ err = true;
918
+ }
919
+ tcmapdel(recs);
920
+ }
921
+ if(rnum > 250 && i % (rnum / 250) == 0){
922
+ iputchar('.');
923
+ if(i == rnum || i % (rnum / 10) == 0) iprintf(" (%08d)\n", i);
924
+ rdb = rdbs[myrand(rnum)%cnum];
925
+ }
926
+ }
927
+ iprintf("script extension calling:\n");
928
+ for(int i = 1; i <= rnum; i++){
929
+ char kbuf[RECBUFSIZ];
930
+ int ksiz = sprintf(kbuf, "(%d)", i);
931
+ const char *name;
932
+ switch(myrand(7)){
933
+ default: name = "put"; break;
934
+ case 1: name = "putkeep"; break;
935
+ case 2: name = "putcat"; break;
936
+ case 3: name = "out"; break;
937
+ case 4: name = "get"; break;
938
+ case 5: name = "iterinit"; break;
939
+ case 6: name = "iternext"; break;
940
+ }
941
+ int vsiz;
942
+ char *vbuf = tcrdbext(rdb, name, 0, kbuf, ksiz, kbuf, ksiz, &vsiz);
943
+ if(!vbuf && tcrdbecode(rdb) != TTEMISC){
944
+ eprint(rdb, __LINE__, "tcrdbext");
945
+ err = true;
946
+ break;
947
+ }
948
+ tcfree(vbuf);
949
+ if(rnum > 250 && i % (rnum / 250) == 0){
950
+ iputchar('.');
951
+ if(i == rnum || i % (rnum / 10) == 0) iprintf(" (%08d)\n", i);
952
+ rdb = rdbs[myrand(rnum)%cnum];
953
+ }
954
+ }
955
+ iprintf("checking versatile functions:\n");
956
+ TCLIST *args = tclistnew();
957
+ for(int i = 1; i <= rnum; i++){
958
+ if(myrand(10) == 0){
959
+ const char *name;
960
+ switch(myrand(3)){
961
+ default: name = "putlist"; break;
962
+ case 1: name = "outlist"; break;
963
+ case 2: name = "getlist"; break;
964
+ }
965
+ TCLIST *res = tcrdbmisc(rdb, name, 0, args);
966
+ if(res){
967
+ tclistdel(res);
968
+ } else {
969
+ eprint(rdb, __LINE__, "tcrdbmisc");
970
+ err = true;
971
+ break;
972
+ }
973
+ tclistclear(args);
974
+ } else {
975
+ char kbuf[RECBUFSIZ];
976
+ int ksiz = sprintf(kbuf, "(%d)", myrand(rnum));
977
+ tclistpush(args, kbuf, ksiz);
978
+ }
979
+ if(rnum > 250 && i % (rnum / 250) == 0){
980
+ iputchar('.');
981
+ if(i == rnum || i % (rnum / 10) == 0) iprintf(" (%08d)\n", i);
982
+ }
983
+ }
984
+ tclistdel(args);
985
+ char *sbuf = tcrdbstat(rdb);
986
+ if(sbuf){
987
+ tcfree(sbuf);
988
+ } else {
989
+ eprint(rdb, __LINE__, "tcrdbstat");
990
+ err = true;
991
+ }
992
+ if(!tcrdbsync(rdb)){
993
+ eprint(rdb, __LINE__, "tcrdbsync");
994
+ err = true;
995
+ }
996
+ if(!tcrdboptimize(rdb, NULL)){
997
+ eprint(rdb, __LINE__, "tcrdbsync");
998
+ err = true;
999
+ }
1000
+ if(!tcrdbvanish(rdb)){
1001
+ eprint(rdb, __LINE__, "tcrdbvanish");
1002
+ err = true;
1003
+ }
1004
+ iprintf("record number: %llu\n", (unsigned long long)tcrdbrnum(rdb));
1005
+ iprintf("size: %llu\n", (unsigned long long)tcrdbsize(rdb));
1006
+ for(int i = 0; i < cnum; i++){
1007
+ if(!tcrdbclose(rdbs[i])){
1008
+ eprint(rdbs[i], __LINE__, "tcrdbclose");
1009
+ err = true;
1010
+ }
1011
+ tcrdbdel(rdbs[i]);
1012
+ }
1013
+ iprintf("time: %.3f\n", tctime() - stime);
1014
+ iprintf("%s\n\n", err ? "error" : "ok");
1015
+ return err ? 1 : 0;
1016
+ }
1017
+
1018
+
1019
+ /* perform wicked command */
1020
+ static int procwicked(const char *host, int port, int cnum, int tout, int rnum){
1021
+ iprintf("<Wicked Writing Test>\n host=%s port=%d cnum=%d tout=%d rnum=%d\n\n",
1022
+ host, port, cnum, tout, rnum);
1023
+ bool err = false;
1024
+ double stime = tctime();
1025
+ TCRDB *rdbs[cnum];
1026
+ for(int i = 0; i < cnum; i++){
1027
+ rdbs[i] = tcrdbnew();
1028
+ if(tout > 0) tcrdbtune(rdbs[i], tout, RDBTRECON);
1029
+ if(!myopen(rdbs[i], host, port)){
1030
+ eprint(rdbs[i], __LINE__, "tcrdbopen");
1031
+ err = true;
1032
+ }
1033
+ }
1034
+ TCRDB *rdb = rdbs[0];
1035
+ if(!tcrdbvanish(rdb)){
1036
+ eprint(rdb, __LINE__, "tcrdbvanish");
1037
+ err = true;
1038
+ }
1039
+ TCMAP *map = tcmapnew2(rnum / 5);
1040
+ for(int i = 1; i <= rnum && !err; i++){
1041
+ char kbuf[RECBUFSIZ];
1042
+ int ksiz = sprintf(kbuf, "%d", myrand(rnum));
1043
+ char vbuf[RECBUFSIZ];
1044
+ int vsiz = myrand(RECBUFSIZ);
1045
+ memset(vbuf, '*', vsiz);
1046
+ vbuf[vsiz] = '\0';
1047
+ char *rbuf;
1048
+ switch(myrand(16)){
1049
+ case 0:
1050
+ putchar('0');
1051
+ if(!tcrdbput(rdb, kbuf, ksiz, vbuf, vsiz)){
1052
+ eprint(rdb, __LINE__, "tcrdbput");
1053
+ err = true;
1054
+ }
1055
+ tcmapput(map, kbuf, ksiz, vbuf, vsiz);
1056
+ break;
1057
+ case 1:
1058
+ putchar('1');
1059
+ if(!tcrdbput2(rdb, kbuf, vbuf)){
1060
+ eprint(rdb, __LINE__, "tcrdbput2");
1061
+ err = true;
1062
+ }
1063
+ tcmapput2(map, kbuf, vbuf);
1064
+ break;
1065
+ case 2:
1066
+ putchar('2');
1067
+ tcrdbputkeep(rdb, kbuf, ksiz, vbuf, vsiz);
1068
+ tcmapputkeep(map, kbuf, ksiz, vbuf, vsiz);
1069
+ break;
1070
+ case 3:
1071
+ putchar('3');
1072
+ tcrdbputkeep2(rdb, kbuf, vbuf);
1073
+ tcmapputkeep2(map, kbuf, vbuf);
1074
+ break;
1075
+ case 4:
1076
+ putchar('4');
1077
+ if(!tcrdbputcat(rdb, kbuf, ksiz, vbuf, vsiz)){
1078
+ eprint(rdb, __LINE__, "tcrdbputcat");
1079
+ err = true;
1080
+ }
1081
+ tcmapputcat(map, kbuf, ksiz, vbuf, vsiz);
1082
+ break;
1083
+ case 5:
1084
+ putchar('5');
1085
+ if(!tcrdbputcat2(rdb, kbuf, vbuf)){
1086
+ eprint(rdb, __LINE__, "tcrdbputcat2");
1087
+ err = true;
1088
+ }
1089
+ tcmapputcat2(map, kbuf, vbuf);
1090
+ break;
1091
+ case 6:
1092
+ putchar('6');
1093
+ if(myrand(10) == 0){
1094
+ if(!tcrdbputnr(rdb, kbuf, ksiz, vbuf, vsiz)){
1095
+ eprint(rdb, __LINE__, "tcrdbputcat");
1096
+ err = true;
1097
+ }
1098
+ if(tcrdbrnum(rdb) < 1){
1099
+ eprint(rdb, __LINE__, "tcrdbrnum");
1100
+ err = true;
1101
+ }
1102
+ tcmapput(map, kbuf, ksiz, vbuf, vsiz);
1103
+ }
1104
+ break;
1105
+ case 7:
1106
+ putchar('7');
1107
+ if(myrand(10) == 0){
1108
+ if(!tcrdbputnr2(rdb, kbuf, vbuf)){
1109
+ eprint(rdb, __LINE__, "tcrdbputcat2");
1110
+ err = true;
1111
+ }
1112
+ if(tcrdbrnum(rdb) < 1){
1113
+ eprint(rdb, __LINE__, "tcrdbrnum");
1114
+ err = true;
1115
+ }
1116
+ tcmapput2(map, kbuf, vbuf);
1117
+ }
1118
+ break;
1119
+ case 8:
1120
+ putchar('8');
1121
+ if(myrand(10) == 0){
1122
+ tcrdbout(rdb, kbuf, ksiz);
1123
+ tcmapout(map, kbuf, ksiz);
1124
+ }
1125
+ break;
1126
+ case 9:
1127
+ putchar('9');
1128
+ if(myrand(10) == 0){
1129
+ tcrdbout2(rdb, kbuf);
1130
+ tcmapout2(map, kbuf);
1131
+ }
1132
+ break;
1133
+ case 10:
1134
+ putchar('A');
1135
+ if((rbuf = tcrdbget(rdb, kbuf, ksiz, &vsiz)) != NULL) tcfree(rbuf);
1136
+ break;
1137
+ case 11:
1138
+ putchar('B');
1139
+ if((rbuf = tcrdbget2(rdb, kbuf)) != NULL) tcfree(rbuf);
1140
+ break;
1141
+ case 12:
1142
+ putchar('C');
1143
+ tcrdbvsiz(rdb, kbuf, ksiz);
1144
+ break;
1145
+ case 13:
1146
+ putchar('D');
1147
+ tcrdbvsiz2(rdb, kbuf);
1148
+ break;
1149
+ case 14:
1150
+ putchar('E');
1151
+ if(myrand(rnum / 50) == 0){
1152
+ if(!tcrdbiterinit(rdb)){
1153
+ eprint(rdb, __LINE__, "tcrdbiterinit");
1154
+ err = true;
1155
+ }
1156
+ }
1157
+ for(int j = myrand(rnum) / 1000 + 1; j >= 0; j--){
1158
+ int iksiz;
1159
+ char *ikbuf = tcrdbiternext(rdb, &iksiz);
1160
+ if(ikbuf) tcfree(ikbuf);
1161
+ }
1162
+ break;
1163
+ default:
1164
+ putchar('@');
1165
+ if(myrand(10000) == 0) srand((unsigned int)(tctime() * 1000) % UINT_MAX);
1166
+ rdb = rdbs[myrand(rnum)%cnum];
1167
+ break;
1168
+ }
1169
+ if(i % 50 == 0) iprintf(" (%08d)\n", i);
1170
+ }
1171
+ if(rnum % 50 > 0) iprintf(" (%08d)\n", rnum);
1172
+ tcrdbsync(rdb);
1173
+ if(tcrdbrnum(rdb) != tcmaprnum(map)){
1174
+ eprint(rdb, __LINE__, "(validation)");
1175
+ err = true;
1176
+ }
1177
+ for(int i = 1; i <= rnum && !err; i++){
1178
+ char kbuf[RECBUFSIZ];
1179
+ int ksiz = sprintf(kbuf, "%d", i - 1);
1180
+ int vsiz;
1181
+ const char *vbuf = tcmapget(map, kbuf, ksiz, &vsiz);
1182
+ int rsiz;
1183
+ char *rbuf = tcrdbget(rdb, kbuf, ksiz, &rsiz);
1184
+ if(vbuf){
1185
+ putchar('.');
1186
+ if(!rbuf){
1187
+ eprint(rdb, __LINE__, "tcrdbget");
1188
+ err = true;
1189
+ } else if(rsiz != vsiz || memcmp(rbuf, vbuf, rsiz)){
1190
+ eprint(rdb, __LINE__, "(validation)");
1191
+ err = true;
1192
+ }
1193
+ } else {
1194
+ putchar('*');
1195
+ if(rbuf){
1196
+ eprint(rdb, __LINE__, "(validation)");
1197
+ err = true;
1198
+ }
1199
+ }
1200
+ tcfree(rbuf);
1201
+ if(i % 50 == 0) iprintf(" (%08d)\n", i);
1202
+ }
1203
+ if(rnum % 50 > 0) iprintf(" (%08d)\n", rnum);
1204
+ tcmapiterinit(map);
1205
+ int ksiz;
1206
+ const char *kbuf;
1207
+ for(int i = 1; (kbuf = tcmapiternext(map, &ksiz)) != NULL; i++){
1208
+ putchar('+');
1209
+ int vsiz;
1210
+ const char *vbuf = tcmapiterval(kbuf, &vsiz);
1211
+ int rsiz;
1212
+ char *rbuf = tcrdbget(rdb, kbuf, ksiz, &rsiz);
1213
+ if(!rbuf){
1214
+ eprint(rdb, __LINE__, "tcrdbget");
1215
+ err = true;
1216
+ } else if(rsiz != vsiz || memcmp(rbuf, vbuf, rsiz)){
1217
+ eprint(rdb, __LINE__, "(validation)");
1218
+ err = true;
1219
+ }
1220
+ tcfree(rbuf);
1221
+ if(!tcrdbout(rdb, kbuf, ksiz)){
1222
+ eprint(rdb, __LINE__, "tcrdbout");
1223
+ err = true;
1224
+ }
1225
+ if(i % 50 == 0) iprintf(" (%08d)\n", i);
1226
+ }
1227
+ int mrnum = tcmaprnum(map);
1228
+ if(mrnum % 50 > 0) iprintf(" (%08d)\n", mrnum);
1229
+ if(tcrdbrnum(rdb) != 0){
1230
+ eprint(rdb, __LINE__, "(validation)");
1231
+ err = true;
1232
+ }
1233
+ iprintf("record number: %llu\n", (unsigned long long)tcrdbrnum(rdb));
1234
+ iprintf("size: %llu\n", (unsigned long long)tcrdbsize(rdb));
1235
+ tcmapdel(map);
1236
+ for(int i = 0; i < cnum; i++){
1237
+ if(!tcrdbclose(rdbs[i])){
1238
+ eprint(rdbs[i], __LINE__, "tcrdbclose");
1239
+ err = true;
1240
+ }
1241
+ tcrdbdel(rdbs[i]);
1242
+ }
1243
+ iprintf("time: %.3f\n", tctime() - stime);
1244
+ iprintf("%s\n\n", err ? "error" : "ok");
1245
+ return err ? 1 : 0;
1246
+ }
1247
+
1248
+
1249
+ /* perform table command */
1250
+ static int proctable(const char *host, int port, int cnum, int tout, int rnum, int exp){
1251
+ iprintf("<Table Extension Test>\n host=%s port=%d cnum=%d tout=%d rnum=%d exp=%d\n\n",
1252
+ host, port, cnum, tout, rnum, exp);
1253
+ bool err = false;
1254
+ double stime = tctime();
1255
+ TCRDB *rdbs[cnum];
1256
+ for(int i = 0; i < cnum; i++){
1257
+ rdbs[i] = tcrdbnew();
1258
+ if(tout > 0) tcrdbtune(rdbs[i], tout, RDBTRECON);
1259
+ if(!myopen(rdbs[i], host, port)){
1260
+ eprint(rdbs[i], __LINE__, "tcrdbopen");
1261
+ err = true;
1262
+ }
1263
+ }
1264
+ TCRDB *rdb = rdbs[0];
1265
+ if(!tcrdbvanish(rdb)){
1266
+ eprint(rdb, __LINE__, "tcrdbvanish");
1267
+ err = true;
1268
+ }
1269
+ if(exp > 0){
1270
+ if(!tcrdbtblsetindex(rdb, "x", RDBITDECIMAL)){
1271
+ eprint(rdb, __LINE__, "tcrdbtblsetindex");
1272
+ err = true;
1273
+ }
1274
+ for(int i = 1; i <= rnum && !err; i++){
1275
+ char pkbuf[RECBUFSIZ];
1276
+ int pksiz = sprintf(pkbuf, "%d", myrand(rnum) + 1);
1277
+ int act = myrand(100);
1278
+ if(act < 50){
1279
+ TCMAP *cols = tcmapnew2(7);
1280
+ char vbuf[RECBUFSIZ*5];
1281
+ int vsiz = sprintf(vbuf, "%08d", i);
1282
+ tcmapput(cols, "n", 1, vbuf, vsiz);
1283
+ vsiz = sprintf(vbuf, "%d", (int)tctime() + exp);
1284
+ tcmapput(cols, "x", 1, vbuf, vsiz);
1285
+ if(!tcrdbtblput(rdb, pkbuf, pksiz, cols)){
1286
+ eprint(rdb, __LINE__, "tcrdbtblput");
1287
+ err = true;
1288
+ }
1289
+ tcmapdel(cols);
1290
+ } else if(act == 60){
1291
+ if(!tcrdbtblout(rdb, pkbuf, pksiz) && tcrdbecode(rdb) != TTENOREC){
1292
+ eprint(rdb, __LINE__, "tcrdbtblout");
1293
+ err = true;
1294
+ }
1295
+ } else {
1296
+ TCMAP *cols = tcrdbtblget(rdb, pkbuf, pksiz);
1297
+ if(cols){
1298
+ tcmapdel(cols);
1299
+ } else if(tcrdbecode(rdb) != TTENOREC){
1300
+ eprint(rdb, __LINE__, "tcrdbtblget");
1301
+ err = true;
1302
+ }
1303
+ }
1304
+ if(rnum > 250 && i % (rnum / 250) == 0){
1305
+ iputchar('.');
1306
+ if(i == rnum || i % (rnum / 10) == 0) iprintf(" (%08d)\n", i);
1307
+ rdb = rdbs[myrand(rnum)%cnum];
1308
+ }
1309
+ }
1310
+ } else {
1311
+ if(!tcrdbtblsetindex(rdb, "", RDBITDECIMAL)){
1312
+ eprint(rdb, __LINE__, "tcrdbtblsetindex");
1313
+ err = true;
1314
+ }
1315
+ if(!tcrdbtblsetindex(rdb, "str", RDBITLEXICAL)){
1316
+ eprint(rdb, __LINE__, "tcrdbtblsetindex");
1317
+ err = true;
1318
+ }
1319
+ if(!tcrdbtblsetindex(rdb, "num", RDBITDECIMAL)){
1320
+ eprint(rdb, __LINE__, "tcrdbtblsetindex");
1321
+ err = true;
1322
+ }
1323
+ if(!tcrdbtblsetindex(rdb, "type", RDBITDECIMAL)){
1324
+ eprint(rdb, __LINE__, "tcrdbtblsetindex");
1325
+ err = true;
1326
+ }
1327
+ if(!tcrdbtblsetindex(rdb, "flag", RDBITTOKEN)){
1328
+ eprint(rdb, __LINE__, "tcrdbtblsetindex");
1329
+ err = true;
1330
+ }
1331
+ if(!tcrdbtblsetindex(rdb, "text", RDBITQGRAM)){
1332
+ eprint(rdb, __LINE__, "tcrdbtblsetindex");
1333
+ err = true;
1334
+ }
1335
+ iprintf("writing:\n");
1336
+ for(int i = 1; i <= rnum && !err; i++){
1337
+ int id = (int)tcrdbtblgenuid(rdb);
1338
+ char pkbuf[RECBUFSIZ];
1339
+ int pksiz = sprintf(pkbuf, "%d", id);
1340
+ TCMAP *cols = tcmapnew2(7);
1341
+ char vbuf[RECBUFSIZ*5];
1342
+ int vsiz = sprintf(vbuf, "%d", id);
1343
+ tcmapput(cols, "str", 3, vbuf, vsiz);
1344
+ vsiz = sprintf(vbuf, "%d", myrand(i) + 1);
1345
+ tcmapput(cols, "num", 3, vbuf, vsiz);
1346
+ vsiz = sprintf(vbuf, "%d", myrand(32) + 1);
1347
+ tcmapput(cols, "type", 4, vbuf, vsiz);
1348
+ int num = myrand(5);
1349
+ int pt = 0;
1350
+ char *wp = vbuf;
1351
+ for(int j = 0; j < num; j++){
1352
+ pt += myrand(5) + 1;
1353
+ if(wp > vbuf) *(wp++) = ',';
1354
+ wp += sprintf(wp, "%d", pt);
1355
+ }
1356
+ *wp = '\0';
1357
+ if(*vbuf != '\0'){
1358
+ tcmapput(cols, "flag", 4, vbuf, wp - vbuf);
1359
+ tcmapput(cols, "text", 4, vbuf, wp - vbuf);
1360
+ }
1361
+ switch(myrand(4)){
1362
+ default:
1363
+ if(!tcrdbtblput(rdb, pkbuf, pksiz, cols)){
1364
+ eprint(rdb, __LINE__, "tcrdbtblput");
1365
+ err = true;
1366
+ }
1367
+ break;
1368
+ case 1:
1369
+ if(!tcrdbtblputkeep(rdb, pkbuf, pksiz, cols)){
1370
+ eprint(rdb, __LINE__, "tcrdbtblputkeep");
1371
+ err = true;
1372
+ }
1373
+ break;
1374
+ case 2:
1375
+ if(!tcrdbtblputcat(rdb, pkbuf, pksiz, cols)){
1376
+ eprint(rdb, __LINE__, "tcrdbtblput");
1377
+ err = true;
1378
+ }
1379
+ break;
1380
+ }
1381
+ tcmapdel(cols);
1382
+ if(rnum > 250 && i % (rnum / 250) == 0){
1383
+ iputchar('.');
1384
+ if(i == rnum || i % (rnum / 10) == 0) iprintf(" (%08d)\n", i);
1385
+ rdb = rdbs[myrand(rnum)%cnum];
1386
+ }
1387
+ }
1388
+ iprintf("removing:\n");
1389
+ for(int i = 1; i <= rnum && !err; i++){
1390
+ char pkbuf[RECBUFSIZ];
1391
+ int pksiz = sprintf(pkbuf, "%d", myrand(rnum) + 1);
1392
+ if(!tcrdbtblout(rdb, pkbuf, pksiz) && tcrdbecode(rdb) != TTENOREC){
1393
+ eprint(rdb, __LINE__, "tcrdbtblout");
1394
+ err = true;
1395
+ }
1396
+ if(rnum > 250 && i % (rnum / 250) == 0){
1397
+ iputchar('.');
1398
+ if(i == rnum || i % (rnum / 10) == 0) iprintf(" (%08d)\n", i);
1399
+ rdb = rdbs[myrand(rnum)%cnum];
1400
+ }
1401
+ }
1402
+ iprintf("reading:\n");
1403
+ for(int i = 1; i <= rnum && !err; i++){
1404
+ char pkbuf[RECBUFSIZ];
1405
+ int pksiz = sprintf(pkbuf, "%d", myrand(rnum) + 1);
1406
+ TCMAP *cols = tcrdbtblget(rdb, pkbuf, pksiz);
1407
+ if(cols){
1408
+ tcmapdel(cols);
1409
+ } else if(tcrdbecode(rdb) != TTENOREC){
1410
+ eprint(rdb, __LINE__, "tcrdbtblget");
1411
+ err = true;
1412
+ }
1413
+ if(rnum > 250 && i % (rnum / 250) == 0){
1414
+ iputchar('.');
1415
+ if(i == rnum || i % (rnum / 10) == 0) iprintf(" (%08d)\n", i);
1416
+ rdb = rdbs[myrand(rnum)%cnum];
1417
+ }
1418
+ }
1419
+ iprintf("searching:\n");
1420
+ const char *names[] = { "", "str", "num", "type", "flag", "text", "c1" };
1421
+ int ops[] = { RDBQCSTREQ, RDBQCSTRINC, RDBQCSTRBW, RDBQCSTREW, RDBQCSTRAND, RDBQCSTROR,
1422
+ RDBQCSTROREQ, RDBQCSTRRX, RDBQCNUMEQ, RDBQCNUMGT, RDBQCNUMGE, RDBQCNUMLT,
1423
+ RDBQCNUMLE, RDBQCNUMBT, RDBQCNUMOREQ };
1424
+ int ftsops[] = { RDBQCFTSPH, RDBQCFTSAND, RDBQCFTSOR, RDBQCFTSEX };
1425
+ int types[] = { RDBQOSTRASC, RDBQOSTRDESC, RDBQONUMASC, RDBQONUMDESC };
1426
+ for(int i = 1; i <= rnum && !err; i++){
1427
+ RDBQRY *qry = tcrdbqrynew(rdb);
1428
+ int condnum = myrand(4);
1429
+ if(condnum < 1 && myrand(5) != 0) condnum = 1;
1430
+ for(int j = 0; j < condnum; j++){
1431
+ const char *name = names[myrand(sizeof(names) / sizeof(*names))];
1432
+ int op = ops[myrand(sizeof(ops) / sizeof(*ops))];
1433
+ if(myrand(10) == 0) op = ftsops[myrand(sizeof(ftsops) / sizeof(*ftsops))];
1434
+ if(myrand(20) == 0) op |= RDBQCNEGATE;
1435
+ if(myrand(20) == 0) op |= RDBQCNOIDX;
1436
+ char expr[RECBUFSIZ*3];
1437
+ char *wp = expr;
1438
+ wp += sprintf(expr, "%d", myrand(i));
1439
+ if(myrand(10) == 0) wp += sprintf(wp, ",%d", myrand(i));
1440
+ if(myrand(10) == 0) wp += sprintf(wp, ",%d", myrand(i));
1441
+ tcrdbqryaddcond(qry, name, op, expr);
1442
+ }
1443
+ if(myrand(3) != 0){
1444
+ const char *name = names[myrand(sizeof(names) / sizeof(*names))];
1445
+ int type = types[myrand(sizeof(types) / sizeof(*types))];
1446
+ tcrdbqrysetorder(qry, name, type);
1447
+ }
1448
+ tcrdbqrysetlimit(qry, myrand(10), myrand(5) * 10);
1449
+ if(myrand(10) == 0){
1450
+ RDBQRY *qrys[4];
1451
+ int num = myrand(5);
1452
+ for(int j = 0; j < num; j++){
1453
+ qrys[j] = qry;
1454
+ }
1455
+ if(myrand(3) == 0){
1456
+ TCLIST *res = tcrdbparasearch(qrys, num);
1457
+ for(int j = 0; j < 3 && j < tclistnum(res); j++){
1458
+ TCMAP *cols = tcrdbqryrescols(res, j);
1459
+ if(!tcmapget2(cols, "")){
1460
+ eprint(rdb, __LINE__, "(validation)");
1461
+ err = true;
1462
+ }
1463
+ tcmapdel(cols);
1464
+ }
1465
+ tclistdel(res);
1466
+ } else {
1467
+ TCLIST *res = tcrdbmetasearch(qrys, num, RDBMSUNION + myrand(3));
1468
+ for(int j = 0; j < 3 && j < tclistnum(res); j++){
1469
+ int pksiz;
1470
+ const char *pkbuf = tclistval(res, j, &pksiz);
1471
+ TCMAP *cols = tcrdbtblget(rdb, pkbuf, pksiz);
1472
+ if(cols){
1473
+ tcmapdel(cols);
1474
+ } else {
1475
+ eprint(rdb, __LINE__, "tcrdbtblget");
1476
+ err = true;
1477
+ }
1478
+ }
1479
+ tclistdel(res);
1480
+ }
1481
+ } else {
1482
+ TCLIST *res = tcrdbqrysearch(qry);
1483
+ tclistdel(res);
1484
+ }
1485
+ tcrdbqrydel(qry);
1486
+ if(rnum > 250 && i % (rnum / 250) == 0){
1487
+ iputchar('.');
1488
+ if(i == rnum || i % (rnum / 10) == 0) iprintf(" (%08d)\n", i);
1489
+ rdb = rdbs[myrand(rnum)%cnum];
1490
+ }
1491
+ }
1492
+ RDBQRY *qry = tcrdbqrynew(rdb);
1493
+ tcrdbqryaddcond(qry, "", RDBQCSTRBW, "1");
1494
+ tcrdbqrysetorder(qry, "str", RDBQOSTRASC);
1495
+ tcrdbqrysetlimit(qry, 10, 0);
1496
+ TCLIST *res = tcrdbqrysearchget(qry);
1497
+ for(int i = 0; i < tclistnum(res); i++){
1498
+ TCMAP *cols = tcrdbqryrescols(res, i);
1499
+ if(!tcmapget2(cols, "")){
1500
+ eprint(rdbs[i], __LINE__, "(validation)");
1501
+ err = true;
1502
+ break;
1503
+ }
1504
+ tcmapdel(cols);
1505
+ }
1506
+ if(tclistnum(res) != tcrdbqrysearchcount(qry)){
1507
+ eprint(rdb, __LINE__, "(validation)");
1508
+ err = true;
1509
+ }
1510
+ tclistdel(res);
1511
+ tcrdbqrydel(qry);
1512
+ qry = tcrdbqrynew(rdb);
1513
+ res = tcrdbqrysearch(qry);
1514
+ if(tclistnum(res) != tcrdbrnum(rdb)){
1515
+ eprint(rdb, __LINE__, "(validation)");
1516
+ err = true;
1517
+ }
1518
+ tclistdel(res);
1519
+ tcrdbqrysearchout(qry);
1520
+ if(tcrdbrnum(rdb) != 0){
1521
+ eprint(rdb, __LINE__, "(validation)");
1522
+ err = true;
1523
+ }
1524
+ tcrdbqrydel(qry);
1525
+ }
1526
+ iprintf("record number: %llu\n", (unsigned long long)tcrdbrnum(rdb));
1527
+ iprintf("size: %llu\n", (unsigned long long)tcrdbsize(rdb));
1528
+ for(int i = 0; i < cnum; i++){
1529
+ if(!tcrdbclose(rdbs[i])){
1530
+ eprint(rdbs[i], __LINE__, "tcrdbclose");
1531
+ err = true;
1532
+ }
1533
+ tcrdbdel(rdbs[i]);
1534
+ }
1535
+ iprintf("time: %.3f\n", tctime() - stime);
1536
+ iprintf("%s\n\n", err ? "error" : "ok");
1537
+ return err ? 1 : 0;
1538
+ }
1539
+
1540
+
1541
+
1542
+ // END OF FILE