droonga-engine 1.1.0 → 1.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +2 -1
- data/Rakefile +6 -0
- data/bin/droonga-engine-absorb-data +14 -14
- data/bin/droonga-engine-catalog-generate +24 -12
- data/bin/droonga-engine-catalog-modify +13 -7
- data/bin/droonga-engine-join +8 -8
- data/bin/droonga-engine-set-role +1 -1
- data/bin/droonga-engine-unjoin +2 -2
- data/lib/droonga/address.rb +3 -0
- data/lib/droonga/cluster.rb +16 -10
- data/lib/droonga/command/droonga_engine_service.rb +5 -2
- data/lib/droonga/command/remote_command_base.rb +3 -3
- data/lib/droonga/distributed_command_planner.rb +11 -1
- data/lib/droonga/engine.rb +12 -11
- data/lib/droonga/engine/version.rb +2 -2
- data/lib/droonga/engine_node.rb +28 -28
- data/lib/droonga/engine_state.rb +41 -36
- data/lib/droonga/forward_buffer.rb +21 -10
- data/lib/droonga/node_role.rb +2 -0
- data/lib/droonga/plugins/groonga/select.rb +3 -0
- data/lib/droonga/plugins/search.rb +3 -1
- data/lib/droonga/plugins/search/distributed_search_planner.rb +17 -5
- data/lib/droonga/plugins/system/statistics.rb +1 -0
- data/lib/droonga/searcher.rb +13 -4
- data/test/command/config/single_slice/catalog.json +38 -0
- data/test/command/config/single_slice/droonga-engine.yaml +4 -0
- data/test/command/run-test.rb +3 -2
- data/test/command/suite/catalog/fetch.expected.single_slice +50 -0
- data/test/command/suite/dump/column/index.expected.single_slice +86 -0
- data/test/command/suite/dump/column/scalar.expected.single_slice +52 -0
- data/test/command/suite/dump/column/vector.expected.single_slice +55 -0
- data/test/command/suite/dump/record/scalar.expected.single_slice +52 -0
- data/test/command/suite/dump/record/vector/reference.expected.single_slice +117 -0
- data/test/command/suite/dump/table/array.expected.single_slice +39 -0
- data/test/command/suite/dump/table/double_array_trie.expected.single_slice +40 -0
- data/test/command/suite/dump/table/hash.expected.single_slice +40 -0
- data/test/command/suite/dump/table/patricia_trie.expected.single_slice +40 -0
- data/test/command/suite/message/error/missing-dataset.test +3 -0
- data/test/command/suite/search/condition/query/nonexistent_column.expected.single_slice +26 -0
- data/test/command/suite/search/condition/query/syntax_error.expected.single_slice +26 -0
- data/test/command/suite/search/error/unknown-source.expected.single_slice +28 -0
- data/test/command/suite/search/output/attributes/invalid.expected.single_slice +24 -0
- data/test/command/suite/system/absorb-data/records.catalog.json.single_slice +44 -0
- data/test/command/suite/system/absorb-data/records.expected.single_slice +32 -0
- data/test/command/suite/system/statistics/object/count/per-volume/empty.test +1 -0
- data/test/command/suite/system/statistics/object/count/record.expected.single_slice +11 -0
- data/test/command/suite/system/statistics/object/count/schema.expected.single_slice +11 -0
- data/test/unit/catalog/test_generator.rb +3 -2
- data/test/unit/helper.rb +2 -1
- data/test/unit/helper/stub_serf.rb +28 -0
- data/test/unit/plugins/system/statistics/test_object_count.rb +135 -0
- data/test/unit/plugins/system/statistics/test_object_count_per_volume.rb +149 -0
- data/test/unit/plugins/test_basic.rb +0 -406
- data/test/unit/test_address.rb +111 -10
- data/test/unit/test_cluster.rb +232 -0
- data/test/unit/test_differ.rb +49 -0
- data/test/unit/test_engine_node.rb +556 -0
- data/test/unit/test_engine_state.rb +151 -0
- data/test/unit/test_forward_buffer.rb +106 -0
- data/test/unit/test_node_name.rb +160 -0
- data/test/unit/test_node_role.rb +53 -0
- data/test/unit/test_reducer.rb +525 -0
- metadata +111 -49
@@ -0,0 +1,39 @@
|
|
1
|
+
{
|
2
|
+
"inReplyTo": "request-id",
|
3
|
+
"dataset": "Default",
|
4
|
+
"date": "0000-00-00T00:00:00.000000Z",
|
5
|
+
"type": "dump.start"
|
6
|
+
}
|
7
|
+
{
|
8
|
+
"inReplyTo": "request-id",
|
9
|
+
"statusCode": 200,
|
10
|
+
"type": "dump.result",
|
11
|
+
"body": {
|
12
|
+
"started": true
|
13
|
+
}
|
14
|
+
}
|
15
|
+
{
|
16
|
+
"inReplyTo": "request-id",
|
17
|
+
"dataset": "Default",
|
18
|
+
"date": "0000-00-00T00:00:00.000000Z",
|
19
|
+
"body": {
|
20
|
+
"nMessages": 1
|
21
|
+
},
|
22
|
+
"type": "dump.forecast"
|
23
|
+
}
|
24
|
+
{
|
25
|
+
"inReplyTo": "request-id",
|
26
|
+
"dataset": "Default",
|
27
|
+
"date": "0000-00-00T00:00:00.000000Z",
|
28
|
+
"body": {
|
29
|
+
"type": "Array",
|
30
|
+
"name": "Logs"
|
31
|
+
},
|
32
|
+
"type": "dump.table"
|
33
|
+
}
|
34
|
+
{
|
35
|
+
"inReplyTo": "request-id",
|
36
|
+
"dataset": "Default",
|
37
|
+
"date": "0000-00-00T00:00:00.000000Z",
|
38
|
+
"type": "dump.end"
|
39
|
+
}
|
@@ -0,0 +1,40 @@
|
|
1
|
+
{
|
2
|
+
"inReplyTo": "request-id",
|
3
|
+
"dataset": "Default",
|
4
|
+
"date": "0000-00-00T00:00:00.000000Z",
|
5
|
+
"type": "dump.start"
|
6
|
+
}
|
7
|
+
{
|
8
|
+
"inReplyTo": "request-id",
|
9
|
+
"statusCode": 200,
|
10
|
+
"type": "dump.result",
|
11
|
+
"body": {
|
12
|
+
"started": true
|
13
|
+
}
|
14
|
+
}
|
15
|
+
{
|
16
|
+
"inReplyTo": "request-id",
|
17
|
+
"dataset": "Default",
|
18
|
+
"date": "0000-00-00T00:00:00.000000Z",
|
19
|
+
"body": {
|
20
|
+
"nMessages": 1
|
21
|
+
},
|
22
|
+
"type": "dump.forecast"
|
23
|
+
}
|
24
|
+
{
|
25
|
+
"inReplyTo": "request-id",
|
26
|
+
"dataset": "Default",
|
27
|
+
"date": "0000-00-00T00:00:00.000000Z",
|
28
|
+
"body": {
|
29
|
+
"type": "DoubleArrayTrie",
|
30
|
+
"name": "Memos",
|
31
|
+
"keyType": "ShortText"
|
32
|
+
},
|
33
|
+
"type": "dump.table"
|
34
|
+
}
|
35
|
+
{
|
36
|
+
"inReplyTo": "request-id",
|
37
|
+
"dataset": "Default",
|
38
|
+
"date": "0000-00-00T00:00:00.000000Z",
|
39
|
+
"type": "dump.end"
|
40
|
+
}
|
@@ -0,0 +1,40 @@
|
|
1
|
+
{
|
2
|
+
"inReplyTo": "request-id",
|
3
|
+
"dataset": "Default",
|
4
|
+
"date": "0000-00-00T00:00:00.000000Z",
|
5
|
+
"type": "dump.start"
|
6
|
+
}
|
7
|
+
{
|
8
|
+
"inReplyTo": "request-id",
|
9
|
+
"statusCode": 200,
|
10
|
+
"type": "dump.result",
|
11
|
+
"body": {
|
12
|
+
"started": true
|
13
|
+
}
|
14
|
+
}
|
15
|
+
{
|
16
|
+
"inReplyTo": "request-id",
|
17
|
+
"dataset": "Default",
|
18
|
+
"date": "0000-00-00T00:00:00.000000Z",
|
19
|
+
"body": {
|
20
|
+
"nMessages": 1
|
21
|
+
},
|
22
|
+
"type": "dump.forecast"
|
23
|
+
}
|
24
|
+
{
|
25
|
+
"inReplyTo": "request-id",
|
26
|
+
"dataset": "Default",
|
27
|
+
"date": "0000-00-00T00:00:00.000000Z",
|
28
|
+
"body": {
|
29
|
+
"type": "Hash",
|
30
|
+
"name": "Memos",
|
31
|
+
"keyType": "ShortText"
|
32
|
+
},
|
33
|
+
"type": "dump.table"
|
34
|
+
}
|
35
|
+
{
|
36
|
+
"inReplyTo": "request-id",
|
37
|
+
"dataset": "Default",
|
38
|
+
"date": "0000-00-00T00:00:00.000000Z",
|
39
|
+
"type": "dump.end"
|
40
|
+
}
|
@@ -0,0 +1,40 @@
|
|
1
|
+
{
|
2
|
+
"inReplyTo": "request-id",
|
3
|
+
"dataset": "Default",
|
4
|
+
"date": "0000-00-00T00:00:00.000000Z",
|
5
|
+
"type": "dump.start"
|
6
|
+
}
|
7
|
+
{
|
8
|
+
"inReplyTo": "request-id",
|
9
|
+
"statusCode": 200,
|
10
|
+
"type": "dump.result",
|
11
|
+
"body": {
|
12
|
+
"started": true
|
13
|
+
}
|
14
|
+
}
|
15
|
+
{
|
16
|
+
"inReplyTo": "request-id",
|
17
|
+
"dataset": "Default",
|
18
|
+
"date": "0000-00-00T00:00:00.000000Z",
|
19
|
+
"body": {
|
20
|
+
"nMessages": 1
|
21
|
+
},
|
22
|
+
"type": "dump.forecast"
|
23
|
+
}
|
24
|
+
{
|
25
|
+
"inReplyTo": "request-id",
|
26
|
+
"dataset": "Default",
|
27
|
+
"date": "0000-00-00T00:00:00.000000Z",
|
28
|
+
"body": {
|
29
|
+
"type": "PatriciaTrie",
|
30
|
+
"name": "Memos",
|
31
|
+
"keyType": "ShortText"
|
32
|
+
},
|
33
|
+
"type": "dump.table"
|
34
|
+
}
|
35
|
+
{
|
36
|
+
"inReplyTo": "request-id",
|
37
|
+
"dataset": "Default",
|
38
|
+
"date": "0000-00-00T00:00:00.000000Z",
|
39
|
+
"type": "dump.end"
|
40
|
+
}
|
@@ -0,0 +1,26 @@
|
|
1
|
+
{
|
2
|
+
"inReplyTo": "request-id",
|
3
|
+
"statusCode": 400,
|
4
|
+
"type": "search.result",
|
5
|
+
"body": {
|
6
|
+
"name": "SyntaxError",
|
7
|
+
"message": "Syntax error: syntax:<query> input:<nonexistent:Droonga>",
|
8
|
+
"detail": {
|
9
|
+
"syntax": "query",
|
10
|
+
"input": "nonexistent:Droonga"
|
11
|
+
}
|
12
|
+
},
|
13
|
+
"errors": {
|
14
|
+
"sources0": {
|
15
|
+
"statusCode": 400,
|
16
|
+
"body": {
|
17
|
+
"name": "SyntaxError",
|
18
|
+
"message": "Syntax error: syntax:<query> input:<nonexistent:Droonga>",
|
19
|
+
"detail": {
|
20
|
+
"syntax": "query",
|
21
|
+
"input": "nonexistent:Droonga"
|
22
|
+
}
|
23
|
+
}
|
24
|
+
}
|
25
|
+
}
|
26
|
+
}
|
@@ -0,0 +1,26 @@
|
|
1
|
+
{
|
2
|
+
"inReplyTo": "request-id",
|
3
|
+
"statusCode": 400,
|
4
|
+
"type": "search.result",
|
5
|
+
"body": {
|
6
|
+
"name": "SyntaxError",
|
7
|
+
"message": "Syntax error: syntax:<query> input:<(>",
|
8
|
+
"detail": {
|
9
|
+
"syntax": "query",
|
10
|
+
"input": "("
|
11
|
+
}
|
12
|
+
},
|
13
|
+
"errors": {
|
14
|
+
"sources0": {
|
15
|
+
"statusCode": 400,
|
16
|
+
"body": {
|
17
|
+
"name": "SyntaxError",
|
18
|
+
"message": "Syntax error: syntax:<query> input:<(>",
|
19
|
+
"detail": {
|
20
|
+
"syntax": "query",
|
21
|
+
"input": "("
|
22
|
+
}
|
23
|
+
}
|
24
|
+
}
|
25
|
+
}
|
26
|
+
}
|
@@ -0,0 +1,28 @@
|
|
1
|
+
{
|
2
|
+
"inReplyTo": "request-id",
|
3
|
+
"statusCode": 404,
|
4
|
+
"type": "search.result",
|
5
|
+
"body": {
|
6
|
+
"name": "UnknownSource",
|
7
|
+
"message": "Source not found: <unknown> It must be a name of an existing table or another query.",
|
8
|
+
"detail": {
|
9
|
+
"unknown-source": {
|
10
|
+
"source": "unknown"
|
11
|
+
}
|
12
|
+
}
|
13
|
+
},
|
14
|
+
"errors": {
|
15
|
+
"sources0": {
|
16
|
+
"statusCode": 404,
|
17
|
+
"body": {
|
18
|
+
"name": "UnknownSource",
|
19
|
+
"message": "Source not found: <unknown> It must be a name of an existing table or another query.",
|
20
|
+
"detail": {
|
21
|
+
"unknown-source": {
|
22
|
+
"source": "unknown"
|
23
|
+
}
|
24
|
+
}
|
25
|
+
}
|
26
|
+
}
|
27
|
+
}
|
28
|
+
}
|
@@ -0,0 +1,24 @@
|
|
1
|
+
{
|
2
|
+
"inReplyTo": "request-id",
|
3
|
+
"statusCode": 400,
|
4
|
+
"type": "search.result",
|
5
|
+
"body": {
|
6
|
+
"name": "InvalidAttribute",
|
7
|
+
"message": "Invalid attribute: <,>",
|
8
|
+
"detail": {
|
9
|
+
"attribute": ","
|
10
|
+
}
|
11
|
+
},
|
12
|
+
"errors": {
|
13
|
+
"sources0": {
|
14
|
+
"statusCode": 400,
|
15
|
+
"body": {
|
16
|
+
"name": "InvalidAttribute",
|
17
|
+
"message": "Invalid attribute: <,>",
|
18
|
+
"detail": {
|
19
|
+
"attribute": ","
|
20
|
+
}
|
21
|
+
}
|
22
|
+
}
|
23
|
+
}
|
24
|
+
}
|
@@ -0,0 +1,44 @@
|
|
1
|
+
{
|
2
|
+
"datasets": {
|
3
|
+
"Default": {
|
4
|
+
},
|
5
|
+
"Source": {
|
6
|
+
"schema": {
|
7
|
+
"Users": {
|
8
|
+
"type": "PatriciaTrie",
|
9
|
+
"keyType": "ShortText"
|
10
|
+
}
|
11
|
+
},
|
12
|
+
"nWorkers": 2,
|
13
|
+
"plugins": ["groonga", "crud", "search", "dump", "system", "catalog"],
|
14
|
+
"replicas": [
|
15
|
+
{
|
16
|
+
"dimension": "_key",
|
17
|
+
"slicer": "hash",
|
18
|
+
"slices": [
|
19
|
+
{
|
20
|
+
"label": "slice020",
|
21
|
+
"weight": 100,
|
22
|
+
"volume": {
|
23
|
+
"address": "127.0.0.1:23003/droonga.020"
|
24
|
+
}
|
25
|
+
}
|
26
|
+
]
|
27
|
+
},
|
28
|
+
{
|
29
|
+
"dimension": "_key",
|
30
|
+
"slicer": "hash",
|
31
|
+
"slices": [
|
32
|
+
{
|
33
|
+
"label": "slice030",
|
34
|
+
"weight": 100,
|
35
|
+
"volume": {
|
36
|
+
"address": "127.0.0.1:23003/droonga.030"
|
37
|
+
}
|
38
|
+
}
|
39
|
+
]
|
40
|
+
}
|
41
|
+
]
|
42
|
+
}
|
43
|
+
}
|
44
|
+
}
|
@@ -0,0 +1,32 @@
|
|
1
|
+
{
|
2
|
+
"inReplyTo": "request-id",
|
3
|
+
"dataset": "Default",
|
4
|
+
"date": "0000-00-00T00:00:00.000000Z",
|
5
|
+
"type": "system.absorb-data.start"
|
6
|
+
}
|
7
|
+
{
|
8
|
+
"inReplyTo": "request-id",
|
9
|
+
"statusCode": 200,
|
10
|
+
"type": "system.absorb-data.result",
|
11
|
+
"body": {
|
12
|
+
"started": true
|
13
|
+
}
|
14
|
+
}
|
15
|
+
{
|
16
|
+
"inReplyTo": "request-id",
|
17
|
+
"dataset": "Default",
|
18
|
+
"date": "0000-00-00T00:00:00.000000Z",
|
19
|
+
"body": {
|
20
|
+
"nProcessedMessages": 2,
|
21
|
+
"nRestoredObjects": 2,
|
22
|
+
"percentage": 100,
|
23
|
+
"message": "100% done (maybe 00:00:00 remaining)"
|
24
|
+
},
|
25
|
+
"type": "system.absorb-data.progress"
|
26
|
+
}
|
27
|
+
{
|
28
|
+
"inReplyTo": "request-id",
|
29
|
+
"dataset": "Default",
|
30
|
+
"date": "0000-00-00T00:00:00.000000Z",
|
31
|
+
"type": "system.absorb-data.end"
|
32
|
+
}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright (C)
|
1
|
+
# Copyright (C) 2015 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
|
@@ -14,6 +14,7 @@
|
|
14
14
|
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
15
15
|
|
16
16
|
require "droonga/catalog/generator"
|
17
|
+
require "droonga/node_name"
|
17
18
|
|
18
19
|
class CatalogGeneratorTest < Test::Unit::TestCase
|
19
20
|
def setup
|
@@ -68,7 +69,7 @@ class CatalogGeneratorTest < Test::Unit::TestCase
|
|
68
69
|
"slices" => [
|
69
70
|
{
|
70
71
|
"volume" => {
|
71
|
-
"address" => "
|
72
|
+
"address" => "#{Droonga::NodeName::DEFAULT_HOST}:10031/droonga.000",
|
72
73
|
},
|
73
74
|
"weight" => 100,
|
74
75
|
},
|
data/test/unit/helper.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright (C) 2013-
|
1
|
+
# Copyright (C) 2013-2015 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
|
@@ -21,6 +21,7 @@ require_relative "helper/stub_worker"
|
|
21
21
|
require_relative "helper/plugin_helper"
|
22
22
|
require_relative "helper/watch_helper"
|
23
23
|
require_relative "helper/distributed_search_planner_helper"
|
24
|
+
require_relative "helper/stub_serf"
|
24
25
|
|
25
26
|
class Test::Unit::TestCase
|
26
27
|
include ::Sandbox
|
@@ -0,0 +1,28 @@
|
|
1
|
+
# Copyright (C) 2015 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
15
|
+
|
16
|
+
class StubSerf
|
17
|
+
def initialize
|
18
|
+
@have_unprocessed_messages_for = {}
|
19
|
+
end
|
20
|
+
|
21
|
+
def set_have_unprocessed_messages_for(target)
|
22
|
+
@have_unprocessed_messages_for[target] = true
|
23
|
+
end
|
24
|
+
|
25
|
+
def reset_have_unprocessed_messages_for(target)
|
26
|
+
@have_unprocessed_messages_for.delete(target)
|
27
|
+
end
|
28
|
+
end
|