fluent-plugin-droonga 0.7.0 → 0.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -4
- data/benchmark/watch/benchmark-notify.rb +2 -2
- data/benchmark/watch/benchmark-scan.rb +3 -0
- data/benchmark/watch/fluentd.conf +0 -1
- data/fluent-plugin-droonga.gemspec +2 -3
- data/lib/droonga/catalog.rb +10 -124
- data/lib/droonga/catalog/base.rb +140 -0
- data/lib/droonga/catalog/version1.rb +23 -0
- data/lib/droonga/catalog_loader.rb +33 -0
- data/lib/droonga/collector.rb +2 -71
- data/lib/droonga/collector_plugin.rb +2 -34
- data/lib/droonga/dispatcher.rb +141 -196
- data/lib/droonga/distribution_planner.rb +76 -0
- data/lib/droonga/distributor.rb +5 -7
- data/lib/droonga/distributor_plugin.rb +23 -15
- data/lib/droonga/engine.rb +2 -2
- data/lib/droonga/event_loop.rb +46 -0
- data/lib/droonga/farm.rb +9 -5
- data/lib/droonga/fluent_message_sender.rb +84 -0
- data/lib/droonga/forwarder.rb +43 -53
- data/lib/droonga/handler.rb +20 -68
- data/lib/droonga/handler_message.rb +61 -0
- data/lib/droonga/handler_messenger.rb +92 -0
- data/lib/droonga/handler_plugin.rb +10 -12
- data/lib/droonga/input_adapter.rb +52 -0
- data/lib/droonga/{adapter.rb → input_adapter_plugin.rb} +7 -13
- data/lib/droonga/input_message.rb +11 -11
- data/lib/droonga/logger.rb +4 -3
- data/lib/droonga/message_pack_packer.rb +62 -0
- data/lib/droonga/message_processing_error.rb +54 -0
- data/lib/droonga/message_pusher.rb +60 -0
- data/lib/droonga/message_receiver.rb +61 -0
- data/lib/droonga/output_adapter.rb +53 -0
- data/lib/droonga/{adapter_plugin.rb → output_adapter_plugin.rb} +3 -21
- data/lib/droonga/output_message.rb +37 -0
- data/lib/droonga/partition.rb +27 -5
- data/lib/droonga/pluggable.rb +9 -4
- data/lib/droonga/plugin.rb +12 -3
- data/lib/droonga/plugin/collector/basic.rb +91 -18
- data/lib/droonga/plugin/distributor/crud.rb +9 -9
- data/lib/droonga/plugin/distributor/distributed_search_planner.rb +401 -0
- data/lib/droonga/plugin/distributor/groonga.rb +5 -5
- data/lib/droonga/plugin/distributor/search.rb +4 -246
- data/lib/droonga/plugin/distributor/watch.rb +11 -6
- data/lib/droonga/plugin/handler/add.rb +69 -7
- data/lib/droonga/plugin/handler/groonga.rb +6 -6
- data/lib/droonga/plugin/handler/search.rb +5 -3
- data/lib/droonga/plugin/handler/watch.rb +19 -13
- data/lib/droonga/plugin/{adapter → input_adapter}/groonga.rb +5 -11
- data/lib/droonga/plugin/{adapter → input_adapter}/groonga/select.rb +2 -36
- data/lib/droonga/plugin/output_adapter/groonga.rb +30 -0
- data/lib/droonga/plugin/output_adapter/groonga/select.rb +54 -0
- data/lib/droonga/plugin_loader.rb +2 -2
- data/lib/droonga/processor.rb +21 -23
- data/lib/droonga/replier.rb +40 -0
- data/lib/droonga/searcher.rb +298 -174
- data/lib/droonga/server.rb +0 -67
- data/lib/droonga/session.rb +85 -0
- data/lib/droonga/test.rb +21 -0
- data/lib/droonga/test/stub_distributor.rb +31 -0
- data/lib/droonga/test/stub_handler.rb +37 -0
- data/lib/droonga/test/stub_handler_message.rb +35 -0
- data/lib/droonga/test/stub_handler_messenger.rb +34 -0
- data/lib/droonga/time_formatter.rb +37 -0
- data/lib/droonga/watcher.rb +1 -0
- data/lib/droonga/worker.rb +16 -19
- data/lib/fluent/plugin/out_droonga.rb +9 -9
- data/lib/groonga_command_converter.rb +5 -5
- data/sample/cluster/catalog.json +1 -1
- data/test/command/config/default/catalog.json +19 -1
- data/test/command/fixture/event.jsons +41 -0
- data/test/command/fixture/user-table.jsons +9 -0
- data/test/command/run-test.rb +2 -2
- data/test/command/suite/add/error/invalid-integer.expected +20 -0
- data/test/command/suite/add/error/invalid-integer.test +12 -0
- data/test/command/suite/add/error/invalid-time.expected +20 -0
- data/test/command/suite/add/error/invalid-time.test +12 -0
- data/test/command/suite/add/error/missing-key.expected +13 -0
- data/test/command/suite/add/error/missing-key.test +16 -0
- data/test/command/suite/add/error/missing-table.expected +13 -0
- data/test/command/suite/add/error/missing-table.test +16 -0
- data/test/command/suite/add/error/unknown-column.expected +20 -0
- data/test/command/suite/add/error/unknown-column.test +12 -0
- data/test/command/suite/add/error/unknown-table.expected +13 -0
- data/test/command/suite/add/error/unknown-table.test +17 -0
- data/test/command/suite/add/minimum.expected +1 -3
- data/test/command/suite/add/with-values.expected +1 -3
- data/test/command/suite/add/without-key.expected +1 -3
- data/test/command/suite/message/error/missing-dataset.expected +13 -0
- data/test/command/suite/message/error/missing-dataset.test +5 -0
- data/test/command/suite/message/error/unknown-command.expected +13 -0
- data/test/command/suite/message/error/unknown-command.test +6 -0
- data/test/command/suite/message/error/unknown-dataset.expected +13 -0
- data/test/command/suite/message/error/unknown-dataset.test +6 -0
- data/test/command/suite/search/{array-attribute-label.expected → attributes/array.expected} +0 -0
- data/test/command/suite/search/{array-attribute-label.test → attributes/array.test} +0 -0
- data/test/command/suite/search/{hash-attribute-label.expected → attributes/hash.expected} +0 -0
- data/test/command/suite/search/{hash-attribute-label.test → attributes/hash.test} +0 -0
- data/test/command/suite/search/{condition-nested.expected → condition/nested.expected} +0 -0
- data/test/command/suite/search/{condition-nested.test → condition/nested.test} +0 -0
- data/test/command/suite/search/{condition-query.expected → condition/query.expected} +0 -0
- data/test/command/suite/search/{condition-query.test → condition/query.test} +0 -0
- data/test/command/suite/search/{condition-script.expected → condition/script.expected} +0 -0
- data/test/command/suite/search/{condition-script.test → condition/script.test} +0 -0
- data/test/command/suite/search/error/cyclic-source.expected +18 -0
- data/test/command/suite/search/error/cyclic-source.test +12 -0
- data/test/command/suite/search/error/deeply-cyclic-source.expected +21 -0
- data/test/command/suite/search/error/deeply-cyclic-source.test +15 -0
- data/test/command/suite/search/error/missing-source-parameter.expected +17 -0
- data/test/command/suite/search/error/missing-source-parameter.test +11 -0
- data/test/command/suite/search/error/unknown-source.expected +18 -0
- data/test/command/suite/search/error/unknown-source.test +12 -0
- data/test/command/suite/search/{minimum.expected → group/count.expected} +2 -1
- data/test/command/suite/search/{minimum.test → group/count.test} +5 -3
- data/test/command/suite/search/group/limit.expected +19 -0
- data/test/command/suite/search/group/limit.test +20 -0
- data/test/command/suite/search/group/string.expected +36 -0
- data/test/command/suite/search/group/string.test +44 -0
- data/test/command/suite/search/{chained-queries.expected → multiple/chained.expected} +0 -0
- data/test/command/suite/search/{chained-queries.test → multiple/chained.test} +0 -0
- data/test/command/suite/search/{multiple-queries.expected → multiple/parallel.expected} +0 -0
- data/test/command/suite/search/{multiple-queries.test → multiple/parallel.test} +0 -0
- data/test/command/suite/search/{output-range.expected → range/only-output.expected} +0 -0
- data/test/command/suite/search/{output-range.test → range/only-output.test} +0 -0
- data/test/command/suite/search/{sort-range.expected → range/only-sort.expected} +0 -0
- data/test/command/suite/search/{sort-range.test → range/only-sort.test} +0 -0
- data/test/command/suite/search/{sort-and-output-range.expected → range/sort-and-output.expected} +0 -0
- data/test/command/suite/search/{sort-and-output-range.test → range/sort-and-output.test} +0 -0
- data/test/command/suite/search/range/too-large-output-offset.expected +16 -0
- data/test/command/suite/search/range/too-large-output-offset.test +25 -0
- data/test/command/suite/search/range/too-large-sort-offset.expected +16 -0
- data/test/command/suite/search/range/too-large-sort-offset.test +28 -0
- data/test/command/suite/search/response/records/value/time.expected +24 -0
- data/test/command/suite/search/response/records/value/time.test +24 -0
- data/test/command/suite/search/sort/default-offset-limit.expected +43 -0
- data/test/command/suite/search/sort/default-offset-limit.test +26 -0
- data/test/command/suite/search/{sort-with-invisible-column.expected → sort/invisible-column.expected} +0 -0
- data/test/command/suite/search/{sort-with-invisible-column.test → sort/invisible-column.test} +0 -0
- data/test/command/suite/watch/subscribe.expected +12 -0
- data/test/command/suite/watch/subscribe.test +9 -0
- data/test/command/suite/watch/unsubscribe.expected +12 -0
- data/test/command/suite/watch/unsubscribe.test +9 -0
- data/test/unit/{test_catalog.rb → catalog/test_version1.rb} +12 -4
- data/test/unit/fixtures/{catalog.json → catalog/version1.json} +0 -0
- data/test/unit/helper.rb +2 -0
- data/test/unit/plugin/collector/test_basic.rb +289 -33
- data/test/unit/plugin/distributor/test_search.rb +176 -861
- data/test/unit/plugin/distributor/test_search_planner.rb +1102 -0
- data/test/unit/plugin/handler/groonga/test_column_create.rb +17 -13
- data/test/unit/plugin/handler/groonga/test_table_create.rb +10 -10
- data/test/unit/plugin/handler/test_add.rb +74 -11
- data/test/unit/plugin/handler/test_groonga.rb +15 -1
- data/test/unit/plugin/handler/test_search.rb +33 -17
- data/test/unit/plugin/handler/test_watch.rb +43 -27
- data/test/unit/run-test.rb +2 -0
- data/test/unit/test_message_pack_packer.rb +51 -0
- data/test/unit/test_time_formatter.rb +29 -0
- metadata +208 -110
- data/lib/droonga/job_queue.rb +0 -87
- data/lib/droonga/job_queue_schema.rb +0 -65
- data/test/unit/test_adapter.rb +0 -51
- data/test/unit/test_job_queue_schema.rb +0 -45
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -0,0 +1,18 @@
|
|
1
|
+
[
|
2
|
+
"droonga.message",
|
3
|
+
0,
|
4
|
+
{
|
5
|
+
"inReplyTo": null,
|
6
|
+
"statusCode": 400,
|
7
|
+
"type": "search.result",
|
8
|
+
"body": {
|
9
|
+
"name": "CyclicSource",
|
10
|
+
"message": "There is cyclic reference of sources.",
|
11
|
+
"detail": {
|
12
|
+
"cyclic-source": {
|
13
|
+
"source": "cyclic-source"
|
14
|
+
}
|
15
|
+
}
|
16
|
+
}
|
17
|
+
}
|
18
|
+
]
|
@@ -0,0 +1,21 @@
|
|
1
|
+
[
|
2
|
+
"droonga.message",
|
3
|
+
0,
|
4
|
+
{
|
5
|
+
"inReplyTo": null,
|
6
|
+
"statusCode": 400,
|
7
|
+
"type": "search.result",
|
8
|
+
"body": {
|
9
|
+
"name": "CyclicSource",
|
10
|
+
"message": "There is cyclic reference of sources.",
|
11
|
+
"detail": {
|
12
|
+
"a": {
|
13
|
+
"source": "b"
|
14
|
+
},
|
15
|
+
"b": {
|
16
|
+
"source": "a"
|
17
|
+
}
|
18
|
+
}
|
19
|
+
}
|
20
|
+
}
|
21
|
+
]
|
@@ -0,0 +1,17 @@
|
|
1
|
+
[
|
2
|
+
"droonga.message",
|
3
|
+
0,
|
4
|
+
{
|
5
|
+
"inReplyTo": null,
|
6
|
+
"statusCode": 400,
|
7
|
+
"type": "search.result",
|
8
|
+
"body": {
|
9
|
+
"name": "MissingSourceParameter",
|
10
|
+
"message": "The query \"no-source\" has no source. Query must have a valid source.",
|
11
|
+
"detail": {
|
12
|
+
"no-source": {
|
13
|
+
}
|
14
|
+
}
|
15
|
+
}
|
16
|
+
}
|
17
|
+
]
|
@@ -0,0 +1,18 @@
|
|
1
|
+
[
|
2
|
+
"droonga.message",
|
3
|
+
0,
|
4
|
+
{
|
5
|
+
"inReplyTo": null,
|
6
|
+
"statusCode": 404,
|
7
|
+
"type": "search.result",
|
8
|
+
"body": {
|
9
|
+
"name": "UnknownSource",
|
10
|
+
"message": "The source \"unknown\" does not exist. It must be a name of an existing table or another query.",
|
11
|
+
"detail": {
|
12
|
+
"unknown-source": {
|
13
|
+
"source": "unknown"
|
14
|
+
}
|
15
|
+
}
|
16
|
+
}
|
17
|
+
}
|
18
|
+
]
|
@@ -1,13 +1,15 @@
|
|
1
|
-
#@include fixture/
|
1
|
+
#@include fixture/documents.jsons
|
2
2
|
{
|
3
3
|
"type": "search",
|
4
4
|
"dataset": "Droonga",
|
5
5
|
"body": {
|
6
6
|
"queries": {
|
7
|
-
"
|
8
|
-
"source": "
|
7
|
+
"documents": {
|
8
|
+
"source": "Sections",
|
9
|
+
"groupBy": "document",
|
9
10
|
"output": {
|
10
11
|
"elements": [
|
12
|
+
"count"
|
11
13
|
]
|
12
14
|
}
|
13
15
|
}
|
@@ -0,0 +1,20 @@
|
|
1
|
+
#@include fixture/documents.jsons
|
2
|
+
{
|
3
|
+
"type": "search",
|
4
|
+
"dataset": "Droonga",
|
5
|
+
"body": {
|
6
|
+
"queries": {
|
7
|
+
"documents": {
|
8
|
+
"source": "Sections",
|
9
|
+
"groupBy": "title",
|
10
|
+
"output": {
|
11
|
+
"elements": [
|
12
|
+
"count",
|
13
|
+
"records"
|
14
|
+
],
|
15
|
+
"limit": 3
|
16
|
+
}
|
17
|
+
}
|
18
|
+
}
|
19
|
+
}
|
20
|
+
}
|
@@ -0,0 +1,36 @@
|
|
1
|
+
[
|
2
|
+
"droonga.message",
|
3
|
+
0,
|
4
|
+
{
|
5
|
+
"inReplyTo": null,
|
6
|
+
"statusCode": 200,
|
7
|
+
"type": "search.result",
|
8
|
+
"body": {
|
9
|
+
"Groonga": {
|
10
|
+
"count": 4,
|
11
|
+
"records": [
|
12
|
+
[
|
13
|
+
"Groonga overview"
|
14
|
+
],
|
15
|
+
[
|
16
|
+
"Groonga library"
|
17
|
+
],
|
18
|
+
[
|
19
|
+
"Groonga server"
|
20
|
+
],
|
21
|
+
[
|
22
|
+
"Groonga storage engine"
|
23
|
+
]
|
24
|
+
]
|
25
|
+
},
|
26
|
+
"documents": {
|
27
|
+
"count": 1,
|
28
|
+
"records": [
|
29
|
+
[
|
30
|
+
"Groonga"
|
31
|
+
]
|
32
|
+
]
|
33
|
+
}
|
34
|
+
}
|
35
|
+
}
|
36
|
+
]
|
@@ -0,0 +1,44 @@
|
|
1
|
+
#@include fixture/documents.jsons
|
2
|
+
{
|
3
|
+
"type": "search",
|
4
|
+
"dataset": "Droonga",
|
5
|
+
"body": {
|
6
|
+
"queries": {
|
7
|
+
"Groonga": {
|
8
|
+
"source": "Sections",
|
9
|
+
"condition": {
|
10
|
+
"query": "groonga",
|
11
|
+
"matchTo": ["title"]
|
12
|
+
},
|
13
|
+
"sortBy": ["_key"],
|
14
|
+
"output": {
|
15
|
+
"elements": [
|
16
|
+
"startTime",
|
17
|
+
"elapsedTime",
|
18
|
+
"count",
|
19
|
+
"attributes",
|
20
|
+
"records"
|
21
|
+
],
|
22
|
+
"limit": -1,
|
23
|
+
"attributes": ["title"]
|
24
|
+
}
|
25
|
+
},
|
26
|
+
"documents": {
|
27
|
+
"source": "Groonga",
|
28
|
+
"groupBy": "document",
|
29
|
+
"sortBy": ["-_key"],
|
30
|
+
"output": {
|
31
|
+
"elements": [
|
32
|
+
"startTime",
|
33
|
+
"elapsedTime",
|
34
|
+
"count",
|
35
|
+
"attributes",
|
36
|
+
"records"
|
37
|
+
],
|
38
|
+
"limit": -1,
|
39
|
+
"attributes": ["_key"]
|
40
|
+
}
|
41
|
+
}
|
42
|
+
}
|
43
|
+
}
|
44
|
+
}
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
data/test/command/suite/search/{sort-and-output-range.expected → range/sort-and-output.expected}
RENAMED
File without changes
|
File without changes
|
@@ -0,0 +1,25 @@
|
|
1
|
+
#@include fixture/documents.jsons
|
2
|
+
{
|
3
|
+
"type": "search",
|
4
|
+
"dataset": "Droonga",
|
5
|
+
"body": {
|
6
|
+
"queries": {
|
7
|
+
"result": {
|
8
|
+
"source": "Sections",
|
9
|
+
"sortBy": ["_key"],
|
10
|
+
"output": {
|
11
|
+
"elements": [
|
12
|
+
"startTime",
|
13
|
+
"elapsedTime",
|
14
|
+
"count",
|
15
|
+
"attributes",
|
16
|
+
"records"
|
17
|
+
],
|
18
|
+
"offset": 10000,
|
19
|
+
"limit": 4,
|
20
|
+
"attributes": ["_key"]
|
21
|
+
}
|
22
|
+
}
|
23
|
+
}
|
24
|
+
}
|
25
|
+
}
|
@@ -0,0 +1,28 @@
|
|
1
|
+
#@include fixture/documents.jsons
|
2
|
+
{
|
3
|
+
"type": "search",
|
4
|
+
"dataset": "Droonga",
|
5
|
+
"body": {
|
6
|
+
"queries": {
|
7
|
+
"result": {
|
8
|
+
"source": "Sections",
|
9
|
+
"sortBy": {
|
10
|
+
"keys": ["-_key"],
|
11
|
+
"offset": 10000,
|
12
|
+
"limit": 4
|
13
|
+
},
|
14
|
+
"output": {
|
15
|
+
"elements": [
|
16
|
+
"startTime",
|
17
|
+
"elapsedTime",
|
18
|
+
"count",
|
19
|
+
"attributes",
|
20
|
+
"records"
|
21
|
+
],
|
22
|
+
"limit": -1,
|
23
|
+
"attributes": ["_key"]
|
24
|
+
}
|
25
|
+
}
|
26
|
+
}
|
27
|
+
}
|
28
|
+
}
|