rroonga 3.0.9-x64-mingw32 → 3.1.0-x64-mingw32
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.textile +10 -10
- data/bin/groonga-database-inspect +40 -0
- data/doc/text/news.textile +19 -0
- data/ext/groonga/extconf.rb +3 -1
- data/ext/groonga/rb-grn-expression.c +1 -1
- data/ext/groonga/rb-grn-operator.c +218 -8
- data/ext/groonga/rb-grn.h +4 -2
- data/lib/1.9/groonga.so +0 -0
- data/lib/2.0/groonga.so +0 -0
- data/lib/2.1/groonga.so +0 -0
- data/lib/groonga.rb +4 -1
- data/lib/groonga/column.rb +25 -0
- data/lib/groonga/database-inspector.rb +279 -0
- data/lib/groonga/database.rb +32 -2
- data/lib/groonga/dumper.rb +7 -13
- data/lib/groonga/index-column.rb +11 -1
- data/lib/groonga/statistic-measurer.rb +37 -0
- data/lib/groonga/table.rb +25 -0
- data/rroonga-build.rb +2 -2
- data/test/groonga-test-utils.rb +10 -10
- data/test/test-column.rb +26 -0
- data/test/test-database-inspector.rb +676 -0
- data/test/test-database.rb +25 -1
- data/test/test-expression-builder.rb +1 -0
- data/test/test-expression.rb +73 -0
- data/test/test-index-column.rb +23 -0
- data/test/test-statistic-measurer.rb +55 -0
- data/test/test-table.rb +40 -0
- data/vendor/local/bin/groonga-benchmark.exe +0 -0
- data/vendor/local/bin/groonga.exe +0 -0
- data/vendor/local/bin/libgroonga-0.dll +0 -0
- data/vendor/local/bin/libmecab-1.dll +0 -0
- data/vendor/local/bin/libmsgpack-3.dll +0 -0
- data/vendor/local/bin/libmsgpackc-2.dll +0 -0
- data/vendor/local/bin/mecab.exe +0 -0
- data/vendor/local/lib/groonga/plugins/query_expanders/tsv.a +0 -0
- data/vendor/local/lib/groonga/plugins/query_expanders/tsv.dll +0 -0
- data/vendor/local/lib/groonga/plugins/query_expanders/tsv.dll.a +0 -0
- data/vendor/local/lib/groonga/plugins/suggest/suggest.a +0 -0
- data/vendor/local/lib/groonga/plugins/suggest/suggest.dll +0 -0
- data/vendor/local/lib/groonga/plugins/suggest/suggest.dll.a +0 -0
- data/vendor/local/lib/groonga/plugins/table/table.a +0 -0
- data/vendor/local/lib/groonga/plugins/table/table.dll +0 -0
- data/vendor/local/lib/groonga/plugins/table/table.dll.a +0 -0
- data/vendor/local/lib/groonga/plugins/tokenizers/mecab.a +0 -0
- data/vendor/local/lib/groonga/plugins/tokenizers/mecab.dll +0 -0
- data/vendor/local/lib/groonga/plugins/tokenizers/mecab.dll.a +0 -0
- data/vendor/local/lib/libgroonga.a +0 -0
- data/vendor/local/lib/libgroonga.dll.a +0 -0
- data/vendor/local/lib/libmecab.a +0 -0
- data/vendor/local/lib/libmecab.dll.a +0 -0
- data/vendor/local/lib/libmsgpack.a +0 -0
- data/vendor/local/lib/libmsgpack.dll.a +0 -0
- data/vendor/local/lib/libmsgpackc.a +0 -0
- data/vendor/local/lib/libmsgpackc.dll.a +0 -0
- data/vendor/local/lib/pkgconfig/groonga.pc +2 -2
- data/vendor/local/libexec/mecab/mecab-cost-train.exe +0 -0
- data/vendor/local/libexec/mecab/mecab-dict-gen.exe +0 -0
- data/vendor/local/libexec/mecab/mecab-dict-index.exe +0 -0
- data/vendor/local/libexec/mecab/mecab-system-eval.exe +0 -0
- data/vendor/local/libexec/mecab/mecab-test-gen.exe +0 -0
- data/vendor/local/share/doc/groonga/en/html/.buildinfo +1 -1
- data/vendor/local/share/doc/groonga/en/html/_sources/install/centos.txt +7 -7
- data/vendor/local/share/doc/groonga/en/html/_sources/install/debian.txt +3 -3
- data/vendor/local/share/doc/groonga/en/html/_sources/install/fedora.txt +3 -3
- data/vendor/local/share/doc/groonga/en/html/_sources/install/mac_os_x.txt +3 -3
- data/vendor/local/share/doc/groonga/en/html/_sources/install/others.txt +3 -3
- data/vendor/local/share/doc/groonga/en/html/_sources/install/solaris.txt +3 -3
- data/vendor/local/share/doc/groonga/en/html/_sources/install/ubuntu.txt +3 -3
- data/vendor/local/share/doc/groonga/en/html/_sources/install/windows.txt +25 -39
- data/vendor/local/share/doc/groonga/en/html/_sources/news.txt +41 -0
- data/vendor/local/share/doc/groonga/en/html/_sources/reference/commands/ruby_load.txt +1 -1
- data/vendor/local/share/doc/groonga/en/html/_sources/reference/executables/groonga-benchmark.txt +273 -0
- data/vendor/local/share/doc/groonga/en/html/_sources/suggest/completion.txt +16 -6
- data/vendor/local/share/doc/groonga/en/html/characteristic.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/community.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/contribution.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/contribution/development.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/contribution/development/com.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/contribution/development/cooperation.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/contribution/development/document.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/contribution/development/query.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/contribution/development/release.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/contribution/development/repository.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/contribution/development/test.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/contribution/documentation.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/contribution/documentation/c-api.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/contribution/documentation/i18n.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/contribution/report.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/development.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/development/travis-ci.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/genindex.html +19 -19
- data/vendor/local/share/doc/groonga/en/html/geolocation_search.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/index.html +7 -7
- data/vendor/local/share/doc/groonga/en/html/install.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/install/centos.html +10 -10
- data/vendor/local/share/doc/groonga/en/html/install/debian.html +8 -8
- data/vendor/local/share/doc/groonga/en/html/install/fedora.html +8 -8
- data/vendor/local/share/doc/groonga/en/html/install/mac_os_x.html +8 -8
- data/vendor/local/share/doc/groonga/en/html/install/others.html +8 -8
- data/vendor/local/share/doc/groonga/en/html/install/solaris.html +8 -8
- data/vendor/local/share/doc/groonga/en/html/install/ubuntu.html +8 -8
- data/vendor/local/share/doc/groonga/en/html/install/windows.html +50 -45
- data/vendor/local/share/doc/groonga/en/html/limitations.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/news.html +220 -172
- data/vendor/local/share/doc/groonga/en/html/news/0.x.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/news/1.0.x.html +6 -6
- data/vendor/local/share/doc/groonga/en/html/news/1.1.x.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/news/1.2.x.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/news/senna.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/objects.inv +0 -0
- data/vendor/local/share/doc/groonga/en/html/reference.html +7 -7
- data/vendor/local/share/doc/groonga/en/html/reference/api.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/api/grn_cache.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/api/grn_column.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/api/grn_command_version.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/api/grn_ctx.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/api/grn_db.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/api/grn_encoding.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/api/grn_expr.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/api/grn_geo.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/api/grn_hook.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/api/grn_ii.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/api/grn_index_cursor.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/api/grn_info.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/api/grn_match_escalation.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/api/grn_obj.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/api/grn_proc.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/api/grn_search.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/api/grn_table.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/api/grn_table_cursor.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/api/grn_type.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/api/grn_user_data.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/cast.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/command.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/command/command_version.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/command/output_format.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/command/return_code.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/commands/cache_limit.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/commands/check.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/commands/clearlock.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/commands/column_create.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/commands/column_list.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/commands/column_remove.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/commands/column_rename.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/commands/define_selector.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/commands/defrag.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/commands/delete.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/commands/dump.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/commands/load.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/commands/log_level.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/commands/log_put.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/commands/log_reopen.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/commands/normalize.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/commands/quit.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/commands/register.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/commands/ruby_eval.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/commands/ruby_load.html +12 -5
- data/vendor/local/share/doc/groonga/en/html/reference/commands/select.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/commands/shutdown.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/commands/status.html +10 -10
- data/vendor/local/share/doc/groonga/en/html/reference/commands/suggest.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/commands/table_create.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/commands/table_list.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/commands/table_remove.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/commands/tokenize.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/commands/truncate.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/commands_not_implemented/add.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/commands_not_implemented/get.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/commands_not_implemented/set.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/executables.html +7 -7
- data/vendor/local/share/doc/groonga/en/html/reference/executables/grnslap.html +10 -10
- data/vendor/local/share/doc/groonga/en/html/reference/executables/grntest.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/executables/groonga-benchmark.html +410 -0
- data/vendor/local/share/doc/groonga/en/html/reference/executables/groonga-httpd.html +14 -14
- data/vendor/local/share/doc/groonga/en/html/reference/executables/groonga-server-http.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/executables/groonga-suggest-create-dataset.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/executables/groonga-suggest-httpd.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/executables/groonga-suggest-learner.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/executables/groonga.html +33 -33
- data/vendor/local/share/doc/groonga/en/html/reference/function.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/functions/edit_distance.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/functions/geo_distance.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/functions/geo_in_circle.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/functions/geo_in_rectangle.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/functions/html_untag.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/functions/now.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/functions/query.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/functions/rand.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/functions/snippet_html.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/functions/sub_filter.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/grn_expr.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/grn_expr/query_syntax.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/grn_expr/script_syntax.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/indexing.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/log.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/normalizers.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/output.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/pseudo_column.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/query_expanders.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/query_expanders/tsv.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/tables.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/tokenizers.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/tuning.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/types.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/search.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/searchindex.js +1 -1
- data/vendor/local/share/doc/groonga/en/html/server.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/server/gqtp.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/server/http.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/server/http/comparison.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/server/http/groonga-httpd.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/server/http/groonga.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/server/package.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/spec.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/spec/gqtp.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/spec/search.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/suggest.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/suggest/completion.html +21 -11
- data/vendor/local/share/doc/groonga/en/html/suggest/correction.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/suggest/introduction.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/suggest/suggestion.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/suggest/tutorial.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/troubleshooting.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/troubleshooting/different_results_with_the_same_keyword.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/troubleshooting/mmap_cannot_allocate_memory.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/tutorial.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/tutorial/data.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/tutorial/drilldown.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/tutorial/index.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/tutorial/introduction.html +8 -8
- data/vendor/local/share/doc/groonga/en/html/tutorial/lexicon.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/tutorial/match_columns.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/tutorial/micro_blog.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/tutorial/network.html +12 -12
- data/vendor/local/share/doc/groonga/en/html/tutorial/patricia_trie.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/tutorial/query_expansion.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/tutorial/search.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/.buildinfo +1 -1
- data/vendor/local/share/doc/groonga/ja/html/_sources/install/centos.txt +7 -7
- data/vendor/local/share/doc/groonga/ja/html/_sources/install/debian.txt +3 -3
- data/vendor/local/share/doc/groonga/ja/html/_sources/install/fedora.txt +3 -3
- data/vendor/local/share/doc/groonga/ja/html/_sources/install/mac_os_x.txt +3 -3
- data/vendor/local/share/doc/groonga/ja/html/_sources/install/others.txt +3 -3
- data/vendor/local/share/doc/groonga/ja/html/_sources/install/solaris.txt +3 -3
- data/vendor/local/share/doc/groonga/ja/html/_sources/install/ubuntu.txt +3 -3
- data/vendor/local/share/doc/groonga/ja/html/_sources/install/windows.txt +25 -39
- data/vendor/local/share/doc/groonga/ja/html/_sources/news.txt +41 -0
- data/vendor/local/share/doc/groonga/ja/html/_sources/reference/commands/ruby_load.txt +1 -1
- data/vendor/local/share/doc/groonga/ja/html/_sources/reference/executables/groonga-benchmark.txt +273 -0
- data/vendor/local/share/doc/groonga/ja/html/_sources/suggest/completion.txt +16 -6
- data/vendor/local/share/doc/groonga/ja/html/characteristic.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/community.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/contribution.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/contribution/development.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/contribution/development/com.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/contribution/development/cooperation.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/contribution/development/document.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/contribution/development/query.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/contribution/development/release.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/contribution/development/repository.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/contribution/development/test.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/contribution/documentation.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/contribution/documentation/c-api.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/contribution/documentation/i18n.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/contribution/report.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/development.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/development/travis-ci.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/genindex.html +19 -19
- data/vendor/local/share/doc/groonga/ja/html/geolocation_search.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/index.html +7 -7
- data/vendor/local/share/doc/groonga/ja/html/install.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/install/centos.html +10 -10
- data/vendor/local/share/doc/groonga/ja/html/install/debian.html +8 -8
- data/vendor/local/share/doc/groonga/ja/html/install/fedora.html +8 -8
- data/vendor/local/share/doc/groonga/ja/html/install/mac_os_x.html +8 -8
- data/vendor/local/share/doc/groonga/ja/html/install/others.html +8 -8
- data/vendor/local/share/doc/groonga/ja/html/install/solaris.html +8 -8
- data/vendor/local/share/doc/groonga/ja/html/install/ubuntu.html +8 -8
- data/vendor/local/share/doc/groonga/ja/html/install/windows.html +39 -38
- data/vendor/local/share/doc/groonga/ja/html/limitations.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/news.html +234 -173
- data/vendor/local/share/doc/groonga/ja/html/news/0.x.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/news/1.0.x.html +6 -6
- data/vendor/local/share/doc/groonga/ja/html/news/1.1.x.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/news/1.2.x.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/news/senna.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/objects.inv +0 -0
- data/vendor/local/share/doc/groonga/ja/html/reference.html +7 -7
- data/vendor/local/share/doc/groonga/ja/html/reference/api.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/api/grn_cache.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/api/grn_column.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/api/grn_command_version.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/api/grn_ctx.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/api/grn_db.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/api/grn_encoding.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/api/grn_expr.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/api/grn_geo.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/api/grn_hook.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/api/grn_ii.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/api/grn_index_cursor.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/api/grn_info.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/api/grn_match_escalation.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/api/grn_obj.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/api/grn_proc.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/api/grn_search.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/api/grn_table.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/api/grn_table_cursor.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/api/grn_type.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/api/grn_user_data.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/cast.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/command.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/command/command_version.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/command/output_format.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/command/return_code.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/commands/cache_limit.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/commands/check.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/commands/clearlock.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/commands/column_create.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/commands/column_list.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/commands/column_remove.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/commands/column_rename.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/commands/define_selector.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/commands/defrag.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/commands/delete.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/commands/dump.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/commands/load.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/commands/log_level.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/commands/log_put.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/commands/log_reopen.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/commands/normalize.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/commands/quit.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/commands/register.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/commands/ruby_eval.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/commands/ruby_load.html +12 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/commands/select.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/commands/shutdown.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/commands/status.html +10 -10
- data/vendor/local/share/doc/groonga/ja/html/reference/commands/suggest.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/commands/table_create.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/commands/table_list.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/commands/table_remove.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/commands/tokenize.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/commands/truncate.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/commands_not_implemented/add.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/commands_not_implemented/get.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/commands_not_implemented/set.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/executables.html +7 -7
- data/vendor/local/share/doc/groonga/ja/html/reference/executables/grnslap.html +10 -10
- data/vendor/local/share/doc/groonga/ja/html/reference/executables/grntest.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/executables/groonga-benchmark.html +411 -0
- data/vendor/local/share/doc/groonga/ja/html/reference/executables/groonga-httpd.html +14 -14
- data/vendor/local/share/doc/groonga/ja/html/reference/executables/groonga-server-http.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/executables/groonga-suggest-create-dataset.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/executables/groonga-suggest-httpd.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/executables/groonga-suggest-learner.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/executables/groonga.html +33 -33
- data/vendor/local/share/doc/groonga/ja/html/reference/function.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/functions/edit_distance.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/functions/geo_distance.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/functions/geo_in_circle.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/functions/geo_in_rectangle.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/functions/html_untag.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/functions/now.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/functions/query.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/functions/rand.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/functions/snippet_html.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/functions/sub_filter.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/grn_expr.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/grn_expr/query_syntax.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/grn_expr/script_syntax.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/indexing.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/log.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/normalizers.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/output.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/pseudo_column.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/query_expanders.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/query_expanders/tsv.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/tables.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/tokenizers.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/tuning.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/types.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/search.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/searchindex.js +1 -1
- data/vendor/local/share/doc/groonga/ja/html/server.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/server/gqtp.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/server/http.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/server/http/comparison.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/server/http/groonga-httpd.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/server/http/groonga.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/server/package.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/spec.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/spec/gqtp.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/spec/search.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/suggest.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/suggest/completion.html +21 -11
- data/vendor/local/share/doc/groonga/ja/html/suggest/correction.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/suggest/introduction.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/suggest/suggestion.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/suggest/tutorial.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/troubleshooting.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/troubleshooting/different_results_with_the_same_keyword.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/troubleshooting/mmap_cannot_allocate_memory.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/tutorial.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/tutorial/data.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/tutorial/drilldown.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/tutorial/index.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/tutorial/introduction.html +8 -8
- data/vendor/local/share/doc/groonga/ja/html/tutorial/lexicon.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/tutorial/match_columns.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/tutorial/micro_blog.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/tutorial/network.html +12 -12
- data/vendor/local/share/doc/groonga/ja/html/tutorial/patricia_trie.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/tutorial/query_expansion.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/tutorial/search.html +5 -5
- data/vendor/local/share/man/ja/man1/groonga.1 +489 -491
- data/vendor/local/share/man/man1/groonga.1 +500 -498
- metadata +21 -8
- data/lib/groonga/view-record.rb +0 -50
@@ -0,0 +1,25 @@
|
|
1
|
+
# -*- coding: utf-8 -*-
|
2
|
+
#
|
3
|
+
# Copyright (C) 2013 Kouhei Sutou <kou@clear-code.com>
|
4
|
+
#
|
5
|
+
# This library is free software; you can redistribute it and/or
|
6
|
+
# modify it under the terms of the GNU Lesser General Public
|
7
|
+
# License version 2.1 as published by the Free Software Foundation.
|
8
|
+
#
|
9
|
+
# This library is distributed in the hope that it will be useful,
|
10
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
11
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
12
|
+
# Lesser General Public License for more details.
|
13
|
+
#
|
14
|
+
# You should have received a copy of the GNU Lesser General Public
|
15
|
+
# License along with this library; if not, write to the Free Software
|
16
|
+
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
17
|
+
|
18
|
+
module Groonga
|
19
|
+
class Table
|
20
|
+
def disk_usage
|
21
|
+
measurer = StatisticMeasurer.new
|
22
|
+
measurer.measure_disk_usage(path)
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
data/rroonga-build.rb
CHANGED
data/test/groonga-test-utils.rb
CHANGED
@@ -13,16 +13,16 @@
|
|
13
13
|
# License along with this library; if not, write to the Free Software
|
14
14
|
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
15
15
|
|
16
|
-
require
|
17
|
-
require
|
18
|
-
require
|
19
|
-
require
|
20
|
-
require
|
21
|
-
require
|
22
|
-
require
|
23
|
-
require
|
24
|
-
|
25
|
-
require
|
16
|
+
require "fileutils"
|
17
|
+
require "pathname"
|
18
|
+
require "tempfile"
|
19
|
+
require "time"
|
20
|
+
require "erb"
|
21
|
+
require "stringio"
|
22
|
+
require "json"
|
23
|
+
require "pkg-config"
|
24
|
+
|
25
|
+
require "groonga"
|
26
26
|
|
27
27
|
module GroongaTestUtils
|
28
28
|
class << self
|
data/test/test-column.rb
CHANGED
@@ -449,4 +449,30 @@ class ColumnTest < Test::Unit::TestCase
|
|
449
449
|
end
|
450
450
|
end
|
451
451
|
end
|
452
|
+
|
453
|
+
class DiskUsageTest < self
|
454
|
+
def setup
|
455
|
+
setup_database
|
456
|
+
|
457
|
+
Groonga::Schema.define do |schema|
|
458
|
+
schema.create_table("Users") do |table|
|
459
|
+
table.short_text("name")
|
460
|
+
table.int32("age")
|
461
|
+
end
|
462
|
+
end
|
463
|
+
|
464
|
+
@users_name_column = context["Users.name"]
|
465
|
+
@users_age_column = context["Users.age"]
|
466
|
+
end
|
467
|
+
|
468
|
+
def test_jagged_array
|
469
|
+
assert_equal(File.size(@users_name_column.path),
|
470
|
+
@users_name_column.disk_usage)
|
471
|
+
end
|
472
|
+
|
473
|
+
def test_rectangle_array
|
474
|
+
assert_equal(File.size(@users_age_column.path),
|
475
|
+
@users_age_column.disk_usage)
|
476
|
+
end
|
477
|
+
end
|
452
478
|
end
|
@@ -0,0 +1,676 @@
|
|
1
|
+
# Copyright (C) 2013 Kouhei Sutou <kou@clear-code.com>
|
2
|
+
#
|
3
|
+
# This library is free software; you can redistribute it and/or
|
4
|
+
# modify it under the terms of the GNU Lesser General Public
|
5
|
+
# License version 2.1 as published by the Free Software Foundation.
|
6
|
+
#
|
7
|
+
# This library is distributed in the hope that it will be useful,
|
8
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
9
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
10
|
+
# Lesser General Public License for more details.
|
11
|
+
#
|
12
|
+
# You should have received a copy of the GNU Lesser General Public
|
13
|
+
# License along with this library; if not, write to the Free Software
|
14
|
+
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
15
|
+
|
16
|
+
class DatabaseInspectorTest < Test::Unit::TestCase
|
17
|
+
include GroongaTestUtils
|
18
|
+
|
19
|
+
setup :setup_database, :before => :append
|
20
|
+
|
21
|
+
private
|
22
|
+
def report
|
23
|
+
output = StringIO.new
|
24
|
+
inspector = Groonga::DatabaseInspector.new(@database)
|
25
|
+
inspector.report(output)
|
26
|
+
output.string
|
27
|
+
end
|
28
|
+
|
29
|
+
def total_disk_usage
|
30
|
+
@database.tables.inject(@database.disk_usage) do |previous, table|
|
31
|
+
previous + total_table_disk_usage(table)
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
def total_table_disk_usage(table)
|
36
|
+
table.columns.inject(table.disk_usage) do |previous, column|
|
37
|
+
previous + column.disk_usage
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
def inspect_disk_usage(disk_usage)
|
42
|
+
if disk_usage < (2 ** 20)
|
43
|
+
"%.3fKiB" % (disk_usage / (2 ** 10).to_f)
|
44
|
+
else
|
45
|
+
"%.3fMiB" % (disk_usage / (2 ** 20).to_f)
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
def inspect_sub_disk_usage(disk_usage)
|
50
|
+
percent = disk_usage / total_disk_usage.to_f * 100
|
51
|
+
"%s (%.3f%%)" % [inspect_disk_usage(disk_usage), percent]
|
52
|
+
end
|
53
|
+
|
54
|
+
def inspect_table(table)
|
55
|
+
<<-INSPECTED
|
56
|
+
#{table.name}:
|
57
|
+
ID: #{table.id}
|
58
|
+
Type: #{inspect_table_type(table)}
|
59
|
+
Key type: #{inspect_key_type(table)}
|
60
|
+
Tokenizer: #{inspect_tokenizer(table)}
|
61
|
+
Normalizer: #{inspect_normalizer(table)}
|
62
|
+
Path: <#{table.path}>
|
63
|
+
Total disk usage: #{inspect_sub_disk_usage(total_table_disk_usage(table))}
|
64
|
+
Disk usage: #{inspect_sub_disk_usage(table.disk_usage)}
|
65
|
+
N records: #{table.size}
|
66
|
+
N columns: #{table.columns.size}
|
67
|
+
#{inspect_columns(table.columns).chomp}
|
68
|
+
INSPECTED
|
69
|
+
end
|
70
|
+
|
71
|
+
def inspect_table_type(table)
|
72
|
+
case table
|
73
|
+
when Groonga::Array
|
74
|
+
"array"
|
75
|
+
when Groonga::Hash
|
76
|
+
"hash"
|
77
|
+
when Groonga::PatriciaTrie
|
78
|
+
"patricia trie"
|
79
|
+
when Groonga::DoubleArrayTrie
|
80
|
+
"double array trie"
|
81
|
+
end
|
82
|
+
end
|
83
|
+
|
84
|
+
def inspect_key_type(table)
|
85
|
+
if table.support_key?
|
86
|
+
table.domain.name
|
87
|
+
else
|
88
|
+
"(no key)"
|
89
|
+
end
|
90
|
+
end
|
91
|
+
|
92
|
+
def inspect_tokenizer(table)
|
93
|
+
if table.support_key?
|
94
|
+
tokenizer = table.default_tokenizer
|
95
|
+
if tokenizer
|
96
|
+
tokenizer.name
|
97
|
+
else
|
98
|
+
"(no tokenizer)"
|
99
|
+
end
|
100
|
+
else
|
101
|
+
"(no key)"
|
102
|
+
end
|
103
|
+
end
|
104
|
+
|
105
|
+
def inspect_normalizer(table)
|
106
|
+
if table.support_key?
|
107
|
+
normalizer = table.normalizer
|
108
|
+
if normalizer
|
109
|
+
normalizer.name
|
110
|
+
else
|
111
|
+
"(no normalizer)"
|
112
|
+
end
|
113
|
+
else
|
114
|
+
"(no key)"
|
115
|
+
end
|
116
|
+
end
|
117
|
+
|
118
|
+
def inspect_columns(columns)
|
119
|
+
if columns.empty?
|
120
|
+
<<-INSPECTED
|
121
|
+
Columns:
|
122
|
+
None
|
123
|
+
INSPECTED
|
124
|
+
else
|
125
|
+
inspected = " Columns:\n"
|
126
|
+
columns.each do |column|
|
127
|
+
inspected << inspect_column(column)
|
128
|
+
end
|
129
|
+
inspected
|
130
|
+
end
|
131
|
+
end
|
132
|
+
|
133
|
+
def inspect_column(column)
|
134
|
+
<<-INSPECTED
|
135
|
+
#{column.local_name}:
|
136
|
+
ID: #{column.id}
|
137
|
+
Type: #{inspect_column_type(column)}
|
138
|
+
Value type: #{column.domain.name}
|
139
|
+
Path: <#{column.path}>
|
140
|
+
Disk usage: #{inspect_sub_disk_usage(column.disk_usage)}
|
141
|
+
INSPECTED
|
142
|
+
end
|
143
|
+
|
144
|
+
def inspect_column_type(column)
|
145
|
+
case column
|
146
|
+
when Groonga::FixSizeColumn
|
147
|
+
"scalar"
|
148
|
+
when Groonga::VariableSizeColumn
|
149
|
+
if column.vector?
|
150
|
+
"vector"
|
151
|
+
else
|
152
|
+
"scalar"
|
153
|
+
end
|
154
|
+
else
|
155
|
+
"index"
|
156
|
+
end
|
157
|
+
end
|
158
|
+
|
159
|
+
class DatabaseTest < self
|
160
|
+
def test_empty
|
161
|
+
assert_equal(<<-INSPECTED, report)
|
162
|
+
Database
|
163
|
+
Path: <#{@database_path}>
|
164
|
+
Total disk usage: #{inspect_disk_usage(total_disk_usage)}
|
165
|
+
Disk usage: #{inspect_sub_disk_usage(@database.disk_usage)}
|
166
|
+
N records: 0
|
167
|
+
N tables: 0
|
168
|
+
N columns: 0
|
169
|
+
Plugins:
|
170
|
+
None
|
171
|
+
Tables:
|
172
|
+
None
|
173
|
+
INSPECTED
|
174
|
+
end
|
175
|
+
|
176
|
+
class NRecordsTest < self
|
177
|
+
setup
|
178
|
+
def setup_tables
|
179
|
+
Groonga::Schema.define do |schema|
|
180
|
+
schema.create_table("Users") do |table|
|
181
|
+
end
|
182
|
+
|
183
|
+
schema.create_table("Bookmarks") do |table|
|
184
|
+
end
|
185
|
+
end
|
186
|
+
|
187
|
+
@users = context["Users"]
|
188
|
+
@bookmarks = context["Bookmarks"]
|
189
|
+
end
|
190
|
+
|
191
|
+
def test_no_records
|
192
|
+
assert_equal(inspected(0), report)
|
193
|
+
end
|
194
|
+
|
195
|
+
def test_has_records
|
196
|
+
@users.add
|
197
|
+
@users.add
|
198
|
+
@bookmarks.add
|
199
|
+
|
200
|
+
assert_equal(inspected(3), report)
|
201
|
+
end
|
202
|
+
|
203
|
+
private
|
204
|
+
def inspected(n_records)
|
205
|
+
<<-INSPECTED
|
206
|
+
Database
|
207
|
+
Path: <#{@database_path}>
|
208
|
+
Total disk usage: #{inspect_disk_usage(total_disk_usage)}
|
209
|
+
Disk usage: #{inspect_sub_disk_usage(@database.disk_usage)}
|
210
|
+
N records: #{n_records}
|
211
|
+
N tables: 2
|
212
|
+
N columns: 0
|
213
|
+
Plugins:
|
214
|
+
None
|
215
|
+
Tables:
|
216
|
+
#{inspect_table(@bookmarks).chomp}
|
217
|
+
#{inspect_table(@users).chomp}
|
218
|
+
INSPECTED
|
219
|
+
end
|
220
|
+
end
|
221
|
+
|
222
|
+
class NTablesTest < self
|
223
|
+
def test_no_tables
|
224
|
+
assert_equal(inspected(0), report)
|
225
|
+
end
|
226
|
+
|
227
|
+
def test_has_tables
|
228
|
+
Groonga::Schema.define do |schema|
|
229
|
+
schema.create_table("Users") do |table|
|
230
|
+
end
|
231
|
+
|
232
|
+
schema.create_table("Bookmarks") do |table|
|
233
|
+
end
|
234
|
+
end
|
235
|
+
|
236
|
+
assert_equal(inspected(2), report)
|
237
|
+
end
|
238
|
+
|
239
|
+
private
|
240
|
+
def inspected(n_tables)
|
241
|
+
inspected_tables = " Tables:\n"
|
242
|
+
if @database.tables.empty?
|
243
|
+
inspected_tables << " None\n"
|
244
|
+
else
|
245
|
+
@database.tables.each do |table|
|
246
|
+
inspected_tables << inspect_table(table)
|
247
|
+
end
|
248
|
+
end
|
249
|
+
|
250
|
+
<<-INSPECTED
|
251
|
+
Database
|
252
|
+
Path: <#{@database_path}>
|
253
|
+
Total disk usage: #{inspect_disk_usage(total_disk_usage)}
|
254
|
+
Disk usage: #{inspect_sub_disk_usage(@database.disk_usage)}
|
255
|
+
N records: 0
|
256
|
+
N tables: #{n_tables}
|
257
|
+
N columns: 0
|
258
|
+
Plugins:
|
259
|
+
None
|
260
|
+
#{inspected_tables.chomp}
|
261
|
+
INSPECTED
|
262
|
+
end
|
263
|
+
end
|
264
|
+
|
265
|
+
class NColumnsTest < self
|
266
|
+
setup
|
267
|
+
def setup_tables
|
268
|
+
Groonga::Schema.define do |schema|
|
269
|
+
schema.create_table("Users") do |table|
|
270
|
+
end
|
271
|
+
|
272
|
+
schema.create_table("Bookmarks") do |table|
|
273
|
+
end
|
274
|
+
end
|
275
|
+
|
276
|
+
@users = context["Users"]
|
277
|
+
@bookmarks = context["Bookmarks"]
|
278
|
+
end
|
279
|
+
|
280
|
+
def test_no_columns
|
281
|
+
assert_equal(inspected(0), report)
|
282
|
+
end
|
283
|
+
|
284
|
+
def test_has_columns
|
285
|
+
Groonga::Schema.define do |schema|
|
286
|
+
schema.create_table("Users") do |table|
|
287
|
+
table.short_text("name")
|
288
|
+
table.int8("age")
|
289
|
+
end
|
290
|
+
|
291
|
+
schema.create_table("Bookmarks") do |table|
|
292
|
+
table.text("description")
|
293
|
+
end
|
294
|
+
end
|
295
|
+
|
296
|
+
assert_equal(inspected(3), report)
|
297
|
+
end
|
298
|
+
|
299
|
+
private
|
300
|
+
def inspected(n_columns)
|
301
|
+
<<-INSPECTED
|
302
|
+
Database
|
303
|
+
Path: <#{@database_path}>
|
304
|
+
Total disk usage: #{inspect_disk_usage(total_disk_usage)}
|
305
|
+
Disk usage: #{inspect_sub_disk_usage(@database.disk_usage)}
|
306
|
+
N records: 0
|
307
|
+
N tables: 2
|
308
|
+
N columns: #{n_columns}
|
309
|
+
Plugins:
|
310
|
+
None
|
311
|
+
Tables:
|
312
|
+
#{inspect_table(@bookmarks).chomp}
|
313
|
+
#{inspect_table(@users).chomp}
|
314
|
+
INSPECTED
|
315
|
+
end
|
316
|
+
end
|
317
|
+
|
318
|
+
class PluginsTest < self
|
319
|
+
def test_no_plugins
|
320
|
+
assert_equal(inspected(<<-INSPECTED), report)
|
321
|
+
Plugins:
|
322
|
+
None
|
323
|
+
INSPECTED
|
324
|
+
end
|
325
|
+
|
326
|
+
def test_has_plugin
|
327
|
+
context.register_plugin("query_expanders/tsv")
|
328
|
+
assert_equal(inspected(<<-INSPECTED), report)
|
329
|
+
Plugins:
|
330
|
+
* query_expanders/tsv#{Groonga::Plugin.suffix}
|
331
|
+
INSPECTED
|
332
|
+
end
|
333
|
+
|
334
|
+
private
|
335
|
+
def inspected(inspected_plugins)
|
336
|
+
<<-INSPECTED
|
337
|
+
Database
|
338
|
+
Path: <#{@database_path}>
|
339
|
+
Total disk usage: #{inspect_disk_usage(total_disk_usage)}
|
340
|
+
Disk usage: #{inspect_sub_disk_usage(@database.disk_usage)}
|
341
|
+
N records: 0
|
342
|
+
N tables: 0
|
343
|
+
N columns: 0
|
344
|
+
#{inspected_plugins.chomp}
|
345
|
+
Tables:
|
346
|
+
None
|
347
|
+
INSPECTED
|
348
|
+
end
|
349
|
+
end
|
350
|
+
end
|
351
|
+
|
352
|
+
class TableTest < self
|
353
|
+
private
|
354
|
+
def report
|
355
|
+
output = StringIO.new
|
356
|
+
reporter = Groonga::DatabaseInspector::Reporter.new(@database, output)
|
357
|
+
reporter.send(:report_table, @table)
|
358
|
+
output.string
|
359
|
+
end
|
360
|
+
|
361
|
+
def inspect_columns(table)
|
362
|
+
super.gsub(/^ /, "")
|
363
|
+
end
|
364
|
+
|
365
|
+
class NRecordsTest < self
|
366
|
+
setup
|
367
|
+
def setup_tables
|
368
|
+
Groonga::Schema.define do |schema|
|
369
|
+
schema.create_table("Users") do |table|
|
370
|
+
end
|
371
|
+
end
|
372
|
+
@table = context["Users"]
|
373
|
+
end
|
374
|
+
|
375
|
+
def test_no_record
|
376
|
+
assert_equal(inspected(0), report)
|
377
|
+
end
|
378
|
+
|
379
|
+
def test_empty
|
380
|
+
@table.add
|
381
|
+
@table.add
|
382
|
+
@table.add
|
383
|
+
|
384
|
+
assert_equal(inspected(3), report)
|
385
|
+
end
|
386
|
+
|
387
|
+
private
|
388
|
+
def inspected(n_records)
|
389
|
+
<<-INSPECTED
|
390
|
+
#{@table.name}:
|
391
|
+
ID: #{@table.id}
|
392
|
+
Type: #{inspect_table_type(@table)}
|
393
|
+
Key type: #{inspect_key_type(@table)}
|
394
|
+
Tokenizer: #{inspect_tokenizer(@table)}
|
395
|
+
Normalizer: #{inspect_normalizer(@table)}
|
396
|
+
Path: <#{@table.path}>
|
397
|
+
Total disk usage: #{inspect_sub_disk_usage(total_table_disk_usage(@table))}
|
398
|
+
Disk usage: #{inspect_sub_disk_usage(@table.disk_usage)}
|
399
|
+
N records: #{n_records}
|
400
|
+
N columns: #{@table.columns.size}
|
401
|
+
#{inspect_columns(@table.columns).chomp}
|
402
|
+
INSPECTED
|
403
|
+
end
|
404
|
+
end
|
405
|
+
|
406
|
+
class TypeTest < self
|
407
|
+
def test_array
|
408
|
+
Groonga::Schema.create_table("Users")
|
409
|
+
@table = Groonga["Users"]
|
410
|
+
assert_equal(inspected("array"), report)
|
411
|
+
end
|
412
|
+
|
413
|
+
def test_hash
|
414
|
+
Groonga::Schema.create_table("Users",
|
415
|
+
:type => :hash,
|
416
|
+
:key_type => :short_text)
|
417
|
+
@table = Groonga["Users"]
|
418
|
+
assert_equal(inspected("hash"), report)
|
419
|
+
end
|
420
|
+
|
421
|
+
def test_patricia_trie
|
422
|
+
Groonga::Schema.create_table("Users",
|
423
|
+
:type => :patricia_trie,
|
424
|
+
:key_type => :short_text)
|
425
|
+
@table = Groonga["Users"]
|
426
|
+
assert_equal(inspected("patricia trie"), report)
|
427
|
+
end
|
428
|
+
|
429
|
+
def test_double_array_trie
|
430
|
+
Groonga::Schema.create_table("Users",
|
431
|
+
:type => :double_array_trie,
|
432
|
+
:key_type => :short_text)
|
433
|
+
@table = Groonga["Users"]
|
434
|
+
assert_equal(inspected("double array trie"), report)
|
435
|
+
end
|
436
|
+
|
437
|
+
private
|
438
|
+
def inspected(type)
|
439
|
+
<<-INSPECTED
|
440
|
+
#{@table.name}:
|
441
|
+
ID: #{@table.id}
|
442
|
+
Type: #{type}
|
443
|
+
Key type: #{inspect_key_type(@table)}
|
444
|
+
Tokenizer: #{inspect_tokenizer(@table)}
|
445
|
+
Normalizer: #{inspect_normalizer(@table)}
|
446
|
+
Path: <#{@table.path}>
|
447
|
+
Total disk usage: #{inspect_sub_disk_usage(total_table_disk_usage(@table))}
|
448
|
+
Disk usage: #{inspect_sub_disk_usage(@table.disk_usage)}
|
449
|
+
N records: #{@table.size}
|
450
|
+
N columns: #{@table.columns.size}
|
451
|
+
#{inspect_columns(@table.columns).chomp}
|
452
|
+
INSPECTED
|
453
|
+
end
|
454
|
+
end
|
455
|
+
|
456
|
+
class KeyTypeTest < self
|
457
|
+
def test_array
|
458
|
+
Groonga::Schema.create_table("Users")
|
459
|
+
@table = Groonga["Users"]
|
460
|
+
assert_equal(inspected("(no key)"), report)
|
461
|
+
end
|
462
|
+
|
463
|
+
def test_key_support_table
|
464
|
+
Groonga::Schema.create_table("Users",
|
465
|
+
:type => :hash,
|
466
|
+
:key_type => "Int32")
|
467
|
+
@table = Groonga["Users"]
|
468
|
+
assert_equal(inspected("Int32"), report)
|
469
|
+
end
|
470
|
+
|
471
|
+
private
|
472
|
+
def inspected(key_type)
|
473
|
+
<<-INSPECTED
|
474
|
+
#{@table.name}:
|
475
|
+
ID: #{@table.id}
|
476
|
+
Type: #{inspect_table_type(@table)}
|
477
|
+
Key type: #{key_type}
|
478
|
+
Tokenizer: #{inspect_tokenizer(@table)}
|
479
|
+
Normalizer: #{inspect_normalizer(@table)}
|
480
|
+
Path: <#{@table.path}>
|
481
|
+
Total disk usage: #{inspect_sub_disk_usage(total_table_disk_usage(@table))}
|
482
|
+
Disk usage: #{inspect_sub_disk_usage(@table.disk_usage)}
|
483
|
+
N records: #{@table.size}
|
484
|
+
N columns: #{@table.columns.size}
|
485
|
+
#{inspect_columns(@table.columns).chomp}
|
486
|
+
INSPECTED
|
487
|
+
end
|
488
|
+
end
|
489
|
+
|
490
|
+
class TokenizerTest < self
|
491
|
+
def test_array
|
492
|
+
Groonga::Schema.create_table("Users")
|
493
|
+
@table = Groonga["Users"]
|
494
|
+
assert_equal(inspected("(no key)"), report)
|
495
|
+
end
|
496
|
+
|
497
|
+
def test_no_tokenizer
|
498
|
+
Groonga::Schema.create_table("Users",
|
499
|
+
:type => :hash,
|
500
|
+
:key_type => :short_text)
|
501
|
+
@table = Groonga["Users"]
|
502
|
+
assert_equal(inspected("(no tokenizer)"), report)
|
503
|
+
end
|
504
|
+
|
505
|
+
def test_have_tokenizer
|
506
|
+
Groonga::Schema.create_table("Users",
|
507
|
+
:type => :patricia_trie,
|
508
|
+
:key_type => :short_text,
|
509
|
+
:default_tokenizer => "TokenBigram")
|
510
|
+
@table = Groonga["Users"]
|
511
|
+
assert_equal(inspected("TokenBigram"), report)
|
512
|
+
end
|
513
|
+
|
514
|
+
private
|
515
|
+
def inspected(inspected_tokenizer)
|
516
|
+
<<-INSPECTED
|
517
|
+
#{@table.name}:
|
518
|
+
ID: #{@table.id}
|
519
|
+
Type: #{inspect_table_type(@table)}
|
520
|
+
Key type: #{inspect_key_type(@table)}
|
521
|
+
Tokenizer: #{inspected_tokenizer}
|
522
|
+
Normalizer: #{inspect_normalizer(@table)}
|
523
|
+
Path: <#{@table.path}>
|
524
|
+
Total disk usage: #{inspect_sub_disk_usage(total_table_disk_usage(@table))}
|
525
|
+
Disk usage: #{inspect_sub_disk_usage(@table.disk_usage)}
|
526
|
+
N records: #{@table.size}
|
527
|
+
N columns: #{@table.columns.size}
|
528
|
+
#{inspect_columns(@table.columns).chomp}
|
529
|
+
INSPECTED
|
530
|
+
end
|
531
|
+
end
|
532
|
+
|
533
|
+
class NormalizerTest < self
|
534
|
+
def test_array
|
535
|
+
Groonga::Schema.create_table("Users")
|
536
|
+
@table = Groonga["Users"]
|
537
|
+
assert_equal(inspected("(no key)"), report)
|
538
|
+
end
|
539
|
+
|
540
|
+
def test_no_normalizer
|
541
|
+
Groonga::Schema.create_table("Users",
|
542
|
+
:type => :hash,
|
543
|
+
:key_type => :short_text)
|
544
|
+
@table = Groonga["Users"]
|
545
|
+
assert_equal(inspected("(no normalizer)"), report)
|
546
|
+
end
|
547
|
+
|
548
|
+
def test_have_normalizer
|
549
|
+
Groonga::Schema.create_table("Users",
|
550
|
+
:type => :patricia_trie,
|
551
|
+
:key_type => :short_text,
|
552
|
+
:normalizer => "NormalizerAuto")
|
553
|
+
@table = Groonga["Users"]
|
554
|
+
assert_equal(inspected("NormalizerAuto"), report)
|
555
|
+
end
|
556
|
+
|
557
|
+
private
|
558
|
+
def inspected(inspected_normalizer)
|
559
|
+
<<-INSPECTED
|
560
|
+
#{@table.name}:
|
561
|
+
ID: #{@table.id}
|
562
|
+
Type: #{inspect_table_type(@table)}
|
563
|
+
Key type: #{inspect_key_type(@table)}
|
564
|
+
Tokenizer: #{inspect_tokenizer(@table)}
|
565
|
+
Normalizer: #{inspected_normalizer}
|
566
|
+
Path: <#{@table.path}>
|
567
|
+
Total disk usage: #{inspect_sub_disk_usage(total_table_disk_usage(@table))}
|
568
|
+
Disk usage: #{inspect_sub_disk_usage(@table.disk_usage)}
|
569
|
+
N records: #{@table.size}
|
570
|
+
N columns: #{@table.columns.size}
|
571
|
+
#{inspect_columns(@table.columns).chomp}
|
572
|
+
INSPECTED
|
573
|
+
end
|
574
|
+
end
|
575
|
+
|
576
|
+
class NColumnsTest < self
|
577
|
+
def test_no_columns
|
578
|
+
Groonga::Schema.create_table("Users")
|
579
|
+
@table = Groonga["Users"]
|
580
|
+
assert_equal(inspected(0), report)
|
581
|
+
end
|
582
|
+
|
583
|
+
def test_have_columns
|
584
|
+
Groonga::Schema.create_table("Users") do |table|
|
585
|
+
table.short_text("name")
|
586
|
+
table.int8("age")
|
587
|
+
end
|
588
|
+
@table = Groonga["Users"]
|
589
|
+
assert_equal(inspected(2), report)
|
590
|
+
end
|
591
|
+
|
592
|
+
private
|
593
|
+
def inspected(n_columns)
|
594
|
+
<<-INSPECTED
|
595
|
+
#{@table.name}:
|
596
|
+
ID: #{@table.id}
|
597
|
+
Type: #{inspect_table_type(@table)}
|
598
|
+
Key type: #{inspect_key_type(@table)}
|
599
|
+
Tokenizer: #{inspect_tokenizer(@table)}
|
600
|
+
Normalizer: #{inspect_normalizer(@table)}
|
601
|
+
Path: <#{@table.path}>
|
602
|
+
Total disk usage: #{inspect_sub_disk_usage(total_table_disk_usage(@table))}
|
603
|
+
Disk usage: #{inspect_sub_disk_usage(@table.disk_usage)}
|
604
|
+
N records: #{@table.size}
|
605
|
+
N columns: #{n_columns}
|
606
|
+
#{inspect_columns(@table.columns).chomp}
|
607
|
+
INSPECTED
|
608
|
+
end
|
609
|
+
end
|
610
|
+
end
|
611
|
+
|
612
|
+
class ColumnTest < self
|
613
|
+
private
|
614
|
+
def report
|
615
|
+
output = StringIO.new
|
616
|
+
reporter = Groonga::DatabaseInspector::Reporter.new(@database, output)
|
617
|
+
reporter.send(:report_column, @column)
|
618
|
+
output.string
|
619
|
+
end
|
620
|
+
|
621
|
+
class TypeTest < self
|
622
|
+
def test_scalar_fix_size
|
623
|
+
create_table do |table|
|
624
|
+
table.int32("age")
|
625
|
+
end
|
626
|
+
assert_equal(inspected("scalar"), report)
|
627
|
+
end
|
628
|
+
|
629
|
+
def test_scalar_variable_size
|
630
|
+
create_table do |table|
|
631
|
+
table.short_text("name")
|
632
|
+
end
|
633
|
+
assert_equal(inspected("scalar"), report)
|
634
|
+
end
|
635
|
+
|
636
|
+
def test_vector
|
637
|
+
create_table do |table|
|
638
|
+
table.short_text("tags", :type => :vector)
|
639
|
+
end
|
640
|
+
assert_equal(inspected("vector"), report)
|
641
|
+
end
|
642
|
+
|
643
|
+
def test_index
|
644
|
+
create_table do |table|
|
645
|
+
end
|
646
|
+
Groonga::Schema.create_table("Bookmarks") do |table|
|
647
|
+
table.reference("user", "Users")
|
648
|
+
end
|
649
|
+
create_table do |table|
|
650
|
+
table.index("Bookmarks.user")
|
651
|
+
end
|
652
|
+
assert_equal(inspected("index"), report)
|
653
|
+
end
|
654
|
+
|
655
|
+
private
|
656
|
+
def create_table
|
657
|
+
Groonga::Schema.create_table("Users") do |table|
|
658
|
+
yield(table)
|
659
|
+
end
|
660
|
+
@table = Groonga["Users"]
|
661
|
+
@column = @table.columns.first
|
662
|
+
end
|
663
|
+
|
664
|
+
def inspected(type)
|
665
|
+
<<-INSPECTED
|
666
|
+
#{@column.local_name}:
|
667
|
+
ID: #{@column.id}
|
668
|
+
Type: #{type}
|
669
|
+
Value type: #{@column.domain.name}
|
670
|
+
Path: <#{@column.path}>
|
671
|
+
Disk usage: #{inspect_sub_disk_usage(@column.disk_usage)}
|
672
|
+
INSPECTED
|
673
|
+
end
|
674
|
+
end
|
675
|
+
end
|
676
|
+
end
|