fluent-plugin-droonga 0.0.2 → 0.7.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 +6 -0
- data/.yardopts +7 -0
- data/Gemfile +14 -2
- data/LICENSE.txt +1 -1
- data/README.md +1 -1
- data/Rakefile +27 -5
- data/benchmark/benchmark.rb +1 -1
- data/benchmark/utils.rb +9 -6
- data/benchmark/watch/benchmark-notify.rb +2 -2
- data/benchmark/watch/benchmark-publish.rb +1 -1
- data/benchmark/watch/benchmark-scan.rb +1 -1
- data/benchmark/watch/catalog.json +1 -1
- data/bin/grn2jsons +1 -1
- data/fluent-plugin-droonga.gemspec +5 -3
- data/lib/droonga/adapter.rb +13 -130
- data/lib/droonga/adapter_plugin.rb +51 -0
- data/lib/droonga/catalog.rb +2 -2
- data/lib/droonga/collector.rb +107 -0
- data/lib/droonga/collector_plugin.rb +82 -0
- data/lib/droonga/command_mapper.rb +1 -1
- data/lib/droonga/{proxy.rb → dispatcher.rb} +116 -151
- data/lib/droonga/distributor.rb +51 -0
- data/lib/droonga/distributor_plugin.rb +59 -0
- data/lib/droonga/engine.rb +9 -50
- data/lib/droonga/farm.rb +47 -0
- data/lib/droonga/forwarder.rb +125 -0
- data/lib/droonga/handler.rb +69 -60
- data/lib/droonga/handler_plugin.rb +22 -11
- data/lib/droonga/input_message.rb +51 -0
- data/lib/droonga/job_queue.rb +5 -1
- data/lib/droonga/job_queue_schema.rb +1 -1
- data/lib/droonga/logger.rb +1 -1
- data/lib/droonga/partition.rb +76 -0
- data/lib/droonga/pluggable.rb +62 -0
- data/lib/droonga/plugin.rb +18 -16
- data/lib/droonga/plugin/{adapter_groonga.rb → adapter/groonga.rb} +10 -10
- data/lib/droonga/plugin/adapter/groonga/select.rb +13 -4
- data/lib/droonga/plugin/collector/basic.rb +142 -0
- data/lib/droonga/plugin/distributor/crud.rb +43 -0
- data/lib/droonga/plugin/distributor/groonga.rb +37 -0
- data/lib/droonga/plugin/distributor/search.rb +273 -0
- data/lib/droonga/plugin/distributor/watch.rb +39 -0
- data/lib/droonga/plugin/{handler_add.rb → handler/add.rb} +6 -6
- data/lib/droonga/plugin/{handler_forward.rb → handler/forward.rb} +9 -4
- data/lib/droonga/plugin/{handler_groonga.rb → handler/groonga.rb} +36 -4
- data/lib/droonga/plugin/handler/groonga/column_create.rb +5 -9
- data/lib/droonga/plugin/handler/groonga/table_create.rb +9 -18
- data/lib/droonga/plugin/{handler_search.rb → handler/search.rb} +4 -4
- data/lib/droonga/plugin/{handler_watch.rb → handler/watch.rb} +4 -4
- data/lib/droonga/plugin_loader.rb +45 -0
- data/lib/droonga/plugin_registerable.rb +51 -0
- data/lib/droonga/plugin_repository.rb +56 -0
- data/lib/droonga/processor.rb +64 -0
- data/lib/droonga/searcher.rb +16 -7
- data/lib/droonga/server.rb +5 -9
- data/lib/droonga/sweeper.rb +1 -1
- data/lib/droonga/watch_schema.rb +1 -1
- data/lib/droonga/watcher.rb +1 -1
- data/lib/droonga/worker.rb +21 -9
- data/lib/fluent/plugin/out_droonga.rb +33 -15
- data/lib/groonga_command_converter.rb +1 -1
- data/sample/cluster/fluentd.conf +0 -1
- data/test/command/config/default/catalog.json +43 -0
- data/test/command/config/default/fluentd.conf +11 -0
- data/test/command/fixture/documents.jsons +208 -0
- data/test/command/fixture/user-table-array.jsons +38 -0
- data/test/command/fixture/user-table.jsons +38 -0
- data/test/command/run-test.rb +35 -0
- data/test/command/suite/add/minimum.expected +12 -0
- data/test/command/suite/add/minimum.test +11 -0
- data/test/command/suite/add/with-values.expected +12 -0
- data/test/command/suite/add/with-values.test +17 -0
- data/test/command/suite/add/without-key.expected +12 -0
- data/test/command/suite/add/without-key.test +16 -0
- data/test/command/suite/groonga/column_create/scalar.expected +34 -0
- data/test/command/suite/groonga/column_create/scalar.test +17 -0
- data/test/command/suite/groonga/column_create/vector.expected +34 -0
- data/test/command/suite/groonga/column_create/vector.test +18 -0
- data/test/command/suite/groonga/select/minimum.expected +26 -0
- data/test/command/suite/groonga/select/minimum.test +8 -0
- data/test/command/suite/groonga/table_create/array.expected +17 -0
- data/test/command/suite/groonga/table_create/array.test +8 -0
- data/test/command/suite/groonga/table_create/hash.expected +17 -0
- data/test/command/suite/groonga/table_create/hash.test +8 -0
- data/test/command/suite/search/array-attribute-label.expected +25 -0
- data/test/command/suite/search/array-attribute-label.test +30 -0
- data/test/command/suite/search/chained-queries.expected +45 -0
- data/test/command/suite/search/chained-queries.test +43 -0
- data/test/command/suite/search/complex.expected +52 -0
- data/test/command/suite/search/complex.test +25 -0
- data/test/command/suite/search/condition-nested.expected +19 -0
- data/test/command/suite/search/condition-nested.test +29 -0
- data/test/command/suite/search/condition-query.expected +28 -0
- data/test/command/suite/search/condition-query.test +25 -0
- data/test/command/suite/search/condition-script.expected +28 -0
- data/test/command/suite/search/condition-script.test +28 -0
- data/test/command/suite/search/hash-attribute-label.expected +34 -0
- data/test/command/suite/search/hash-attribute-label.test +38 -0
- data/test/command/suite/search/minimum.expected +13 -0
- data/test/command/suite/search/minimum.test +16 -0
- data/test/command/suite/search/multiple-queries.expected +39 -0
- data/test/command/suite/search/multiple-queries.test +39 -0
- data/test/command/suite/search/output-range.expected +28 -0
- data/test/command/suite/search/output-range.test +25 -0
- data/test/command/suite/search/simple.expected +52 -0
- data/test/command/suite/search/simple.test +24 -0
- data/test/command/suite/search/sort-and-output-range.expected +25 -0
- data/test/command/suite/search/sort-and-output-range.test +29 -0
- data/test/command/suite/search/sort-range.expected +28 -0
- data/test/command/suite/search/sort-range.test +28 -0
- data/test/command/suite/search/sort-with-invisible-column.expected +28 -0
- data/test/command/suite/search/sort-with-invisible-column.test +28 -0
- data/test/unit/fixtures/array.grn +18 -0
- data/test/{fixtures → unit/fixtures}/catalog.json +0 -0
- data/test/{fixtures → unit/fixtures}/document.grn +20 -9
- data/test/unit/fixtures/reference/array.grn +11 -0
- data/test/unit/fixtures/reference/hash.grn +7 -0
- data/test/{helper.rb → unit/helper.rb} +2 -1
- data/test/{helper → unit/helper}/fixture.rb +1 -1
- data/test/unit/helper/plugin_helper.rb +38 -0
- data/test/{helper → unit/helper}/sandbox.rb +19 -6
- data/test/{helper → unit/helper}/stub_worker.rb +1 -1
- data/test/{helper → unit/helper}/watch_helper.rb +1 -13
- data/test/{plugin → unit/plugin}/adapter/groonga/test_select.rb +108 -4
- data/test/unit/plugin/collector/test_basic.rb +558 -0
- data/test/unit/plugin/distributor/test_search.rb +914 -0
- data/test/{plugin → unit/plugin}/handler/groonga/test_column_create.rb +18 -14
- data/test/{plugin → unit/plugin}/handler/groonga/test_table_create.rb +13 -11
- data/test/{plugin/handler/test_handler_add.rb → unit/plugin/handler/test_add.rb} +2 -14
- data/test/{plugin/handler/test_handler_groonga.rb → unit/plugin/handler/test_groonga.rb} +6 -26
- data/test/unit/plugin/handler/test_search.rb +601 -0
- data/test/{plugin/handler/test_handler_watch.rb → unit/plugin/handler/test_watch.rb} +2 -2
- data/test/{run-test.rb → unit/run-test.rb} +3 -3
- data/test/{test_adapter.rb → unit/test_adapter.rb} +17 -14
- data/test/{test_catalog.rb → unit/test_catalog.rb} +4 -4
- data/test/{test_command_mapper.rb → unit/test_command_mapper.rb} +1 -1
- data/test/{test_groonga_command_converter.rb → unit/test_groonga_command_converter.rb} +3 -3
- data/test/{test_job_queue_schema.rb → unit/test_job_queue_schema.rb} +1 -1
- data/test/{test_output.rb → unit/test_output.rb} +9 -9
- data/test/{test_handler.rb → unit/test_plugin.rb} +19 -22
- data/test/unit/test_plugin_repository.rb +89 -0
- data/test/{test_sweeper.rb → unit/test_sweeper.rb} +1 -1
- data/test/{test_watch_schema.rb → unit/test_watch_schema.rb} +1 -1
- data/test/{test_watcher.rb → unit/test_watcher.rb} +1 -1
- metadata +226 -66
- data/lib/droonga/executor.rb +0 -289
- data/lib/droonga/plugin/handler_proxy.rb +0 -82
- data/test/plugin/handler/test_handler_search.rb +0 -512
- data/test/test_worker.rb +0 -144
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# -*- coding: utf-8 -*-
|
|
2
2
|
#
|
|
3
|
-
# Copyright (C) 2013
|
|
3
|
+
# Copyright (C) 2013 Droonga Project
|
|
4
4
|
#
|
|
5
5
|
# This library is free software; you can redistribute it and/or
|
|
6
6
|
# modify it under the terms of the GNU Lesser General Public
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
# License along with this library; if not, write to the Free Software
|
|
16
16
|
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
17
17
|
|
|
18
|
-
require "droonga/plugin/
|
|
18
|
+
require "droonga/plugin/handler/watch"
|
|
19
19
|
|
|
20
20
|
class WatchHandlerTest < Test::Unit::TestCase
|
|
21
21
|
include WatchHelper
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env ruby
|
|
2
2
|
# -*- coding: utf-8 -*-
|
|
3
3
|
#
|
|
4
|
-
# Copyright (C) 2013
|
|
4
|
+
# Copyright (C) 2013 Droonga Project
|
|
5
5
|
#
|
|
6
6
|
# This library is free software; you can redistribute it and/or
|
|
7
7
|
# modify it under the terms of the GNU Lesser General Public
|
|
@@ -43,9 +43,9 @@ unless ENV.has_key?("VERBOSE")
|
|
|
43
43
|
$log = null_logger
|
|
44
44
|
end
|
|
45
45
|
|
|
46
|
-
base_dir = File.expand_path(File.join(File.dirname(__FILE__), ".."))
|
|
46
|
+
base_dir = File.expand_path(File.join(File.dirname(__FILE__), "..", ".."))
|
|
47
47
|
lib_dir = File.join(base_dir, "lib")
|
|
48
|
-
test_dir = File.join(base_dir, "test")
|
|
48
|
+
test_dir = File.join(base_dir, "test", "unit")
|
|
49
49
|
|
|
50
50
|
$LOAD_PATH.unshift(lib_dir)
|
|
51
51
|
$LOAD_PATH.unshift(test_dir)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Copyright (C) 2013
|
|
1
|
+
# Copyright (C) 2013 Droonga Project
|
|
2
2
|
#
|
|
3
3
|
# This library is free software; you can redistribute it and/or
|
|
4
4
|
# modify it under the terms of the GNU Lesser General Public
|
|
@@ -17,31 +17,34 @@ require "droonga/adapter"
|
|
|
17
17
|
|
|
18
18
|
class AdapterTest < Test::Unit::TestCase
|
|
19
19
|
class AdaptTest < self
|
|
20
|
-
class GroongaAdapter < Droonga::Adapter
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
end
|
|
20
|
+
# class GroongaAdapter < Droonga::Adapter
|
|
21
|
+
# command :select
|
|
22
|
+
# def select(request)
|
|
23
|
+
# post(:search) do |response|
|
|
24
|
+
# # do nothing
|
|
25
|
+
# end
|
|
26
|
+
# :selected
|
|
27
|
+
# end
|
|
28
|
+
# end
|
|
29
29
|
|
|
30
30
|
def setup
|
|
31
|
-
|
|
32
|
-
@
|
|
31
|
+
omit("Pending")
|
|
32
|
+
@dispatcher = Object.new
|
|
33
|
+
@groonga_adapter = GroongaAdapter.new(@dispatcher)
|
|
33
34
|
end
|
|
34
35
|
|
|
35
36
|
def test_called
|
|
37
|
+
omit("Pending")
|
|
36
38
|
request = nil
|
|
37
|
-
stub(@
|
|
39
|
+
stub(@dispatcher).post
|
|
38
40
|
assert_equal(:selected, @groonga_adapter.adapt(:select, request))
|
|
39
41
|
end
|
|
40
42
|
|
|
41
43
|
def test_post
|
|
44
|
+
omit("Pending")
|
|
42
45
|
request = nil
|
|
43
46
|
response = nil
|
|
44
|
-
mock(@
|
|
47
|
+
mock(@dispatcher).post(:search).yields(response)
|
|
45
48
|
@groonga_adapter.adapt(:select, request)
|
|
46
49
|
end
|
|
47
50
|
end
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Copyright (C) 2013
|
|
1
|
+
# Copyright (C) 2013 Droonga Project
|
|
2
2
|
#
|
|
3
3
|
# This library is free software; you can redistribute it and/or
|
|
4
4
|
# modify it under the terms of the GNU Lesser General Public
|
|
@@ -24,8 +24,8 @@ class CatalogTest < Test::Unit::TestCase
|
|
|
24
24
|
assert_equal(["for_global"], @catalog.option("plugins"))
|
|
25
25
|
end
|
|
26
26
|
|
|
27
|
-
def
|
|
28
|
-
|
|
27
|
+
def test_get_partitions
|
|
28
|
+
partitions = @catalog.get_partitions("localhost:23003/test")
|
|
29
29
|
base_path = File.expand_path("../fixtures", __FILE__)
|
|
30
30
|
assert_equal({
|
|
31
31
|
"localhost:23003/test.000" => {
|
|
@@ -49,7 +49,7 @@ class CatalogTest < Test::Unit::TestCase
|
|
|
49
49
|
:n_workers => 0
|
|
50
50
|
},
|
|
51
51
|
},
|
|
52
|
-
|
|
52
|
+
partitions)
|
|
53
53
|
end
|
|
54
54
|
|
|
55
55
|
private
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Copyright (C) 2013
|
|
1
|
+
# Copyright (C) 2013 Droonga Project
|
|
2
2
|
#
|
|
3
3
|
# This library is free software; you can redistribute it and/or
|
|
4
4
|
# modify it under the terms of the GNU Lesser General Public
|
|
@@ -221,11 +221,11 @@ column_create Terms Users_name COLUMN_INDEX|WITH_POSITION Users name
|
|
|
221
221
|
|
|
222
222
|
private
|
|
223
223
|
def date
|
|
224
|
-
Time.
|
|
224
|
+
Time.utc(2013, 11, 29, 0, 0, 0)
|
|
225
225
|
end
|
|
226
226
|
|
|
227
227
|
def formatted_date
|
|
228
|
-
"2013-11-29T00:00:
|
|
228
|
+
"2013-11-29T00:00:00Z"
|
|
229
229
|
end
|
|
230
230
|
|
|
231
231
|
def reply_to
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Copyright (C) 2013
|
|
1
|
+
# Copyright (C) 2013 Droonga Project
|
|
2
2
|
#
|
|
3
3
|
# This library is free software; you can redistribute it and/or
|
|
4
4
|
# modify it under the terms of the GNU Lesser General Public
|
|
@@ -16,15 +16,15 @@
|
|
|
16
16
|
require "fluent/plugin/out_droonga"
|
|
17
17
|
|
|
18
18
|
module OutputStub
|
|
19
|
-
class
|
|
20
|
-
attr_reader :
|
|
19
|
+
class Engine
|
|
20
|
+
attr_reader :processed_envelope
|
|
21
21
|
def initialize(response)
|
|
22
22
|
@response = response
|
|
23
|
-
@
|
|
23
|
+
@processed_envelope = nil
|
|
24
24
|
end
|
|
25
25
|
|
|
26
|
-
def
|
|
27
|
-
@
|
|
26
|
+
def process(envelope)
|
|
27
|
+
@processed_envelope = envelope
|
|
28
28
|
@response
|
|
29
29
|
end
|
|
30
30
|
|
|
@@ -50,14 +50,14 @@ module OutputStub
|
|
|
50
50
|
end
|
|
51
51
|
|
|
52
52
|
class Output < Fluent::DroongaOutput
|
|
53
|
-
attr_reader :
|
|
53
|
+
attr_reader :engine
|
|
54
54
|
def initialize(response)
|
|
55
55
|
@response = response
|
|
56
56
|
super()
|
|
57
57
|
end
|
|
58
58
|
|
|
59
59
|
def start
|
|
60
|
-
@
|
|
60
|
+
@engine = Engine.new(@response)
|
|
61
61
|
end
|
|
62
62
|
|
|
63
63
|
def create_logger(tag, options)
|
|
@@ -80,7 +80,7 @@ class OutputTest < Test::Unit::TestCase
|
|
|
80
80
|
driver.run do
|
|
81
81
|
driver.emit(request, time)
|
|
82
82
|
end
|
|
83
|
-
assert_equal(request, @output.
|
|
83
|
+
assert_equal(request, @output.engine.processed_envelope)
|
|
84
84
|
end
|
|
85
85
|
|
|
86
86
|
private
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Copyright (C) 2013
|
|
1
|
+
# Copyright (C) 2013 Droonga Project
|
|
2
2
|
#
|
|
3
3
|
# This library is free software; you can redistribute it and/or
|
|
4
4
|
# modify it under the terms of the GNU Lesser General Public
|
|
@@ -13,41 +13,38 @@
|
|
|
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 "droonga/
|
|
16
|
+
require "droonga/plugin"
|
|
17
17
|
|
|
18
|
-
class
|
|
19
|
-
class
|
|
20
|
-
class
|
|
21
|
-
|
|
22
|
-
def search(request)
|
|
23
|
-
:search_response
|
|
24
|
-
end
|
|
18
|
+
class PluginTest < Test::Unit::TestCase
|
|
19
|
+
class PluggableTest < self
|
|
20
|
+
class DummyTypePlugin < Droonga::Plugin
|
|
21
|
+
extend Droonga::PluginRegisterable
|
|
25
22
|
end
|
|
26
23
|
|
|
27
|
-
class
|
|
28
|
-
command :
|
|
29
|
-
def
|
|
30
|
-
:
|
|
24
|
+
class DummyPlugin < DummyTypePlugin
|
|
25
|
+
command :dummy
|
|
26
|
+
def dummy(request)
|
|
27
|
+
:dummy_response
|
|
31
28
|
end
|
|
32
29
|
end
|
|
33
30
|
|
|
34
|
-
class
|
|
35
|
-
|
|
36
|
-
|
|
31
|
+
class UnknownPlugin < DummyTypePlugin
|
|
32
|
+
command :unknown
|
|
33
|
+
def unknown(request)
|
|
34
|
+
:unknown_response
|
|
37
35
|
end
|
|
38
36
|
end
|
|
39
37
|
|
|
40
38
|
def setup
|
|
41
|
-
|
|
42
|
-
@search_handler = SearchHandler.new(context)
|
|
39
|
+
@dummy_plugin = DummyPlugin.new
|
|
43
40
|
end
|
|
44
41
|
|
|
45
|
-
def
|
|
46
|
-
assert_true(@
|
|
42
|
+
def test_processable
|
|
43
|
+
assert_true(@dummy_plugin.processable?(:dummy))
|
|
47
44
|
end
|
|
48
45
|
|
|
49
|
-
def
|
|
50
|
-
assert_false(@
|
|
46
|
+
def test_not_processable
|
|
47
|
+
assert_false(@dummy_plugin.processable?(:unknown))
|
|
51
48
|
end
|
|
52
49
|
end
|
|
53
50
|
end
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
# Copyright (C) 2013 Droonga Project
|
|
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
|
+
require "droonga/plugin_repository"
|
|
17
|
+
|
|
18
|
+
class PluginRepositoryTest < Test::Unit::TestCase
|
|
19
|
+
def setup
|
|
20
|
+
@repository = Droonga::PluginRepository.new
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
class StubPlugin
|
|
24
|
+
attr_reader :arguments
|
|
25
|
+
def initialize(*arguments)
|
|
26
|
+
@arguments = arguments
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
def test_register
|
|
31
|
+
@repository.register("stub", StubPlugin)
|
|
32
|
+
assert_equal(StubPlugin, @repository["stub"])
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
def test_enumerable
|
|
36
|
+
@repository.register("stub1", StubPlugin)
|
|
37
|
+
@repository.register("stub2", StubPlugin)
|
|
38
|
+
assert_equal([
|
|
39
|
+
["stub1", StubPlugin],
|
|
40
|
+
["stub2", StubPlugin],
|
|
41
|
+
],
|
|
42
|
+
@repository.to_a)
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
sub_test_case("[]") do
|
|
46
|
+
def setup
|
|
47
|
+
super
|
|
48
|
+
@repository.register("stub", StubPlugin)
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
def test_nonexistent
|
|
52
|
+
assert_nil(@repository["nonexistent"])
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
def test_existent
|
|
56
|
+
assert_equal(StubPlugin, @repository["stub"])
|
|
57
|
+
end
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
sub_test_case("clear") do
|
|
61
|
+
def setup
|
|
62
|
+
super
|
|
63
|
+
@repository.register("stub", StubPlugin)
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
def test_clear
|
|
67
|
+
assert_equal([["stub", StubPlugin]], @repository.to_a)
|
|
68
|
+
@repository.clear
|
|
69
|
+
assert_equal([], @repository.to_a)
|
|
70
|
+
end
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
sub_test_case("instantiate") do
|
|
74
|
+
def setup
|
|
75
|
+
super
|
|
76
|
+
@repository.register("stub", StubPlugin)
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
def test_no_arguments
|
|
80
|
+
plugin = @repository.instantiate("stub")
|
|
81
|
+
assert_equal([], plugin.arguments)
|
|
82
|
+
end
|
|
83
|
+
|
|
84
|
+
def test_have_arguments
|
|
85
|
+
plugin = @repository.instantiate("stub", "Hello", "World")
|
|
86
|
+
assert_equal(["Hello", "World"], plugin.arguments)
|
|
87
|
+
end
|
|
88
|
+
end
|
|
89
|
+
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: fluent-plugin-droonga
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0
|
|
4
|
+
version: 0.7.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Droonga Project
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2013-11-
|
|
11
|
+
date: 2013-11-29 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: fluentd
|
|
@@ -164,7 +164,35 @@ dependencies:
|
|
|
164
164
|
- - ">="
|
|
165
165
|
- !ruby/object:Gem::Version
|
|
166
166
|
version: '0'
|
|
167
|
-
|
|
167
|
+
- !ruby/object:Gem::Dependency
|
|
168
|
+
name: packnga
|
|
169
|
+
requirement: !ruby/object:Gem::Requirement
|
|
170
|
+
requirements:
|
|
171
|
+
- - ">="
|
|
172
|
+
- !ruby/object:Gem::Version
|
|
173
|
+
version: '0'
|
|
174
|
+
type: :development
|
|
175
|
+
prerelease: false
|
|
176
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
177
|
+
requirements:
|
|
178
|
+
- - ">="
|
|
179
|
+
- !ruby/object:Gem::Version
|
|
180
|
+
version: '0'
|
|
181
|
+
- !ruby/object:Gem::Dependency
|
|
182
|
+
name: kramdown
|
|
183
|
+
requirement: !ruby/object:Gem::Requirement
|
|
184
|
+
requirements:
|
|
185
|
+
- - ">="
|
|
186
|
+
- !ruby/object:Gem::Version
|
|
187
|
+
version: '0'
|
|
188
|
+
type: :development
|
|
189
|
+
prerelease: false
|
|
190
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
191
|
+
requirements:
|
|
192
|
+
- - ">="
|
|
193
|
+
- !ruby/object:Gem::Version
|
|
194
|
+
version: '0'
|
|
195
|
+
description: Droonga(distributed Groonga) plugin for Fluent event collector
|
|
168
196
|
email:
|
|
169
197
|
- droonga@groonga.org
|
|
170
198
|
executables:
|
|
@@ -174,6 +202,7 @@ extra_rdoc_files: []
|
|
|
174
202
|
files:
|
|
175
203
|
- ".gitignore"
|
|
176
204
|
- ".travis.yml"
|
|
205
|
+
- ".yardopts"
|
|
177
206
|
- Gemfile
|
|
178
207
|
- LICENSE.txt
|
|
179
208
|
- README.md
|
|
@@ -187,29 +216,47 @@ files:
|
|
|
187
216
|
- benchmark/watch/catalog.json
|
|
188
217
|
- benchmark/watch/fluentd.conf
|
|
189
218
|
- bin/grn2jsons
|
|
219
|
+
- doc/text/news.md
|
|
190
220
|
- fluent-plugin-droonga.gemspec
|
|
191
221
|
- lib/droonga/adapter.rb
|
|
222
|
+
- lib/droonga/adapter_plugin.rb
|
|
192
223
|
- lib/droonga/catalog.rb
|
|
224
|
+
- lib/droonga/collector.rb
|
|
225
|
+
- lib/droonga/collector_plugin.rb
|
|
193
226
|
- lib/droonga/command_mapper.rb
|
|
227
|
+
- lib/droonga/dispatcher.rb
|
|
228
|
+
- lib/droonga/distributor.rb
|
|
229
|
+
- lib/droonga/distributor_plugin.rb
|
|
194
230
|
- lib/droonga/engine.rb
|
|
195
|
-
- lib/droonga/
|
|
231
|
+
- lib/droonga/farm.rb
|
|
232
|
+
- lib/droonga/forwarder.rb
|
|
196
233
|
- lib/droonga/handler.rb
|
|
197
234
|
- lib/droonga/handler_plugin.rb
|
|
235
|
+
- lib/droonga/input_message.rb
|
|
198
236
|
- lib/droonga/job_queue.rb
|
|
199
237
|
- lib/droonga/job_queue_schema.rb
|
|
200
238
|
- lib/droonga/logger.rb
|
|
239
|
+
- lib/droonga/partition.rb
|
|
240
|
+
- lib/droonga/pluggable.rb
|
|
201
241
|
- lib/droonga/plugin.rb
|
|
242
|
+
- lib/droonga/plugin/adapter/groonga.rb
|
|
202
243
|
- lib/droonga/plugin/adapter/groonga/select.rb
|
|
203
|
-
- lib/droonga/plugin/
|
|
244
|
+
- lib/droonga/plugin/collector/basic.rb
|
|
245
|
+
- lib/droonga/plugin/distributor/crud.rb
|
|
246
|
+
- lib/droonga/plugin/distributor/groonga.rb
|
|
247
|
+
- lib/droonga/plugin/distributor/search.rb
|
|
248
|
+
- lib/droonga/plugin/distributor/watch.rb
|
|
249
|
+
- lib/droonga/plugin/handler/add.rb
|
|
250
|
+
- lib/droonga/plugin/handler/forward.rb
|
|
251
|
+
- lib/droonga/plugin/handler/groonga.rb
|
|
204
252
|
- lib/droonga/plugin/handler/groonga/column_create.rb
|
|
205
253
|
- lib/droonga/plugin/handler/groonga/table_create.rb
|
|
206
|
-
- lib/droonga/plugin/
|
|
207
|
-
- lib/droonga/plugin/
|
|
208
|
-
- lib/droonga/
|
|
209
|
-
- lib/droonga/
|
|
210
|
-
- lib/droonga/
|
|
211
|
-
- lib/droonga/
|
|
212
|
-
- lib/droonga/proxy.rb
|
|
254
|
+
- lib/droonga/plugin/handler/search.rb
|
|
255
|
+
- lib/droonga/plugin/handler/watch.rb
|
|
256
|
+
- lib/droonga/plugin_loader.rb
|
|
257
|
+
- lib/droonga/plugin_registerable.rb
|
|
258
|
+
- lib/droonga/plugin_repository.rb
|
|
259
|
+
- lib/droonga/processor.rb
|
|
213
260
|
- lib/droonga/searcher.rb
|
|
214
261
|
- lib/droonga/server.rb
|
|
215
262
|
- lib/droonga/sweeper.rb
|
|
@@ -221,32 +268,88 @@ files:
|
|
|
221
268
|
- sample/cluster/catalog.json
|
|
222
269
|
- sample/cluster/fluentd.conf
|
|
223
270
|
- sample/fluentd.conf
|
|
224
|
-
- test/
|
|
225
|
-
- test/
|
|
226
|
-
- test/
|
|
227
|
-
- test/
|
|
228
|
-
- test/
|
|
229
|
-
- test/
|
|
230
|
-
- test/
|
|
231
|
-
- test/
|
|
232
|
-
- test/
|
|
233
|
-
- test/
|
|
234
|
-
- test/
|
|
235
|
-
- test/
|
|
236
|
-
- test/
|
|
237
|
-
- test/
|
|
238
|
-
- test/
|
|
239
|
-
- test/
|
|
240
|
-
- test/
|
|
241
|
-
- test/
|
|
242
|
-
- test/
|
|
243
|
-
- test/
|
|
244
|
-
- test/
|
|
245
|
-
- test/
|
|
246
|
-
- test/
|
|
247
|
-
- test/
|
|
248
|
-
- test/
|
|
249
|
-
- test/
|
|
271
|
+
- test/command/config/default/catalog.json
|
|
272
|
+
- test/command/config/default/fluentd.conf
|
|
273
|
+
- test/command/fixture/documents.jsons
|
|
274
|
+
- test/command/fixture/user-table-array.jsons
|
|
275
|
+
- test/command/fixture/user-table.jsons
|
|
276
|
+
- test/command/run-test.rb
|
|
277
|
+
- test/command/suite/add/minimum.expected
|
|
278
|
+
- test/command/suite/add/minimum.test
|
|
279
|
+
- test/command/suite/add/with-values.expected
|
|
280
|
+
- test/command/suite/add/with-values.test
|
|
281
|
+
- test/command/suite/add/without-key.expected
|
|
282
|
+
- test/command/suite/add/without-key.test
|
|
283
|
+
- test/command/suite/groonga/column_create/scalar.expected
|
|
284
|
+
- test/command/suite/groonga/column_create/scalar.test
|
|
285
|
+
- test/command/suite/groonga/column_create/vector.expected
|
|
286
|
+
- test/command/suite/groonga/column_create/vector.test
|
|
287
|
+
- test/command/suite/groonga/select/minimum.expected
|
|
288
|
+
- test/command/suite/groonga/select/minimum.test
|
|
289
|
+
- test/command/suite/groonga/table_create/array.expected
|
|
290
|
+
- test/command/suite/groonga/table_create/array.test
|
|
291
|
+
- test/command/suite/groonga/table_create/hash.expected
|
|
292
|
+
- test/command/suite/groonga/table_create/hash.test
|
|
293
|
+
- test/command/suite/search/array-attribute-label.expected
|
|
294
|
+
- test/command/suite/search/array-attribute-label.test
|
|
295
|
+
- test/command/suite/search/chained-queries.expected
|
|
296
|
+
- test/command/suite/search/chained-queries.test
|
|
297
|
+
- test/command/suite/search/complex.expected
|
|
298
|
+
- test/command/suite/search/complex.test
|
|
299
|
+
- test/command/suite/search/condition-nested.expected
|
|
300
|
+
- test/command/suite/search/condition-nested.test
|
|
301
|
+
- test/command/suite/search/condition-query.expected
|
|
302
|
+
- test/command/suite/search/condition-query.test
|
|
303
|
+
- test/command/suite/search/condition-script.expected
|
|
304
|
+
- test/command/suite/search/condition-script.test
|
|
305
|
+
- test/command/suite/search/hash-attribute-label.expected
|
|
306
|
+
- test/command/suite/search/hash-attribute-label.test
|
|
307
|
+
- test/command/suite/search/minimum.expected
|
|
308
|
+
- test/command/suite/search/minimum.test
|
|
309
|
+
- test/command/suite/search/multiple-queries.expected
|
|
310
|
+
- test/command/suite/search/multiple-queries.test
|
|
311
|
+
- test/command/suite/search/output-range.expected
|
|
312
|
+
- test/command/suite/search/output-range.test
|
|
313
|
+
- test/command/suite/search/simple.expected
|
|
314
|
+
- test/command/suite/search/simple.test
|
|
315
|
+
- test/command/suite/search/sort-and-output-range.expected
|
|
316
|
+
- test/command/suite/search/sort-and-output-range.test
|
|
317
|
+
- test/command/suite/search/sort-range.expected
|
|
318
|
+
- test/command/suite/search/sort-range.test
|
|
319
|
+
- test/command/suite/search/sort-with-invisible-column.expected
|
|
320
|
+
- test/command/suite/search/sort-with-invisible-column.test
|
|
321
|
+
- test/unit/fixtures/array.grn
|
|
322
|
+
- test/unit/fixtures/catalog.json
|
|
323
|
+
- test/unit/fixtures/document.grn
|
|
324
|
+
- test/unit/fixtures/reference/array.grn
|
|
325
|
+
- test/unit/fixtures/reference/hash.grn
|
|
326
|
+
- test/unit/helper.rb
|
|
327
|
+
- test/unit/helper/fixture.rb
|
|
328
|
+
- test/unit/helper/plugin_helper.rb
|
|
329
|
+
- test/unit/helper/sandbox.rb
|
|
330
|
+
- test/unit/helper/stub_worker.rb
|
|
331
|
+
- test/unit/helper/watch_helper.rb
|
|
332
|
+
- test/unit/plugin/adapter/groonga/test_select.rb
|
|
333
|
+
- test/unit/plugin/collector/test_basic.rb
|
|
334
|
+
- test/unit/plugin/distributor/test_search.rb
|
|
335
|
+
- test/unit/plugin/handler/groonga/test_column_create.rb
|
|
336
|
+
- test/unit/plugin/handler/groonga/test_table_create.rb
|
|
337
|
+
- test/unit/plugin/handler/test_add.rb
|
|
338
|
+
- test/unit/plugin/handler/test_groonga.rb
|
|
339
|
+
- test/unit/plugin/handler/test_search.rb
|
|
340
|
+
- test/unit/plugin/handler/test_watch.rb
|
|
341
|
+
- test/unit/run-test.rb
|
|
342
|
+
- test/unit/test_adapter.rb
|
|
343
|
+
- test/unit/test_catalog.rb
|
|
344
|
+
- test/unit/test_command_mapper.rb
|
|
345
|
+
- test/unit/test_groonga_command_converter.rb
|
|
346
|
+
- test/unit/test_job_queue_schema.rb
|
|
347
|
+
- test/unit/test_output.rb
|
|
348
|
+
- test/unit/test_plugin.rb
|
|
349
|
+
- test/unit/test_plugin_repository.rb
|
|
350
|
+
- test/unit/test_sweeper.rb
|
|
351
|
+
- test/unit/test_watch_schema.rb
|
|
352
|
+
- test/unit/test_watcher.rb
|
|
250
353
|
homepage: https://github.com/droonga/fluent-plugin-droonga
|
|
251
354
|
licenses: []
|
|
252
355
|
metadata: {}
|
|
@@ -266,34 +369,91 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
266
369
|
version: '0'
|
|
267
370
|
requirements: []
|
|
268
371
|
rubyforge_project:
|
|
269
|
-
rubygems_version: 2.0
|
|
372
|
+
rubygems_version: 2.2.0
|
|
270
373
|
signing_key:
|
|
271
374
|
specification_version: 4
|
|
272
|
-
summary: Droonga(distributed
|
|
375
|
+
summary: Droonga(distributed Groonga) plugin for Fluent event collector
|
|
273
376
|
test_files:
|
|
274
|
-
- test/
|
|
275
|
-
- test/
|
|
276
|
-
- test/
|
|
277
|
-
- test/
|
|
278
|
-
- test/
|
|
279
|
-
- test/
|
|
280
|
-
- test/
|
|
281
|
-
- test/
|
|
282
|
-
- test/
|
|
283
|
-
- test/
|
|
284
|
-
- test/
|
|
285
|
-
- test/
|
|
286
|
-
- test/
|
|
287
|
-
- test/
|
|
288
|
-
- test/
|
|
289
|
-
- test/
|
|
290
|
-
- test/
|
|
291
|
-
- test/
|
|
292
|
-
- test/
|
|
293
|
-
- test/
|
|
294
|
-
- test/
|
|
295
|
-
- test/
|
|
296
|
-
- test/
|
|
297
|
-
- test/
|
|
298
|
-
- test/
|
|
299
|
-
- test/
|
|
377
|
+
- test/command/config/default/catalog.json
|
|
378
|
+
- test/command/config/default/fluentd.conf
|
|
379
|
+
- test/command/fixture/documents.jsons
|
|
380
|
+
- test/command/fixture/user-table-array.jsons
|
|
381
|
+
- test/command/fixture/user-table.jsons
|
|
382
|
+
- test/command/run-test.rb
|
|
383
|
+
- test/command/suite/add/minimum.expected
|
|
384
|
+
- test/command/suite/add/minimum.test
|
|
385
|
+
- test/command/suite/add/with-values.expected
|
|
386
|
+
- test/command/suite/add/with-values.test
|
|
387
|
+
- test/command/suite/add/without-key.expected
|
|
388
|
+
- test/command/suite/add/without-key.test
|
|
389
|
+
- test/command/suite/groonga/column_create/scalar.expected
|
|
390
|
+
- test/command/suite/groonga/column_create/scalar.test
|
|
391
|
+
- test/command/suite/groonga/column_create/vector.expected
|
|
392
|
+
- test/command/suite/groonga/column_create/vector.test
|
|
393
|
+
- test/command/suite/groonga/select/minimum.expected
|
|
394
|
+
- test/command/suite/groonga/select/minimum.test
|
|
395
|
+
- test/command/suite/groonga/table_create/array.expected
|
|
396
|
+
- test/command/suite/groonga/table_create/array.test
|
|
397
|
+
- test/command/suite/groonga/table_create/hash.expected
|
|
398
|
+
- test/command/suite/groonga/table_create/hash.test
|
|
399
|
+
- test/command/suite/search/array-attribute-label.expected
|
|
400
|
+
- test/command/suite/search/array-attribute-label.test
|
|
401
|
+
- test/command/suite/search/chained-queries.expected
|
|
402
|
+
- test/command/suite/search/chained-queries.test
|
|
403
|
+
- test/command/suite/search/complex.expected
|
|
404
|
+
- test/command/suite/search/complex.test
|
|
405
|
+
- test/command/suite/search/condition-nested.expected
|
|
406
|
+
- test/command/suite/search/condition-nested.test
|
|
407
|
+
- test/command/suite/search/condition-query.expected
|
|
408
|
+
- test/command/suite/search/condition-query.test
|
|
409
|
+
- test/command/suite/search/condition-script.expected
|
|
410
|
+
- test/command/suite/search/condition-script.test
|
|
411
|
+
- test/command/suite/search/hash-attribute-label.expected
|
|
412
|
+
- test/command/suite/search/hash-attribute-label.test
|
|
413
|
+
- test/command/suite/search/minimum.expected
|
|
414
|
+
- test/command/suite/search/minimum.test
|
|
415
|
+
- test/command/suite/search/multiple-queries.expected
|
|
416
|
+
- test/command/suite/search/multiple-queries.test
|
|
417
|
+
- test/command/suite/search/output-range.expected
|
|
418
|
+
- test/command/suite/search/output-range.test
|
|
419
|
+
- test/command/suite/search/simple.expected
|
|
420
|
+
- test/command/suite/search/simple.test
|
|
421
|
+
- test/command/suite/search/sort-and-output-range.expected
|
|
422
|
+
- test/command/suite/search/sort-and-output-range.test
|
|
423
|
+
- test/command/suite/search/sort-range.expected
|
|
424
|
+
- test/command/suite/search/sort-range.test
|
|
425
|
+
- test/command/suite/search/sort-with-invisible-column.expected
|
|
426
|
+
- test/command/suite/search/sort-with-invisible-column.test
|
|
427
|
+
- test/unit/fixtures/array.grn
|
|
428
|
+
- test/unit/fixtures/catalog.json
|
|
429
|
+
- test/unit/fixtures/document.grn
|
|
430
|
+
- test/unit/fixtures/reference/array.grn
|
|
431
|
+
- test/unit/fixtures/reference/hash.grn
|
|
432
|
+
- test/unit/helper.rb
|
|
433
|
+
- test/unit/helper/fixture.rb
|
|
434
|
+
- test/unit/helper/plugin_helper.rb
|
|
435
|
+
- test/unit/helper/sandbox.rb
|
|
436
|
+
- test/unit/helper/stub_worker.rb
|
|
437
|
+
- test/unit/helper/watch_helper.rb
|
|
438
|
+
- test/unit/plugin/adapter/groonga/test_select.rb
|
|
439
|
+
- test/unit/plugin/collector/test_basic.rb
|
|
440
|
+
- test/unit/plugin/distributor/test_search.rb
|
|
441
|
+
- test/unit/plugin/handler/groonga/test_column_create.rb
|
|
442
|
+
- test/unit/plugin/handler/groonga/test_table_create.rb
|
|
443
|
+
- test/unit/plugin/handler/test_add.rb
|
|
444
|
+
- test/unit/plugin/handler/test_groonga.rb
|
|
445
|
+
- test/unit/plugin/handler/test_search.rb
|
|
446
|
+
- test/unit/plugin/handler/test_watch.rb
|
|
447
|
+
- test/unit/run-test.rb
|
|
448
|
+
- test/unit/test_adapter.rb
|
|
449
|
+
- test/unit/test_catalog.rb
|
|
450
|
+
- test/unit/test_command_mapper.rb
|
|
451
|
+
- test/unit/test_groonga_command_converter.rb
|
|
452
|
+
- test/unit/test_job_queue_schema.rb
|
|
453
|
+
- test/unit/test_output.rb
|
|
454
|
+
- test/unit/test_plugin.rb
|
|
455
|
+
- test/unit/test_plugin_repository.rb
|
|
456
|
+
- test/unit/test_sweeper.rb
|
|
457
|
+
- test/unit/test_watch_schema.rb
|
|
458
|
+
- test/unit/test_watcher.rb
|
|
459
|
+
has_rdoc:
|