droonga-engine 1.0.9 → 1.1.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/.travis.yml +1 -0
- data/benchmark/timer-watcher/benchmark.rb +44 -0
- data/bin/droonga-engine-absorb-data +246 -187
- data/bin/droonga-engine-catalog-generate +12 -12
- data/bin/droonga-engine-catalog-modify +4 -4
- data/bin/droonga-engine-join +352 -171
- data/bin/droonga-engine-set-role +54 -0
- data/bin/droonga-engine-unjoin +107 -112
- data/droonga-engine.gemspec +3 -3
- data/install.sh +55 -36
- data/install/centos/functions.sh +2 -2
- data/install/debian/functions.sh +2 -2
- data/lib/droonga/address.rb +26 -24
- data/lib/droonga/buffered_tcp_socket.rb +65 -10
- data/lib/droonga/catalog/base.rb +9 -6
- data/lib/droonga/catalog/dataset.rb +17 -41
- data/lib/droonga/catalog/fetcher.rb +64 -0
- data/lib/droonga/catalog/generator.rb +245 -0
- data/lib/droonga/catalog/loader.rb +66 -0
- data/lib/droonga/{catalog_modifier.rb → catalog/modifier.rb} +11 -18
- data/lib/droonga/catalog/replicas_volume.rb +123 -0
- data/lib/droonga/catalog/schema.rb +37 -37
- data/lib/droonga/catalog/single_volume.rb +11 -3
- data/lib/droonga/catalog/slice.rb +10 -6
- data/lib/droonga/catalog/{collection_volume.rb → slices_volume.rb} +47 -11
- data/lib/droonga/catalog/version1.rb +47 -19
- data/lib/droonga/catalog/version2.rb +11 -10
- data/lib/droonga/catalog/version2_validator.rb +4 -4
- data/lib/droonga/catalog/volume.rb +17 -5
- data/lib/droonga/changable.rb +25 -0
- data/lib/droonga/cluster.rb +237 -0
- data/lib/droonga/collector_runner.rb +4 -0
- data/lib/droonga/collectors.rb +2 -1
- data/lib/droonga/collectors/recursive_sum.rb +26 -0
- data/lib/droonga/command/droonga_engine.rb +404 -127
- data/lib/droonga/command/droonga_engine_service.rb +47 -11
- data/lib/droonga/command/droonga_engine_worker.rb +21 -1
- data/lib/droonga/command/remote_command_base.rb +78 -0
- data/lib/droonga/command/serf_event_handler.rb +29 -20
- data/lib/droonga/data_absorber_client.rb +222 -0
- data/lib/droonga/database_scanner.rb +106 -0
- data/lib/droonga/{live_nodes_list_loader.rb → deferrable.rb} +11 -24
- data/lib/droonga/differ.rb +58 -0
- data/lib/droonga/dispatcher.rb +155 -32
- data/lib/droonga/distributed_command_planner.rb +9 -11
- data/lib/droonga/engine.rb +83 -78
- data/lib/droonga/engine/version.rb +1 -1
- data/lib/droonga/engine_node.rb +301 -0
- data/lib/droonga/engine_state.rb +62 -40
- data/lib/droonga/farm.rb +44 -5
- data/lib/droonga/file_observer.rb +16 -12
- data/lib/droonga/fluent_message_receiver.rb +98 -29
- data/lib/droonga/fluent_message_sender.rb +30 -23
- data/lib/droonga/forward_buffer.rb +160 -0
- data/lib/droonga/forwarder.rb +73 -40
- data/lib/droonga/handler.rb +7 -6
- data/lib/droonga/handler_messenger.rb +15 -6
- data/lib/droonga/handler_runner.rb +6 -1
- data/lib/droonga/internal_fluent_message_receiver.rb +28 -8
- data/lib/droonga/job_pusher.rb +10 -7
- data/lib/droonga/job_receiver.rb +6 -4
- data/lib/droonga/logger.rb +7 -1
- data/lib/droonga/node_name.rb +90 -0
- data/lib/droonga/node_role.rb +72 -0
- data/lib/droonga/path.rb +34 -9
- data/lib/droonga/planner.rb +73 -7
- data/lib/droonga/plugin/async_command.rb +154 -0
- data/lib/droonga/plugins/catalog.rb +1 -0
- data/lib/droonga/plugins/crud.rb +22 -6
- data/lib/droonga/plugins/dump.rb +66 -135
- data/lib/droonga/plugins/groonga/delete.rb +13 -0
- data/lib/droonga/plugins/search/distributed_search_planner.rb +4 -4
- data/lib/droonga/plugins/system.rb +5 -26
- data/lib/droonga/plugins/system/absorb_data.rb +405 -0
- data/lib/droonga/plugins/system/statistics.rb +71 -0
- data/lib/droonga/plugins/system/status.rb +53 -0
- data/lib/droonga/process_control_protocol.rb +3 -1
- data/lib/droonga/process_supervisor.rb +32 -15
- data/lib/droonga/reducer.rb +69 -0
- data/lib/droonga/safe_file_writer.rb +1 -1
- data/lib/droonga/serf.rb +207 -276
- data/lib/droonga/serf/agent.rb +228 -0
- data/lib/droonga/serf/command.rb +94 -0
- data/lib/droonga/serf/downloader.rb +120 -0
- data/lib/droonga/serf/remote_command.rb +348 -0
- data/lib/droonga/serf/tag.rb +56 -0
- data/lib/droonga/service_installation.rb +2 -2
- data/lib/droonga/session.rb +49 -1
- data/lib/droonga/single_step.rb +6 -11
- data/lib/droonga/single_step_definition.rb +32 -1
- data/lib/droonga/slice.rb +14 -9
- data/lib/droonga/supervisor.rb +27 -20
- data/lib/droonga/test/stub_handler_messenger.rb +2 -1
- data/lib/droonga/timestamp.rb +69 -0
- data/lib/droonga/worker_process_agent.rb +33 -15
- data/sample/cluster-state.json +8 -0
- data/sample/cluster/Rakefile +30 -6
- data/test/command/fixture/integer-key-table.jsons +11 -0
- data/test/command/fixture/string-key-table.jsons +11 -0
- data/test/command/run-test.rb +4 -0
- data/test/command/suite/add/error/invalid-integer.expected +3 -3
- data/test/command/suite/add/error/invalid-time.expected +3 -3
- data/test/command/suite/add/{minimum.expected → key-integer.expected} +0 -0
- data/test/command/suite/add/{minimum.test → key-integer.test} +0 -0
- data/test/command/suite/add/key-string.expected +6 -0
- data/test/command/suite/add/key-string.test +9 -0
- data/test/command/suite/add/mismatched-key-type/acceptable/integer-for-string.expected +6 -0
- data/test/command/suite/add/mismatched-key-type/acceptable/integer-for-string.test +9 -0
- data/test/command/suite/add/mismatched-key-type/acceptable/string-for-integer.expected +6 -0
- data/test/command/suite/add/mismatched-key-type/acceptable/string-for-integer.test +9 -0
- data/test/command/suite/add/without-values.expected +6 -0
- data/test/command/suite/add/without-values.test +11 -0
- data/test/command/suite/dump/column/index.expected +33 -1
- data/test/command/suite/dump/column/index.test +1 -0
- data/test/command/suite/dump/column/scalar.expected +29 -1
- data/test/command/suite/dump/column/scalar.test +1 -0
- data/test/command/suite/dump/column/vector.expected +29 -1
- data/test/command/suite/dump/column/vector.test +1 -0
- data/test/command/suite/dump/record/scalar.catalog.json +12 -0
- data/test/command/suite/dump/record/scalar.expected +84 -0
- data/test/command/suite/dump/record/scalar.test +16 -0
- data/test/command/suite/dump/record/vector/reference.expected +83 -1
- data/test/command/suite/dump/record/vector/reference.test +1 -0
- data/test/command/suite/dump/table/array.expected +27 -1
- data/test/command/suite/dump/table/array.test +1 -0
- data/test/command/suite/dump/table/double_array_trie.expected +27 -1
- data/test/command/suite/dump/table/double_array_trie.test +1 -0
- data/test/command/suite/dump/table/hash.expected +27 -1
- data/test/command/suite/dump/table/hash.test +1 -0
- data/test/command/suite/dump/table/patricia_trie.expected +27 -1
- data/test/command/suite/dump/table/patricia_trie.test +1 -0
- data/test/command/suite/groonga/delete/{success.expected → key-integer.expected} +0 -0
- data/test/command/suite/groonga/delete/key-integer.test +17 -0
- data/test/command/suite/groonga/delete/key-string.expected +19 -0
- data/test/command/suite/groonga/delete/{success.test → key-string.test} +4 -6
- data/test/command/suite/groonga/delete/mismatched-type-key/acceptable/integer-for-string.expected +19 -0
- data/test/command/suite/groonga/delete/mismatched-type-key/acceptable/integer-for-string.test +17 -0
- data/test/command/suite/groonga/delete/mismatched-type-key/acceptable/string-for-integer.expected +19 -0
- data/test/command/suite/groonga/delete/mismatched-type-key/acceptable/string-for-integer.test +17 -0
- data/test/command/suite/message/error/missing-dataset.test +1 -0
- data/test/command/suite/system/absorb-data/records.catalog.json +58 -0
- data/test/command/suite/system/absorb-data/records.expected +32 -0
- data/test/command/suite/system/absorb-data/records.test +24 -0
- data/test/command/suite/system/statistics/object/count/empty.expected +11 -0
- data/test/command/suite/system/statistics/object/count/empty.test +12 -0
- data/test/command/suite/system/statistics/object/count/per-volume/empty.catalog.json +36 -0
- data/test/command/suite/system/statistics/object/count/per-volume/empty.expected +19 -0
- data/test/command/suite/system/statistics/object/count/per-volume/empty.test +12 -0
- data/test/command/suite/system/statistics/object/count/per-volume/record.catalog.json +40 -0
- data/test/command/suite/system/statistics/object/count/per-volume/record.expected +19 -0
- data/test/command/suite/system/statistics/object/count/per-volume/record.test +23 -0
- data/test/command/suite/system/statistics/object/count/per-volume/schema.catalog.json +40 -0
- data/test/command/suite/system/statistics/object/count/per-volume/schema.expected +19 -0
- data/test/command/suite/system/statistics/object/count/per-volume/schema.test +13 -0
- data/test/command/suite/system/statistics/object/count/record.catalog.json +12 -0
- data/test/command/suite/system/statistics/object/count/record.expected +11 -0
- data/test/command/suite/system/statistics/object/count/record.test +23 -0
- data/test/command/suite/system/statistics/object/count/schema.catalog.json +12 -0
- data/test/command/suite/system/statistics/object/count/schema.expected +11 -0
- data/test/command/suite/system/statistics/object/count/schema.test +13 -0
- data/test/command/suite/system/status.expected +3 -2
- data/test/unit/catalog/test_dataset.rb +4 -1
- data/test/unit/{test_catalog_generator.rb → catalog/test_generator.rb} +2 -2
- data/test/unit/catalog/test_replicas_volume.rb +79 -0
- data/test/unit/catalog/test_single_volume.rb +2 -2
- data/test/unit/catalog/test_slice.rb +33 -1
- data/test/unit/catalog/{test_collection_volume.rb → test_slices_volume.rb} +72 -11
- data/test/unit/catalog/test_version2.rb +3 -0
- data/test/unit/helper/distributed_search_planner_helper.rb +2 -2
- data/test/unit/plugins/catalog/test_fetch.rb +4 -4
- data/test/unit/plugins/crud/test_add.rb +44 -4
- data/test/unit/plugins/groonga/test_column_create.rb +4 -4
- data/test/unit/plugins/groonga/test_column_list.rb +4 -4
- data/test/unit/plugins/groonga/test_column_remove.rb +4 -4
- data/test/unit/plugins/groonga/test_column_rename.rb +4 -4
- data/test/unit/plugins/groonga/test_delete.rb +73 -10
- data/test/unit/plugins/groonga/test_table_create.rb +4 -4
- data/test/unit/plugins/groonga/test_table_list.rb +4 -4
- data/test/unit/plugins/groonga/test_table_remove.rb +4 -4
- data/test/unit/plugins/search/test_handler.rb +4 -4
- data/test/unit/plugins/search/test_planner.rb +4 -2
- data/test/unit/plugins/system/test_status.rb +31 -15
- data/test/unit/plugins/test_watch.rb +16 -16
- data/test/unit/test_address.rb +4 -4
- metadata +134 -35
- data/lib/droonga/catalog/volume_collection.rb +0 -79
- data/lib/droonga/catalog_fetcher.rb +0 -53
- data/lib/droonga/catalog_generator.rb +0 -243
- data/lib/droonga/catalog_loader.rb +0 -56
- data/lib/droonga/command/remote.rb +0 -404
- data/lib/droonga/data_absorber.rb +0 -264
- data/lib/droonga/node_status.rb +0 -71
- data/lib/droonga/serf_downloader.rb +0 -115
- data/test/unit/catalog/test_volume_collection.rb +0 -78
|
@@ -17,12 +17,13 @@ module Droonga
|
|
|
17
17
|
module Test
|
|
18
18
|
class StubHandlerMessenger
|
|
19
19
|
attr_reader :values, :messages
|
|
20
|
-
attr_accessor :engine_state
|
|
20
|
+
attr_accessor :engine_state, :cluster
|
|
21
21
|
|
|
22
22
|
def initialize
|
|
23
23
|
@values = []
|
|
24
24
|
@messages = []
|
|
25
25
|
@engine_state = nil
|
|
26
|
+
@cluster = nil
|
|
26
27
|
end
|
|
27
28
|
|
|
28
29
|
def emit(value)
|
|
@@ -0,0 +1,69 @@
|
|
|
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
|
+
require "time"
|
|
17
|
+
|
|
18
|
+
require "droonga/path"
|
|
19
|
+
require "droonga/safe_file_writer"
|
|
20
|
+
require "droonga/file_observer"
|
|
21
|
+
|
|
22
|
+
module Droonga
|
|
23
|
+
module Timestamp
|
|
24
|
+
MICRO_SECONDS_DECIMAL_PLACE = 6
|
|
25
|
+
|
|
26
|
+
class << self
|
|
27
|
+
def stringify(timestamp)
|
|
28
|
+
timestamp.utc.iso8601(MICRO_SECONDS_DECIMAL_PLACE)
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
def last_message_timestamp=(timestamp)
|
|
32
|
+
if timestamp.is_a?(String)
|
|
33
|
+
timestamp = timestamp.strip
|
|
34
|
+
if timestamp.empty?
|
|
35
|
+
timestamp = nil
|
|
36
|
+
else
|
|
37
|
+
timestamp = Time.parse(timestamp)
|
|
38
|
+
end
|
|
39
|
+
end
|
|
40
|
+
if timestamp
|
|
41
|
+
timestamp = stringify(timestamp)
|
|
42
|
+
else
|
|
43
|
+
timestamp = ""
|
|
44
|
+
end
|
|
45
|
+
SafeFileWriter.write(Path.last_message_timestamp) do |output, file|
|
|
46
|
+
output.puts(timestamp)
|
|
47
|
+
end
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
def last_message_timestamp
|
|
51
|
+
file = Path.last_message_timestamp
|
|
52
|
+
return nil unless file.exist?
|
|
53
|
+
timestamp = file.read.strip
|
|
54
|
+
return nil if timestamp.nil? or timestamp.empty?
|
|
55
|
+
Time.parse(timestamp)
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
def run_last_message_timestamp_observer(loop, &block)
|
|
59
|
+
path = Path.last_message_timestamp
|
|
60
|
+
observer = FileObserver.new(loop, path)
|
|
61
|
+
observer.on_change = lambda do
|
|
62
|
+
yield(last_message_timestamp)
|
|
63
|
+
end
|
|
64
|
+
observer.start
|
|
65
|
+
observer
|
|
66
|
+
end
|
|
67
|
+
end
|
|
68
|
+
end
|
|
69
|
+
end
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Copyright (C) 2014 Droonga Project
|
|
1
|
+
# Copyright (C) 2014-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
|
|
@@ -28,14 +28,16 @@ module Droonga
|
|
|
28
28
|
@loop = loop
|
|
29
29
|
create_input(input)
|
|
30
30
|
create_output(output)
|
|
31
|
-
@on_ready = nil
|
|
32
|
-
@on_finish = nil
|
|
33
31
|
end
|
|
34
32
|
|
|
35
33
|
def start
|
|
36
34
|
logger.trace("start: start")
|
|
37
35
|
@loop.attach(@input)
|
|
36
|
+
# logger.trace("start: new input watcher attached",
|
|
37
|
+
# :watcher => @input)
|
|
38
38
|
@loop.attach(@output)
|
|
39
|
+
# logger.trace("start: new output watcher attached",
|
|
40
|
+
# :watcher => @output)
|
|
39
41
|
logger.trace("start: done")
|
|
40
42
|
end
|
|
41
43
|
|
|
@@ -46,11 +48,15 @@ module Droonga
|
|
|
46
48
|
output.write(Messages::FINISH)
|
|
47
49
|
output.on_write_complete do
|
|
48
50
|
output.close
|
|
51
|
+
logger.trace("stop: output detached",
|
|
52
|
+
:watcher => output)
|
|
49
53
|
end
|
|
50
54
|
end
|
|
51
55
|
if @input
|
|
52
56
|
@input, input = nil, @input
|
|
53
57
|
input.close
|
|
58
|
+
logger.trace("stop: input detached",
|
|
59
|
+
:watcher => input)
|
|
54
60
|
end
|
|
55
61
|
logger.trace("stop: done")
|
|
56
62
|
end
|
|
@@ -67,45 +73,49 @@ module Droonga
|
|
|
67
73
|
@on_stop_immediately = callback
|
|
68
74
|
end
|
|
69
75
|
|
|
76
|
+
def on_refresh_self_reference=(callback)
|
|
77
|
+
@on_refresh_self_reference = callback
|
|
78
|
+
end
|
|
79
|
+
|
|
80
|
+
def on_refresh_node_reference=(callback)
|
|
81
|
+
@on_refresh_node_reference = callback
|
|
82
|
+
end
|
|
83
|
+
|
|
70
84
|
private
|
|
71
85
|
def create_input(raw_input)
|
|
72
86
|
@input = Coolio::IO.new(raw_input)
|
|
73
|
-
on_read
|
|
87
|
+
@input.on_read do |data|
|
|
74
88
|
line_buffer = LineBuffer.new
|
|
75
89
|
line_buffer.feed(data) do |line|
|
|
90
|
+
logger.trace("line buffer feeded", :line => line);
|
|
76
91
|
case line
|
|
77
92
|
when Messages::STOP_GRACEFUL
|
|
78
93
|
on_stop_gracefully
|
|
79
94
|
when Messages::STOP_IMMEDIATELY
|
|
80
95
|
on_stop_immediately
|
|
96
|
+
when Messages::REFRESH_SELF_REFERENCE
|
|
97
|
+
on_refresh_self_reference
|
|
98
|
+
when Messages::REFRESH_NODE_REFERENCE
|
|
99
|
+
on_refresh_node_reference
|
|
81
100
|
end
|
|
82
101
|
end
|
|
83
102
|
end
|
|
84
|
-
@input.
|
|
85
|
-
on_read.call(data)
|
|
86
|
-
end
|
|
87
|
-
on_close = lambda do
|
|
103
|
+
@input.on_close do
|
|
88
104
|
if @input
|
|
89
105
|
@input = nil
|
|
90
106
|
on_stop_immediately
|
|
91
107
|
end
|
|
92
108
|
end
|
|
93
|
-
@input.on_close do
|
|
94
|
-
on_close.call
|
|
95
|
-
end
|
|
96
109
|
end
|
|
97
110
|
|
|
98
111
|
def create_output(raw_output)
|
|
99
112
|
@output = Coolio::IO.new(raw_output)
|
|
100
|
-
on_close
|
|
113
|
+
@output.on_close do
|
|
101
114
|
if @output
|
|
102
115
|
@output = nil
|
|
103
116
|
on_stop_immediately
|
|
104
117
|
end
|
|
105
118
|
end
|
|
106
|
-
@output.on_close do
|
|
107
|
-
on_close.call
|
|
108
|
-
end
|
|
109
119
|
end
|
|
110
120
|
|
|
111
121
|
def on_stop_gracefully
|
|
@@ -116,6 +126,14 @@ module Droonga
|
|
|
116
126
|
@on_stop_immediately.call if @on_stop_immediately
|
|
117
127
|
end
|
|
118
128
|
|
|
129
|
+
def on_refresh_self_reference
|
|
130
|
+
@on_refresh_self_reference.call if @on_refresh_self_reference
|
|
131
|
+
end
|
|
132
|
+
|
|
133
|
+
def on_refresh_node_reference
|
|
134
|
+
@on_refresh_node_reference.call if @on_refresh_node_reference
|
|
135
|
+
end
|
|
136
|
+
|
|
119
137
|
def log_tag
|
|
120
138
|
"worker_process_agent"
|
|
121
139
|
end
|
data/sample/cluster/Rakefile
CHANGED
|
@@ -17,6 +17,7 @@
|
|
|
17
17
|
|
|
18
18
|
require "pathname"
|
|
19
19
|
require "json"
|
|
20
|
+
require "yaml"
|
|
20
21
|
|
|
21
22
|
base_dir_path = Pathname.new(__FILE__).dirname
|
|
22
23
|
top_dir_path = base_dir_path.parent.parent
|
|
@@ -48,20 +49,22 @@ class DroongaEngine
|
|
|
48
49
|
rm_rf(working_dir_path.to_s)
|
|
49
50
|
mkdir_p(working_dir_path.to_s)
|
|
50
51
|
generate_catalog(node_ids)
|
|
52
|
+
generate_config
|
|
51
53
|
end
|
|
52
54
|
|
|
53
55
|
def start
|
|
54
56
|
@pid = spawn("droonga-engine",
|
|
55
|
-
"--base-dir", working_dir_path.to_s
|
|
56
|
-
"--host", host,
|
|
57
|
-
"--port", self.class.port.to_s,
|
|
58
|
-
"--pid-file", pid_file_path.to_s)
|
|
57
|
+
"--base-dir", working_dir_path.to_s)
|
|
59
58
|
end
|
|
60
59
|
|
|
61
60
|
def stop
|
|
62
61
|
Process.kill(:TERM, @pid)
|
|
63
62
|
Process.waitpid(@pid)
|
|
64
63
|
@pid = nil
|
|
64
|
+
if pid_path.exist?
|
|
65
|
+
pid = Integer(pid_path.read)
|
|
66
|
+
Process.kill(:TERM, pid)
|
|
67
|
+
end
|
|
65
68
|
end
|
|
66
69
|
|
|
67
70
|
def host
|
|
@@ -77,8 +80,16 @@ class DroongaEngine
|
|
|
77
80
|
working_dir_path + "catalog.json"
|
|
78
81
|
end
|
|
79
82
|
|
|
80
|
-
def
|
|
81
|
-
working_dir_path + "droonga-engine.
|
|
83
|
+
def config_path
|
|
84
|
+
working_dir_path + "droonga-engine.yaml"
|
|
85
|
+
end
|
|
86
|
+
|
|
87
|
+
def pid_path_base_name
|
|
88
|
+
"droonga-engine.pid"
|
|
89
|
+
end
|
|
90
|
+
|
|
91
|
+
def pid_path
|
|
92
|
+
working_dir_path + pid_path_base_name
|
|
82
93
|
end
|
|
83
94
|
|
|
84
95
|
def generate_catalog(node_ids)
|
|
@@ -91,6 +102,19 @@ class DroongaEngine
|
|
|
91
102
|
"--hosts", hosts.join(","),
|
|
92
103
|
"--port", self.class.port.to_s)
|
|
93
104
|
end
|
|
105
|
+
|
|
106
|
+
def generate_config
|
|
107
|
+
config = {
|
|
108
|
+
"host" => host,
|
|
109
|
+
"port" => self.class.port,
|
|
110
|
+
# "log_file" => "droonga-engine.log",
|
|
111
|
+
"log_level" => "info",
|
|
112
|
+
"pid_file" => pid_path_base_name,
|
|
113
|
+
}
|
|
114
|
+
config_path.open("w") do |file|
|
|
115
|
+
file.puts(config.to_yaml)
|
|
116
|
+
end
|
|
117
|
+
end
|
|
94
118
|
end
|
|
95
119
|
|
|
96
120
|
namespace :droonga do
|
data/test/command/run-test.rb
CHANGED
|
@@ -39,9 +39,13 @@ end
|
|
|
39
39
|
|
|
40
40
|
base_dir = File.dirname(__FILE__)
|
|
41
41
|
lib_dir = File.expand_path(File.join(base_dir, "..", "..", "lib"))
|
|
42
|
+
log_path = File.expand_path(File.join(base_dir, "tmp", "droonga-engine.log"))
|
|
42
43
|
|
|
43
44
|
drntest_options = []
|
|
44
45
|
drntest_options.concat(["--base-path", base_dir])
|
|
46
|
+
drntest_options.concat(["--droonga-engine-options",
|
|
47
|
+
["--log-file=#{log_path}",
|
|
48
|
+
"--internal-connection-lifetime=5"].join(" ")])
|
|
45
49
|
drntest_options.concat(ARGV)
|
|
46
50
|
|
|
47
51
|
run("bundle", "exec", "drntest", *drntest_options)
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"type": "add.result",
|
|
5
5
|
"body": {
|
|
6
6
|
"name": "InvalidValue",
|
|
7
|
-
"message": "The column \"age\" cannot store the value \"secret\".",
|
|
7
|
+
"message": "The column \"age\" cannot store the value \"secret\": invalid argument: <User.age>: failed to cast to <Int32>: <\"secret\">: #<Groonga::FixSizeColumn ...>",
|
|
8
8
|
"detail": {
|
|
9
9
|
"table": "User",
|
|
10
10
|
"key": "key",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"statusCode": 400,
|
|
19
19
|
"body": {
|
|
20
20
|
"name": "InvalidValue",
|
|
21
|
-
"message": "The column \"age\" cannot store the value \"secret\".",
|
|
21
|
+
"message": "The column \"age\" cannot store the value \"secret\": invalid argument: <User.age>: failed to cast to <Int32>: <\"secret\">: #<Groonga::FixSizeColumn ...>",
|
|
22
22
|
"detail": {
|
|
23
23
|
"table": "User",
|
|
24
24
|
"key": "key",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"statusCode": 400,
|
|
33
33
|
"body": {
|
|
34
34
|
"name": "InvalidValue",
|
|
35
|
-
"message": "The column \"age\" cannot store the value \"secret\".",
|
|
35
|
+
"message": "The column \"age\" cannot store the value \"secret\": invalid argument: <User.age>: failed to cast to <Int32>: <\"secret\">: #<Groonga::FixSizeColumn ...>",
|
|
36
36
|
"detail": {
|
|
37
37
|
"table": "User",
|
|
38
38
|
"key": "key",
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"type": "add.result",
|
|
5
5
|
"body": {
|
|
6
6
|
"name": "InvalidValue",
|
|
7
|
-
"message": "The column \"birthday\" cannot store the value \"today\"
|
|
7
|
+
"message": "The column \"birthday\" cannot store the value \"today\": no time information in \"today\"",
|
|
8
8
|
"detail": {
|
|
9
9
|
"table": "User",
|
|
10
10
|
"key": "key",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"statusCode": 400,
|
|
19
19
|
"body": {
|
|
20
20
|
"name": "InvalidValue",
|
|
21
|
-
"message": "The column \"birthday\" cannot store the value \"today\"
|
|
21
|
+
"message": "The column \"birthday\" cannot store the value \"today\": no time information in \"today\"",
|
|
22
22
|
"detail": {
|
|
23
23
|
"table": "User",
|
|
24
24
|
"key": "key",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"statusCode": 400,
|
|
33
33
|
"body": {
|
|
34
34
|
"name": "InvalidValue",
|
|
35
|
-
"message": "The column \"birthday\" cannot store the value \"today\"
|
|
35
|
+
"message": "The column \"birthday\" cannot store the value \"today\": no time information in \"today\"",
|
|
36
36
|
"detail": {
|
|
37
37
|
"table": "User",
|
|
38
38
|
"key": "key",
|
|
File without changes
|
|
File without changes
|