droonga-engine 1.0.2 → 1.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +1 -0
- data/.travis.yml +3 -0
- data/Gemfile +7 -0
- data/Rakefile +6 -2
- data/bin/droonga-engine +2 -2
- data/bin/{droonga-catalog-generate → droonga-engine-catalog-generate} +15 -3
- data/bin/droonga-engine-serf-event-handler +20 -0
- data/bin/droonga-engine-service +2 -2
- data/doc/text/news.md +21 -1
- data/droonga-engine.gemspec +5 -2
- data/lib/droonga/catalog/collection_volume.rb +12 -0
- data/lib/droonga/catalog/dataset.rb +25 -0
- data/lib/droonga/catalog/single_volume.rb +10 -0
- data/lib/droonga/catalog/slice.rb +4 -0
- data/lib/droonga/catalog/version1.rb +59 -48
- data/lib/droonga/catalog/version2.rb +10 -20
- data/lib/droonga/catalog/volume_collection.rb +27 -4
- data/lib/droonga/catalog_generator.rb +12 -5
- data/lib/droonga/catalog_observer.rb +17 -35
- data/lib/droonga/command/droonga_engine.rb +436 -0
- data/lib/droonga/command/droonga_engine_service.rb +273 -0
- data/lib/droonga/command/serf_event_handler.rb +85 -0
- data/lib/droonga/dispatcher.rb +8 -8
- data/lib/droonga/engine.rb +90 -26
- data/lib/droonga/engine/version.rb +1 -1
- data/lib/droonga/engine_state.rb +29 -3
- data/lib/droonga/internal_fluent_message_receiver.rb +100 -0
- data/lib/droonga/live_nodes_list_loader.rb +48 -0
- data/lib/droonga/live_nodes_list_observer.rb +72 -0
- data/lib/droonga/path.rb +47 -0
- data/lib/droonga/plugins/dump.rb +279 -38
- data/lib/droonga/plugins/groonga/select.rb +26 -14
- data/lib/droonga/plugins/search.rb +30 -2
- data/lib/droonga/plugins/search/distributed_search_planner.rb +28 -11
- data/lib/droonga/processor.rb +4 -0
- data/lib/droonga/searcher.rb +26 -0
- data/lib/droonga/serf.rb +119 -0
- data/lib/droonga/serf_downloader.rb +90 -0
- data/lib/droonga/server.rb +2 -2
- data/lib/droonga/service_control_protocol.rb +26 -0
- data/sample/cluster/catalog.json +1 -1
- data/test/command/config/default/catalog.json +2 -2
- data/test/command/config/version1/catalog.json +1 -1
- data/test/command/fixture/documents.jsons +18 -18
- data/test/command/fixture/event.jsons +4 -4
- data/test/command/fixture/user-table-array.jsons +4 -4
- data/test/command/fixture/user-table.jsons +5 -5
- data/test/command/suite/add/dimension/column.catalog.json +1 -1
- data/test/command/suite/add/dimension/column.test +4 -4
- data/test/command/suite/add/dimension/integer.catalog.json +1 -1
- data/test/command/suite/add/dimension/integer.test +4 -4
- data/test/command/suite/add/error/invalid-integer.test +1 -1
- data/test/command/suite/add/error/invalid-time.test +1 -1
- data/test/command/suite/add/error/missing-key.test +1 -1
- data/test/command/suite/add/error/missing-table.test +1 -1
- data/test/command/suite/add/error/unknown-column.test +1 -1
- data/test/command/suite/add/error/unknown-table.test +1 -1
- data/test/command/suite/add/minimum.test +1 -1
- data/test/command/suite/add/vector/short_text.catalog.json +26 -0
- data/test/command/suite/add/vector/short_text.expected +42 -0
- data/test/command/suite/add/vector/short_text.test +35 -0
- data/test/command/suite/add/with-values.test +1 -1
- data/test/command/suite/add/without-key.test +1 -1
- data/test/command/suite/dump/column/index.catalog.json +40 -0
- data/test/command/suite/dump/column/index.expected +195 -0
- data/test/command/suite/dump/column/index.test +5 -0
- data/test/command/suite/dump/column/scalar.catalog.json +19 -0
- data/test/command/suite/dump/column/scalar.expected +99 -0
- data/test/command/suite/dump/column/scalar.test +5 -0
- data/test/command/suite/dump/column/vector.catalog.json +22 -0
- data/test/command/suite/dump/column/vector.expected +108 -0
- data/test/command/suite/dump/column/vector.test +5 -0
- data/test/command/suite/dump/record/vector/reference.catalog.json +27 -0
- data/test/command/suite/dump/record/vector/reference.expected +213 -0
- data/test/command/suite/dump/record/vector/reference.test +21 -0
- data/test/command/suite/dump/table/array.catalog.json +13 -0
- data/test/command/suite/dump/table/array.expected +63 -0
- data/test/command/suite/dump/table/array.test +5 -0
- data/test/command/suite/dump/table/double_array_trie.catalog.json +14 -0
- data/test/command/suite/dump/table/double_array_trie.expected +66 -0
- data/test/command/suite/dump/table/double_array_trie.test +5 -0
- data/test/command/suite/dump/table/hash.catalog.json +14 -0
- data/test/command/suite/dump/table/hash.expected +66 -0
- data/test/command/suite/dump/table/hash.test +5 -0
- data/test/command/suite/dump/table/patricia_trie.catalog.json +14 -0
- data/test/command/suite/dump/table/patricia_trie.expected +66 -0
- data/test/command/suite/dump/table/patricia_trie.test +5 -0
- data/test/command/suite/groonga/column_create/scalar.test +2 -2
- data/test/command/suite/groonga/column_create/unknown-table.test +1 -1
- data/test/command/suite/groonga/column_create/vector.test +2 -2
- data/test/command/suite/groonga/column_list/success.test +3 -3
- data/test/command/suite/groonga/column_list/unknown-table.test +1 -1
- data/test/command/suite/groonga/column_remove/success.test +3 -3
- data/test/command/suite/groonga/column_remove/unknown-column.test +2 -2
- data/test/command/suite/groonga/column_remove/unknown-table.test +1 -1
- data/test/command/suite/groonga/column_rename/success.test +3 -3
- data/test/command/suite/groonga/column_rename/unknown-column.test +2 -2
- data/test/command/suite/groonga/column_rename/unknown-table.test +1 -1
- data/test/command/suite/groonga/delete/duplicated-identifiers.test +2 -2
- data/test/command/suite/groonga/delete/filter.test +2 -2
- data/test/command/suite/groonga/delete/invalid-filter.test +1 -1
- data/test/command/suite/groonga/delete/no-identifier.test +2 -2
- data/test/command/suite/groonga/delete/success.test +2 -2
- data/test/command/suite/groonga/delete/unknown-table.test +1 -1
- data/test/command/suite/groonga/select/minimum.expected +24 -1
- data/test/command/suite/groonga/select/minimum.test +1 -1
- data/test/command/suite/groonga/select/type/time.catalog.json +19 -0
- data/test/command/suite/groonga/select/type/time.expected +37 -0
- data/test/command/suite/groonga/select/type/time.test +35 -0
- data/test/command/suite/groonga/table_create/array.test +1 -1
- data/test/command/suite/groonga/table_create/hash.test +1 -1
- data/test/command/suite/groonga/table_list/success.test +2 -2
- data/test/command/suite/groonga/table_remove/success.test +1 -1
- data/test/command/suite/groonga/table_remove/unknown-table.test +1 -1
- data/test/command/suite/message/error/unknown-type.expected +1 -1
- data/test/command/suite/message/error/unknown-type.test +1 -1
- data/test/command/suite/search/adjusters/multiple.catalog.json +1 -1
- data/test/command/suite/search/adjusters/multiple.test +3 -3
- data/test/command/suite/search/adjusters/one.catalog.json +1 -1
- data/test/command/suite/search/adjusters/one.test +3 -3
- data/test/command/suite/search/attributes/array.expected +7 -0
- data/test/command/suite/search/attributes/array.test +1 -1
- data/test/command/suite/search/attributes/hash.expected +18 -0
- data/test/command/suite/search/attributes/hash.test +1 -1
- data/test/command/suite/search/complex.expected +12 -0
- data/test/command/suite/search/complex.test +1 -1
- data/test/command/suite/search/condition/nested.catalog.json +37 -0
- data/test/command/suite/search/condition/nested.expected +7 -0
- data/test/command/suite/search/condition/nested.test +103 -2
- data/test/command/suite/search/condition/query.catalog.json +37 -0
- data/test/command/suite/search/condition/query.expected +7 -0
- data/test/command/suite/search/condition/query.test +103 -2
- data/test/command/suite/search/condition/query/nonexistent_column.catalog.json +1 -1
- data/test/command/suite/search/condition/query/nonexistent_column.test +2 -2
- data/test/command/suite/search/condition/query/syntax_error.catalog.json +1 -1
- data/test/command/suite/search/condition/query/syntax_error.test +2 -2
- data/test/command/suite/search/condition/script.catalog.json +37 -0
- data/test/command/suite/search/condition/script.expected +7 -0
- data/test/command/suite/search/condition/script.test +103 -2
- data/test/command/suite/search/error/cyclic-source.test +1 -1
- data/test/command/suite/search/error/deeply-cyclic-source.test +1 -1
- data/test/command/suite/search/error/missing-source-parameter.test +1 -1
- data/test/command/suite/search/error/no-query.test +1 -1
- data/test/command/suite/search/error/unknown-source.test +1 -1
- data/test/command/suite/search/group/count.test +1 -1
- data/test/command/suite/search/group/limit.test +1 -1
- data/test/command/suite/search/group/string.catalog.json +41 -0
- data/test/command/suite/search/group/string.expected +18 -18
- data/test/command/suite/search/group/string.test +67 -22
- data/test/command/suite/search/group/subrecord/with-sort.catalog.json +1 -1
- data/test/command/suite/search/group/subrecord/with-sort.test +5 -5
- data/test/command/suite/search/multiple/chained.catalog.json +37 -0
- data/test/command/suite/search/multiple/chained.expected +14 -0
- data/test/command/suite/search/multiple/chained.test +103 -2
- data/test/command/suite/search/multiple/parallel.expected +14 -0
- data/test/command/suite/search/multiple/parallel.test +1 -1
- data/test/command/suite/search/output/attributes/invalid.catalog.json +1 -1
- data/test/command/suite/search/output/attributes/invalid.test +2 -2
- data/test/command/suite/search/output/attributes/star.catalog.json +23 -0
- data/test/command/suite/search/output/attributes/star.expected +27 -0
- data/test/command/suite/search/output/attributes/star.test +32 -0
- data/test/command/suite/search/range/only-output.expected +7 -0
- data/test/command/suite/search/range/only-output.test +1 -1
- data/test/command/suite/search/range/only-sort.expected +7 -0
- data/test/command/suite/search/range/only-sort.test +1 -1
- data/test/command/suite/search/range/sort-and-output.expected +7 -0
- data/test/command/suite/search/range/sort-and-output.test +1 -1
- data/test/command/suite/search/range/too-large-output-offset.expected +8 -0
- data/test/command/suite/search/range/too-large-output-offset.test +1 -1
- data/test/command/suite/search/range/too-large-sort-offset.expected +8 -0
- data/test/command/suite/search/range/too-large-sort-offset.test +1 -1
- data/test/command/suite/search/response/elapsed_time.catalog.json +1 -1
- data/test/command/suite/search/response/elapsed_time.test +2 -2
- data/test/command/suite/search/response/records/value/time.expected +12 -0
- data/test/command/suite/search/response/records/value/time.test +1 -1
- data/test/command/suite/search/simple.expected +12 -0
- data/test/command/suite/search/simple.test +1 -1
- data/test/command/suite/search/sort/default-offset-limit.expected +7 -0
- data/test/command/suite/search/sort/default-offset-limit.test +1 -1
- data/test/command/suite/search/sort/invisible-column.expected +7 -0
- data/test/command/suite/search/sort/invisible-column.test +1 -1
- data/test/unit/catalog/test_collection_volume.rb +16 -0
- data/test/unit/catalog/test_dataset.rb +36 -0
- data/test/unit/catalog/test_single_volume.rb +9 -0
- data/test/unit/catalog/test_slice.rb +11 -0
- data/test/unit/catalog/test_version1.rb +7 -12
- data/test/unit/catalog/test_version2.rb +7 -0
- data/test/unit/catalog/test_volume_collection.rb +28 -0
- data/test/unit/fixtures/catalog/version1.json +10 -3
- data/test/unit/fixtures/catalog/version2.json +2 -2
- data/test/unit/plugins/groonga/select/test_adapter_output.rb +8 -14
- data/test/unit/plugins/groonga/test_column_create.rb +5 -5
- data/test/unit/plugins/groonga/test_column_remove.rb +2 -2
- data/test/unit/plugins/groonga/test_column_rename.rb +2 -2
- data/test/unit/plugins/groonga/test_delete.rb +2 -2
- data/test/unit/plugins/groonga/test_table_create.rb +9 -9
- data/test/unit/plugins/groonga/test_table_remove.rb +1 -1
- data/test/unit/test_catalog_generator.rb +1 -1
- data/test/unit/test_schema_applier.rb +2 -2
- data/test/unit/test_watch_schema.rb +4 -4
- metadata +241 -72
- data/lib/droonga/engine/command/droonga_engine.rb +0 -441
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"type": "table_create",
|
3
|
-
"dataset": "
|
3
|
+
"dataset": "Default",
|
4
4
|
"body": {
|
5
5
|
"name" : "User",
|
6
6
|
"flags" : "TABLE_PAT_KEY"
|
@@ -8,7 +8,7 @@
|
|
8
8
|
}
|
9
9
|
{
|
10
10
|
"type": "delete",
|
11
|
-
"dataset": "
|
11
|
+
"dataset": "Default",
|
12
12
|
"body": {
|
13
13
|
"table" : "User",
|
14
14
|
"key" : "key",
|
@@ -1,7 +1,7 @@
|
|
1
1
|
#@include fixture/user-table.jsons
|
2
2
|
{
|
3
3
|
"type": "add",
|
4
|
-
"dataset": "
|
4
|
+
"dataset": "Default",
|
5
5
|
"body": {
|
6
6
|
"table" : "User",
|
7
7
|
"key" : "key",
|
@@ -11,7 +11,7 @@
|
|
11
11
|
}
|
12
12
|
{
|
13
13
|
"type": "delete",
|
14
|
-
"dataset": "
|
14
|
+
"dataset": "Default",
|
15
15
|
"body": {
|
16
16
|
"table" : "User",
|
17
17
|
"filter" : "_key @^ \"key\""
|
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"type": "table_create",
|
3
|
-
"dataset": "
|
3
|
+
"dataset": "Default",
|
4
4
|
"body": {
|
5
5
|
"name" : "User",
|
6
6
|
"flags" : "TABLE_PAT_KEY"
|
@@ -8,7 +8,7 @@
|
|
8
8
|
}
|
9
9
|
{
|
10
10
|
"type": "delete",
|
11
|
-
"dataset": "
|
11
|
+
"dataset": "Default",
|
12
12
|
"body": {
|
13
13
|
"table" : "User"
|
14
14
|
}
|
@@ -1,7 +1,7 @@
|
|
1
1
|
#@include fixture/user-table.jsons
|
2
2
|
{
|
3
3
|
"type": "add",
|
4
|
-
"dataset": "
|
4
|
+
"dataset": "Default",
|
5
5
|
"body": {
|
6
6
|
"table" : "User",
|
7
7
|
"key" : "key",
|
@@ -11,7 +11,7 @@
|
|
11
11
|
}
|
12
12
|
{
|
13
13
|
"type": "delete",
|
14
|
-
"dataset": "
|
14
|
+
"dataset": "Default",
|
15
15
|
"body": {
|
16
16
|
"table" : "User",
|
17
17
|
"key" : "key"
|
@@ -14,7 +14,30 @@
|
|
14
14
|
0
|
15
15
|
],
|
16
16
|
[
|
17
|
-
|
17
|
+
[
|
18
|
+
"_id",
|
19
|
+
"UInt32"
|
20
|
+
],
|
21
|
+
[
|
22
|
+
"_key",
|
23
|
+
"ShortText"
|
24
|
+
],
|
25
|
+
[
|
26
|
+
"age",
|
27
|
+
"Int32"
|
28
|
+
],
|
29
|
+
[
|
30
|
+
"birthday",
|
31
|
+
"Time"
|
32
|
+
],
|
33
|
+
[
|
34
|
+
"email",
|
35
|
+
"ShortText"
|
36
|
+
],
|
37
|
+
[
|
38
|
+
"name",
|
39
|
+
"ShortText"
|
40
|
+
]
|
18
41
|
]
|
19
42
|
]
|
20
43
|
]
|
@@ -0,0 +1,37 @@
|
|
1
|
+
{
|
2
|
+
"inReplyTo": "request-id",
|
3
|
+
"statusCode": 200,
|
4
|
+
"type": "select.result",
|
5
|
+
"body": [
|
6
|
+
[
|
7
|
+
0,
|
8
|
+
0.0,
|
9
|
+
0.0
|
10
|
+
],
|
11
|
+
[
|
12
|
+
[
|
13
|
+
[
|
14
|
+
2
|
15
|
+
],
|
16
|
+
[
|
17
|
+
[
|
18
|
+
"_key",
|
19
|
+
"ShortText"
|
20
|
+
],
|
21
|
+
[
|
22
|
+
"created_at",
|
23
|
+
"Time"
|
24
|
+
]
|
25
|
+
],
|
26
|
+
[
|
27
|
+
"Droonga is fun",
|
28
|
+
1401170395.0
|
29
|
+
],
|
30
|
+
[
|
31
|
+
"Ruby is also fun",
|
32
|
+
1401341365.0
|
33
|
+
]
|
34
|
+
]
|
35
|
+
]
|
36
|
+
]
|
37
|
+
}
|
@@ -0,0 +1,35 @@
|
|
1
|
+
# -*- js -*-
|
2
|
+
#@require-catalog-version 2
|
3
|
+
#@disable-logging
|
4
|
+
{
|
5
|
+
"type": "add",
|
6
|
+
"dataset": "Default",
|
7
|
+
"body": {
|
8
|
+
"table": "Memos",
|
9
|
+
"key": "Droonga is fun",
|
10
|
+
"values": {
|
11
|
+
"created_at": "2014-05-27T14:59:55+09:00"
|
12
|
+
}
|
13
|
+
}
|
14
|
+
}
|
15
|
+
{
|
16
|
+
"type": "add",
|
17
|
+
"dataset": "Default",
|
18
|
+
"body": {
|
19
|
+
"table": "Memos",
|
20
|
+
"key": "Ruby is also fun",
|
21
|
+
"values": {
|
22
|
+
"created_at": "2014-05-29T14:29:25+09:00"
|
23
|
+
}
|
24
|
+
}
|
25
|
+
}
|
26
|
+
#@enable-logging
|
27
|
+
{
|
28
|
+
"type": "select",
|
29
|
+
"dataset": "Default",
|
30
|
+
"body": {
|
31
|
+
"table": "Memos",
|
32
|
+
"output_columns": "_key, created_at",
|
33
|
+
"sortby": "_key"
|
34
|
+
}
|
35
|
+
}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"type": "table_create",
|
3
|
-
"dataset": "
|
3
|
+
"dataset": "Default",
|
4
4
|
"body": {
|
5
5
|
"name" : "User",
|
6
6
|
"flags" : "TABLE_PAT_KEY"
|
@@ -8,7 +8,7 @@
|
|
8
8
|
}
|
9
9
|
{
|
10
10
|
"type": "table_list",
|
11
|
-
"dataset": "
|
11
|
+
"dataset": "Default",
|
12
12
|
"body": {
|
13
13
|
"table" : "User"
|
14
14
|
}
|
@@ -3,7 +3,7 @@
|
|
3
3
|
#@disable-logging
|
4
4
|
{
|
5
5
|
"type": "add",
|
6
|
-
"dataset": "
|
6
|
+
"dataset": "Default",
|
7
7
|
"body": {
|
8
8
|
"table": "Memos",
|
9
9
|
"key": "Droonga is fun.",
|
@@ -23,7 +23,7 @@
|
|
23
23
|
}
|
24
24
|
{
|
25
25
|
"type": "add",
|
26
|
-
"dataset": "
|
26
|
+
"dataset": "Default",
|
27
27
|
"body": {
|
28
28
|
"table": "Memos",
|
29
29
|
"key": "Groonga is fast!",
|
@@ -40,7 +40,7 @@
|
|
40
40
|
#@enable-logging
|
41
41
|
{
|
42
42
|
"type": "search",
|
43
|
-
"dataset": "
|
43
|
+
"dataset": "Default",
|
44
44
|
"body": {
|
45
45
|
"queries": {
|
46
46
|
"memos": {
|
@@ -3,7 +3,7 @@
|
|
3
3
|
#@disable-logging
|
4
4
|
{
|
5
5
|
"type": "add",
|
6
|
-
"dataset": "
|
6
|
+
"dataset": "Default",
|
7
7
|
"body": {
|
8
8
|
"table": "Memos",
|
9
9
|
"key": "Droonga is fun.",
|
@@ -19,7 +19,7 @@
|
|
19
19
|
}
|
20
20
|
{
|
21
21
|
"type": "add",
|
22
|
-
"dataset": "
|
22
|
+
"dataset": "Default",
|
23
23
|
"body": {
|
24
24
|
"table": "Memos",
|
25
25
|
"key": "Groonga is fast!",
|
@@ -36,7 +36,7 @@
|
|
36
36
|
#@enable-logging
|
37
37
|
{
|
38
38
|
"type": "search",
|
39
|
-
"dataset": "
|
39
|
+
"dataset": "Default",
|
40
40
|
"body": {
|
41
41
|
"queries": {
|
42
42
|
"memos": {
|
@@ -5,6 +5,24 @@
|
|
5
5
|
"body": {
|
6
6
|
"result": {
|
7
7
|
"count": 9,
|
8
|
+
"attributes": [
|
9
|
+
{
|
10
|
+
"name": "section-id",
|
11
|
+
"type": "ShortText",
|
12
|
+
"vector": false
|
13
|
+
},
|
14
|
+
{
|
15
|
+
"name": "label",
|
16
|
+
"type": "ShortText",
|
17
|
+
"vector": false
|
18
|
+
},
|
19
|
+
{
|
20
|
+
"name": "fixed-number"
|
21
|
+
},
|
22
|
+
{
|
23
|
+
"name": "fixed-string"
|
24
|
+
}
|
25
|
+
],
|
8
26
|
"records": [
|
9
27
|
{
|
10
28
|
"section-id": "1.1",
|