fluent-plugin-droonga 0.8.0 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/Gemfile +7 -0
- data/benchmark/watch/benchmark-notify.rb +6 -6
- data/benchmark/watch/benchmark-notify.sh +3 -2
- data/bin/grn2jsons +0 -3
- data/doc/text/news.md +13 -0
- data/fluent-plugin-droonga.gemspec +1 -1
- data/lib/droonga/catalog/base.rb +8 -3
- data/lib/droonga/catalog.rb +1 -16
- data/lib/droonga/catalog_observer.rb +57 -0
- data/lib/droonga/collector.rb +1 -1
- data/lib/droonga/dispatcher.rb +3 -1
- data/lib/droonga/distributor_plugin.rb +47 -19
- data/lib/droonga/handler_messenger.rb +26 -2
- data/lib/droonga/message_processing_error.rb +6 -8
- data/lib/droonga/output_message.rb +17 -1
- data/lib/droonga/plugin/collector/basic.rb +44 -81
- data/lib/droonga/plugin/collector/groonga.rb +83 -0
- data/lib/droonga/plugin/collector/search.rb +104 -0
- data/lib/droonga/plugin/distributor/crud.rb +41 -0
- data/lib/droonga/plugin/distributor/distributed_search_planner.rb +4 -4
- data/lib/droonga/plugin/distributor/groonga.rb +38 -0
- data/lib/droonga/plugin/handler/add.rb +4 -1
- data/lib/droonga/plugin/handler/groonga/column_create.rb +7 -0
- data/lib/droonga/plugin/handler/groonga/table_remove.rb +42 -0
- data/lib/droonga/plugin/handler/groonga.rb +17 -2
- data/lib/droonga/plugin/handler/watch.rb +4 -4
- data/lib/droonga/plugin/input_adapter/crud.rb +27 -0
- data/lib/droonga/plugin/input_adapter/groonga.rb +16 -1
- data/lib/droonga/plugin/output_adapter/crud.rb +51 -0
- data/lib/droonga/plugin/output_adapter/groonga.rb +8 -1
- data/lib/droonga/plugin.rb +1 -1
- data/lib/droonga/replier.rb +7 -1
- data/lib/droonga/searcher.rb +168 -74
- data/lib/droonga/session.rb +1 -1
- data/lib/groonga_command_converter.rb +7 -1
- data/test/command/config/default/catalog.json +1 -1
- data/test/command/suite/add/error/invalid-integer.expected +31 -1
- data/test/command/suite/add/error/invalid-time.expected +31 -1
- data/test/command/suite/add/error/missing-key.expected +17 -1
- data/test/command/suite/add/error/missing-table.expected +17 -1
- data/test/command/suite/add/error/unknown-column.expected +31 -1
- data/test/command/suite/add/error/unknown-table.expected +17 -1
- data/test/command/suite/add/minimum.expected +1 -1
- data/test/command/suite/add/with-values.expected +1 -1
- data/test/command/suite/add/without-key.expected +1 -1
- data/test/command/suite/groonga/column_create/scalar.expected +2 -2
- data/test/command/suite/groonga/column_create/unknown-table.expected +18 -0
- data/test/command/suite/groonga/column_create/unknown-table.test +7 -0
- data/test/command/suite/groonga/column_create/vector.expected +2 -2
- data/test/command/suite/groonga/select/minimum.expected +1 -1
- data/test/command/suite/groonga/table_create/array.expected +1 -1
- data/test/command/suite/groonga/table_create/hash.expected +1 -1
- data/test/command/suite/groonga/table_remove/success.expected +17 -0
- data/test/command/suite/groonga/table_remove/success.test +8 -0
- data/test/command/suite/groonga/table_remove/unknown-table.expected +18 -0
- data/test/command/suite/groonga/table_remove/unknown-table.test +7 -0
- data/test/command/suite/message/error/missing-dataset.expected +1 -1
- data/test/command/suite/message/error/unknown-command.expected +1 -1
- data/test/command/suite/message/error/unknown-dataset.expected +1 -1
- data/test/command/suite/search/attributes/array.expected +1 -1
- data/test/command/suite/search/attributes/hash.expected +1 -1
- data/test/command/suite/search/complex.expected +1 -1
- data/test/command/suite/search/condition/nested.expected +1 -1
- data/test/command/suite/search/condition/query.expected +1 -1
- data/test/command/suite/search/condition/script.expected +1 -1
- data/test/command/suite/search/error/cyclic-source.expected +1 -1
- data/test/command/suite/search/error/deeply-cyclic-source.expected +1 -1
- data/test/command/suite/search/error/missing-source-parameter.expected +1 -1
- data/test/command/suite/search/error/unknown-source.expected +1 -1
- data/test/command/suite/search/group/count.expected +1 -1
- data/test/command/suite/search/group/limit.expected +1 -1
- data/test/command/suite/search/group/string.expected +1 -1
- data/test/command/suite/search/multiple/chained.expected +1 -1
- data/test/command/suite/search/multiple/parallel.expected +1 -1
- data/test/command/suite/search/range/only-output.expected +1 -1
- data/test/command/suite/search/range/only-sort.expected +1 -1
- data/test/command/suite/search/range/sort-and-output.expected +1 -1
- data/test/command/suite/search/range/too-large-output-offset.expected +1 -1
- data/test/command/suite/search/range/too-large-sort-offset.expected +1 -1
- data/test/command/suite/search/response/records/value/time.expected +1 -1
- data/test/command/suite/search/simple.expected +1 -1
- data/test/command/suite/search/sort/default-offset-limit.expected +1 -1
- data/test/command/suite/search/sort/invisible-column.expected +1 -1
- data/test/command/suite/watch/subscribe.expected +1 -1
- data/test/command/suite/watch/unsubscribe.expected +1 -1
- data/test/performance/run-test.rb +56 -0
- data/{benchmark → test/performance}/watch/catalog.json +0 -0
- data/test/performance/watch/feed.json +9 -0
- data/{benchmark → test/performance}/watch/fluentd.conf +0 -0
- data/test/performance/watch/subscribe.json +3 -0
- data/test/unit/catalog/test_version1.rb +34 -0
- data/test/unit/plugin/collector/test_basic.rb +300 -479
- data/test/unit/plugin/collector/test_search.rb +814 -0
- data/test/unit/plugin/distributor/test_search.rb +4 -4
- data/test/unit/plugin/distributor/test_search_planner.rb +260 -260
- data/test/unit/plugin/handler/groonga/test_column_create.rb +15 -1
- data/test/unit/plugin/handler/groonga/test_table_create.rb +6 -2
- data/test/unit/plugin/handler/groonga/test_table_remove.rb +58 -0
- data/test/unit/plugin/handler/test_add.rb +3 -1
- data/test/unit/plugin/handler/test_groonga.rb +24 -0
- data/test/unit/plugin/handler/test_search.rb +294 -0
- data/test/unit/plugin/handler/test_watch.rb +1 -1
- data/test/unit/plugin/{adapter → input_adapter}/groonga/test_select.rb +5 -37
- data/test/unit/plugin/output_adapter/groonga/test_select.rb +55 -0
- metadata +38 -6
@@ -0,0 +1,56 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
#
|
3
|
+
# Copyright (C) 2014 Droonga Project
|
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
|
+
require "rbconfig"
|
19
|
+
require "fileutils"
|
20
|
+
|
21
|
+
def run(*command_line)
|
22
|
+
command_line = command_line.collect do |argument|
|
23
|
+
argument.to_s
|
24
|
+
end
|
25
|
+
return if system(*command_line)
|
26
|
+
puts("failed to run: #{command_line.join(' ')}")
|
27
|
+
exit(false)
|
28
|
+
end
|
29
|
+
|
30
|
+
base_dir = File.dirname(__FILE__)
|
31
|
+
lib_dir = File.expand_path(File.join(base_dir, "..", "..", "lib"))
|
32
|
+
|
33
|
+
drnbench_options = []
|
34
|
+
drnbench_options.concat(["--start-n-subscribers", 10])
|
35
|
+
drnbench_options.concat(["--n-publishings", 10])
|
36
|
+
drnbench_options.concat(["--n-steps", 9])
|
37
|
+
drnbench_options.concat(["--timeout", 5])
|
38
|
+
drnbench_options.concat(["--subscribe-request-file",
|
39
|
+
File.join(base_dir, "watch", "subscribe.json")])
|
40
|
+
drnbench_options.concat(["--feed-file",
|
41
|
+
File.join(base_dir, "watch", "feed.json")])
|
42
|
+
|
43
|
+
protocol_adapter_dir = File.join(base_dir, "..", "..", "..", "express-droonga")
|
44
|
+
if File.exist?(protocol_adapter_dir)
|
45
|
+
drnbench_options.concat(["--protocol-adapter-application-dir", protocol_adapter_dir])
|
46
|
+
drnbench_options.concat(["--protocol-adapter-port", 13000])
|
47
|
+
end
|
48
|
+
|
49
|
+
drnbench_options.concat(["--engine-config-path",
|
50
|
+
File.join(base_dir, "watch")])
|
51
|
+
drnbench_options.concat(["--fluentd-options", "-I#{lib_dir}"])
|
52
|
+
drnbench_options.concat(ARGV)
|
53
|
+
|
54
|
+
drnbench_publish_subscribe = Gem.bin_path("drnbench",
|
55
|
+
"drnbench-publish-subscribe")
|
56
|
+
run(drnbench_publish_subscribe, *drnbench_options)
|
File without changes
|
File without changes
|
@@ -64,4 +64,38 @@ class CatalogTest < Test::Unit::TestCase
|
|
64
64
|
def base_path
|
65
65
|
File.dirname(catalog_path)
|
66
66
|
end
|
67
|
+
|
68
|
+
class DataSetTest < self
|
69
|
+
class RingTest < self
|
70
|
+
class TotalWeightTest < self
|
71
|
+
def setup
|
72
|
+
end
|
73
|
+
|
74
|
+
def test_three_zones
|
75
|
+
dataset = {
|
76
|
+
"ring" => {
|
77
|
+
"zone1" => {
|
78
|
+
"weight" => 10,
|
79
|
+
},
|
80
|
+
"zone2" => {
|
81
|
+
"weight" => 20,
|
82
|
+
},
|
83
|
+
"zone3" => {
|
84
|
+
"weight" => 30,
|
85
|
+
},
|
86
|
+
}
|
87
|
+
}
|
88
|
+
assert_equal(10 + 20 + 30,
|
89
|
+
total_weight(dataset))
|
90
|
+
end
|
91
|
+
|
92
|
+
private
|
93
|
+
def total_weight(dataset)
|
94
|
+
catalog = Droonga::Catalog::Version1.new({"datasets" => []},
|
95
|
+
"base-path")
|
96
|
+
catalog.send(:compute_total_weight, dataset)
|
97
|
+
end
|
98
|
+
end
|
99
|
+
end
|
100
|
+
end
|
67
101
|
end
|