droonga-engine 1.0.4 → 1.0.5
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 +3 -2
- data/Gemfile +1 -1
- data/LICENSE.txt +1 -1
- data/Rakefile +1 -1
- data/benchmark/benchmark.rb +1 -1
- data/benchmark/utils.rb +1 -1
- data/benchmark/watch/benchmark-notify.rb +1 -1
- data/benchmark/watch/benchmark-publish.rb +1 -1
- data/benchmark/watch/benchmark-scan.rb +1 -1
- data/bin/droonga-engine +1 -1
- data/bin/droonga-engine-absorb-data +48 -8
- data/bin/droonga-engine-catalog-generate +1 -1
- data/bin/droonga-engine-catalog-modify +1 -1
- data/bin/droonga-engine-data-publisher +66 -0
- data/bin/droonga-engine-join +72 -17
- data/bin/droonga-engine-serf-event-handler +1 -1
- data/bin/droonga-engine-service +1 -1
- data/bin/droonga-engine-unjoin +11 -4
- data/bin/droonga-engine-worker +20 -0
- data/doc/text/news.md +8 -0
- data/droonga-engine.gemspec +3 -3
- data/lib/droonga/adapter.rb +1 -1
- data/lib/droonga/adapter_runner.rb +1 -1
- data/lib/droonga/address.rb +69 -0
- data/lib/droonga/buffered_tcp_socket.rb +44 -22
- data/lib/droonga/catalog/base.rb +1 -1
- data/lib/droonga/catalog/collection_volume.rb +1 -1
- data/lib/droonga/catalog/dataset.rb +8 -8
- data/lib/droonga/catalog/errors.rb +1 -1
- data/lib/droonga/catalog/schema.rb +1 -1
- data/lib/droonga/catalog/single_volume.rb +6 -8
- data/lib/droonga/catalog/slice.rb +1 -1
- data/lib/droonga/catalog/version1.rb +2 -2
- data/lib/droonga/catalog/version2.rb +6 -6
- data/lib/droonga/catalog/version2_validator.rb +1 -1
- data/lib/droonga/catalog/volume.rb +1 -1
- data/lib/droonga/catalog/volume_collection.rb +2 -2
- data/lib/droonga/catalog_generator.rb +49 -53
- data/lib/droonga/catalog_loader.rb +1 -1
- data/lib/droonga/collector.rb +1 -1
- data/lib/droonga/collector_message.rb +1 -1
- data/lib/droonga/collector_runner.rb +1 -1
- data/lib/droonga/collectors/and.rb +1 -1
- data/lib/droonga/collectors/or.rb +1 -1
- data/lib/droonga/collectors/sum.rb +1 -1
- data/lib/droonga/collectors.rb +1 -1
- data/lib/droonga/command/droonga_engine.rb +103 -55
- data/lib/droonga/command/droonga_engine_service.rb +22 -67
- data/lib/droonga/command/droonga_engine_worker.rb +232 -0
- data/lib/droonga/command/serf_event_handler.rb +126 -46
- data/lib/droonga/data_absorber.rb +32 -14
- data/lib/droonga/dispatcher.rb +15 -11
- data/lib/droonga/distributed_command_planner.rb +1 -1
- data/lib/droonga/distributor.rb +1 -1
- data/lib/droonga/engine/version.rb +2 -2
- data/lib/droonga/engine.rb +8 -3
- data/lib/droonga/engine_state.rb +15 -6
- data/lib/droonga/error.rb +1 -1
- data/lib/droonga/error_messages.rb +1 -1
- data/lib/droonga/event_loop.rb +1 -1
- data/lib/droonga/farm.rb +9 -1
- data/lib/droonga/file_observer.rb +1 -1
- data/lib/droonga/fluent_message_receiver.rb +11 -5
- data/lib/droonga/fluent_message_sender.rb +14 -17
- data/lib/droonga/forwarder.rb +23 -13
- data/lib/droonga/handler.rb +1 -1
- data/lib/droonga/handler_message.rb +1 -1
- data/lib/droonga/handler_messenger.rb +2 -2
- data/lib/droonga/handler_runner.rb +2 -2
- data/lib/droonga/input_message.rb +1 -1
- data/lib/droonga/internal_fluent_message_receiver.rb +3 -2
- data/lib/droonga/job_protocol.rb +1 -1
- data/lib/droonga/job_pusher.rb +1 -1
- data/lib/droonga/job_receiver.rb +1 -1
- data/lib/droonga/line_buffer.rb +1 -1
- data/lib/droonga/live_nodes_list_loader.rb +1 -1
- data/lib/droonga/loggable.rb +1 -1
- data/lib/droonga/logger.rb +3 -3
- data/lib/droonga/message_matcher.rb +1 -1
- data/lib/droonga/output_message.rb +1 -1
- data/lib/droonga/path.rb +5 -1
- data/lib/droonga/planner.rb +1 -1
- data/lib/droonga/pluggable.rb +1 -1
- data/lib/droonga/plugin/metadata/adapter_input_message.rb +1 -1
- data/lib/droonga/plugin/metadata/adapter_output_message.rb +1 -1
- data/lib/droonga/plugin/metadata/collector_message.rb +1 -1
- data/lib/droonga/plugin/metadata/handler_action.rb +1 -1
- data/lib/droonga/plugin/metadata/input_message.rb +1 -1
- data/lib/droonga/plugin.rb +2 -1
- data/lib/droonga/plugin_loader.rb +1 -1
- data/lib/droonga/plugin_registry.rb +3 -1
- data/lib/droonga/plugins/basic.rb +1 -1
- data/lib/droonga/plugins/crud.rb +1 -1
- data/lib/droonga/plugins/dump.rb +13 -2
- data/lib/droonga/plugins/error.rb +1 -1
- data/lib/droonga/plugins/groonga/column_create.rb +1 -1
- data/lib/droonga/plugins/groonga/column_list.rb +1 -1
- data/lib/droonga/plugins/groonga/column_remove.rb +1 -1
- data/lib/droonga/plugins/groonga/column_rename.rb +1 -1
- data/lib/droonga/plugins/groonga/delete.rb +1 -1
- data/lib/droonga/plugins/groonga/generic_command.rb +1 -1
- data/lib/droonga/plugins/groonga/generic_response.rb +1 -1
- data/lib/droonga/plugins/groonga/select.rb +1 -1
- data/lib/droonga/plugins/groonga/table_create.rb +1 -1
- data/lib/droonga/plugins/groonga/table_list.rb +1 -1
- data/lib/droonga/plugins/groonga/table_remove.rb +1 -1
- data/lib/droonga/plugins/groonga.rb +1 -1
- data/lib/droonga/plugins/search/distributed_search_planner.rb +1 -1
- data/lib/droonga/plugins/search.rb +1 -1
- data/lib/droonga/plugins/system.rb +1 -1
- data/lib/droonga/plugins/watch.rb +1 -1
- data/lib/droonga/{service_control_protocol.rb → process_control_protocol.rb} +2 -2
- data/lib/droonga/process_supervisor.rb +91 -0
- data/lib/droonga/processor.rb +1 -1
- data/lib/droonga/reducer.rb +1 -1
- data/lib/droonga/replier.rb +2 -2
- data/lib/droonga/safe_file_writer.rb +1 -1
- data/lib/droonga/schema_applier.rb +1 -1
- data/lib/droonga/searcher/mecab_filter.rb +1 -1
- data/lib/droonga/searcher.rb +31 -19
- data/lib/droonga/serf.rb +81 -14
- data/lib/droonga/serf_downloader.rb +2 -2
- data/lib/droonga/session.rb +1 -1
- data/lib/droonga/single_step.rb +1 -1
- data/lib/droonga/single_step_definition.rb +1 -1
- data/lib/droonga/slice.rb +30 -28
- data/lib/droonga/status_code.rb +1 -1
- data/lib/droonga/step_runner.rb +1 -1
- data/lib/droonga/supervisor.rb +170 -0
- data/lib/droonga/sweeper.rb +1 -1
- data/lib/droonga/test/stub_handler.rb +1 -1
- data/lib/droonga/test/stub_handler_message.rb +1 -1
- data/lib/droonga/test/stub_handler_messenger.rb +1 -1
- data/lib/droonga/test/stub_planner.rb +1 -1
- data/lib/droonga/test.rb +1 -1
- data/lib/droonga/watch_schema.rb +2 -2
- data/lib/droonga/watcher.rb +1 -1
- data/lib/droonga/worker_process_agent.rb +111 -0
- data/sample/cluster/Rakefile +150 -0
- data/test/command/config/default/catalog.json +1 -34
- data/test/command/config/version1/catalog.json +3 -12
- data/test/command/run-test.rb +1 -1
- data/test/command/suite/dump/column/index.expected +19 -82
- data/test/command/suite/dump/column/scalar.expected +5 -36
- data/test/command/suite/dump/column/vector.expected +5 -39
- data/test/command/suite/dump/record/vector/reference.expected +24 -93
- data/test/command/suite/dump/table/array.expected +0 -19
- data/test/command/suite/dump/table/double_array_trie.expected +0 -20
- data/test/command/suite/dump/table/hash.expected +0 -20
- data/test/command/suite/dump/table/patricia_trie.expected +0 -20
- data/test/command/suite/search/condition/query/nonexistent_column.expected +0 -11
- data/test/command/suite/search/condition/query/syntax_error.expected +0 -11
- data/test/command/suite/search/error/unknown-source.expected +0 -12
- data/test/command/suite/search/output/attributes/invalid.expected +0 -10
- data/test/command/suite/search/output/attributes/reference_vector.catalog.json +27 -0
- data/test/command/suite/search/output/attributes/reference_vector.expected +30 -0
- data/test/command/suite/search/output/attributes/reference_vector.test +32 -0
- data/test/command/suite/watch/subscribe.catalog.json +23 -0
- data/test/command/suite/watch/subscribe.test +2 -0
- data/test/command/suite/watch/unsubscribe.catalog.json +23 -0
- data/test/command/suite/watch/unsubscribe.test +2 -0
- data/test/performance/run-test.rb +1 -1
- data/test/unit/catalog/test_collection_volume.rb +1 -1
- data/test/unit/catalog/test_dataset.rb +1 -1
- data/test/unit/catalog/test_schema.rb +1 -1
- data/test/unit/catalog/test_single_volume.rb +27 -19
- data/test/unit/catalog/test_slice.rb +2 -2
- data/test/unit/catalog/test_version1.rb +1 -1
- data/test/unit/catalog/test_version2.rb +1 -1
- data/test/unit/catalog/test_version2_validator.rb +1 -1
- data/test/unit/catalog/test_volume_collection.rb +1 -1
- data/test/unit/helper/distributed_search_planner_helper.rb +1 -1
- data/test/unit/helper/fixture.rb +1 -1
- data/test/unit/helper/plugin_helper.rb +1 -1
- data/test/unit/helper/sandbox.rb +1 -1
- data/test/unit/helper/stub_worker.rb +1 -1
- data/test/unit/helper/watch_helper.rb +1 -1
- data/test/unit/helper.rb +1 -1
- data/test/unit/plugins/crud/test_add.rb +1 -1
- data/test/unit/plugins/groonga/select/test_adapter_input.rb +1 -1
- data/test/unit/plugins/groonga/select/test_adapter_output.rb +1 -1
- data/test/unit/plugins/groonga/test_column_create.rb +1 -1
- data/test/unit/plugins/groonga/test_column_list.rb +1 -1
- data/test/unit/plugins/groonga/test_column_remove.rb +1 -1
- data/test/unit/plugins/groonga/test_column_rename.rb +1 -1
- data/test/unit/plugins/groonga/test_delete.rb +1 -1
- data/test/unit/plugins/groonga/test_table_create.rb +1 -1
- data/test/unit/plugins/groonga/test_table_list.rb +1 -1
- data/test/unit/plugins/groonga/test_table_remove.rb +1 -1
- data/test/unit/plugins/search/planner/test_basic.rb +1 -1
- data/test/unit/plugins/search/planner/test_group_by.rb +1 -1
- data/test/unit/plugins/search/planner/test_output.rb +1 -1
- data/test/unit/plugins/search/planner/test_sort_by.rb +1 -1
- data/test/unit/plugins/search/test_collector.rb +1 -1
- data/test/unit/plugins/search/test_handler.rb +1 -1
- data/test/unit/plugins/search/test_planner.rb +1 -1
- data/test/unit/plugins/system/test_status.rb +1 -1
- data/test/unit/plugins/test_basic.rb +1 -1
- data/test/unit/plugins/test_groonga.rb +1 -1
- data/test/unit/plugins/test_watch.rb +1 -1
- data/test/unit/run-test.rb +1 -1
- data/test/unit/test_address.rb +53 -0
- data/test/unit/test_catalog_generator.rb +59 -1
- data/test/unit/test_line_buffer.rb +1 -1
- data/test/unit/test_message_matcher.rb +1 -1
- data/test/unit/test_schema_applier.rb +1 -1
- data/test/unit/test_sweeper.rb +1 -1
- data/test/unit/test_watch_schema.rb +1 -1
- data/test/unit/test_watcher.rb +1 -1
- metadata +39 -24
- data/lib/droonga/server.rb +0 -45
- data/lib/droonga/worker.rb +0 -66
- data/sample/cluster/catalog.json +0 -42
- data/test/command/config/default/fluentd.conf +0 -11
- data/test/command/config/version1/fluentd.conf +0 -11
data/lib/droonga/farm.rb
CHANGED
|
@@ -13,12 +13,13 @@
|
|
|
13
13
|
#
|
|
14
14
|
# You should have received a copy of the GNU Lesser General Public
|
|
15
15
|
# License along with this library; if not, write to the Free Software
|
|
16
|
-
# Foundation, Inc.,
|
|
16
|
+
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|
17
17
|
|
|
18
18
|
require "droonga/slice"
|
|
19
19
|
|
|
20
20
|
module Droonga
|
|
21
21
|
class Farm
|
|
22
|
+
attr_writer :on_ready
|
|
22
23
|
def initialize(name, catalog, loop, options={})
|
|
23
24
|
@name = name
|
|
24
25
|
@catalog = catalog
|
|
@@ -36,7 +37,14 @@ module Droonga
|
|
|
36
37
|
end
|
|
37
38
|
|
|
38
39
|
def start
|
|
40
|
+
n_ready_slices = 0
|
|
39
41
|
@slices.each_value do |slice|
|
|
42
|
+
slice.on_ready = lambda do
|
|
43
|
+
n_ready_slices += 1
|
|
44
|
+
if n_ready_slices == @slices.size
|
|
45
|
+
@on_ready.call if @on_ready
|
|
46
|
+
end
|
|
47
|
+
end
|
|
40
48
|
slice.start
|
|
41
49
|
end
|
|
42
50
|
end
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
#
|
|
14
14
|
# You should have received a copy of the GNU Lesser General Public
|
|
15
15
|
# License along with this library; if not, write to the Free Software
|
|
16
|
-
# Foundation, Inc.,
|
|
16
|
+
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|
17
17
|
|
|
18
18
|
require "coolio"
|
|
19
19
|
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
#
|
|
12
12
|
# You should have received a copy of the GNU Lesser General Public
|
|
13
13
|
# License along with this library; if not, write to the Free Software
|
|
14
|
-
# Foundation, Inc.,
|
|
14
|
+
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|
15
15
|
|
|
16
16
|
require "socket"
|
|
17
17
|
|
|
@@ -40,12 +40,18 @@ module Droonga
|
|
|
40
40
|
logger.trace("start: done")
|
|
41
41
|
end
|
|
42
42
|
|
|
43
|
-
def
|
|
44
|
-
logger.trace("
|
|
43
|
+
def stop_gracefully
|
|
44
|
+
logger.trace("stop_gracefully: start")
|
|
45
|
+
shutdown_heartbeat_receiver
|
|
45
46
|
shutdown_server
|
|
47
|
+
logger.trace("stop_gracefully: done")
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
def stop_immediately
|
|
51
|
+
logger.trace("stop_immediately: start")
|
|
52
|
+
stop_gracefully
|
|
46
53
|
shutdown_clients
|
|
47
|
-
|
|
48
|
-
logger.trace("shutdown: done")
|
|
54
|
+
logger.trace("stop_immediately: done")
|
|
49
55
|
end
|
|
50
56
|
|
|
51
57
|
private
|
|
@@ -13,12 +13,12 @@
|
|
|
13
13
|
#
|
|
14
14
|
# You should have received a copy of the GNU Lesser General Public
|
|
15
15
|
# License along with this library; if not, write to the Free Software
|
|
16
|
-
# Foundation, Inc.,
|
|
16
|
+
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|
17
17
|
|
|
18
18
|
require "fileutils"
|
|
19
19
|
require "thread"
|
|
20
20
|
|
|
21
|
-
require "
|
|
21
|
+
require "coolio"
|
|
22
22
|
|
|
23
23
|
require "droonga/message-pack-packer"
|
|
24
24
|
|
|
@@ -29,11 +29,12 @@ module Droonga
|
|
|
29
29
|
class FluentMessageSender
|
|
30
30
|
include Loggable
|
|
31
31
|
|
|
32
|
-
def initialize(loop, host, port)
|
|
32
|
+
def initialize(loop, host, port, options={})
|
|
33
33
|
@loop = loop
|
|
34
34
|
@host = host
|
|
35
35
|
@port = port
|
|
36
36
|
@socket = nil
|
|
37
|
+
@buffering = options[:buffering]
|
|
37
38
|
end
|
|
38
39
|
|
|
39
40
|
def start
|
|
@@ -55,17 +56,8 @@ module Droonga
|
|
|
55
56
|
logger.trace("send: done")
|
|
56
57
|
end
|
|
57
58
|
|
|
58
|
-
def reserve_send(tag, data)
|
|
59
|
-
logger.trace("reserve_send: start")
|
|
60
|
-
packed_fluent_message = create_packed_fluent_message(tag, data)
|
|
61
|
-
connect unless connected?
|
|
62
|
-
@socket.reserve_write(packed_fluent_message)
|
|
63
|
-
logger.trace("reserve_send: done")
|
|
64
|
-
end
|
|
65
|
-
|
|
66
59
|
def resume
|
|
67
|
-
connect
|
|
68
|
-
@socket.resume
|
|
60
|
+
connect unless connected?
|
|
69
61
|
end
|
|
70
62
|
|
|
71
63
|
private
|
|
@@ -90,9 +82,14 @@ module Droonga
|
|
|
90
82
|
@socket = nil
|
|
91
83
|
end
|
|
92
84
|
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
85
|
+
if @buffering
|
|
86
|
+
data_directory = Path.buffer + "#{@host}:#{@port}"
|
|
87
|
+
FileUtils.mkdir_p(data_directory.to_s)
|
|
88
|
+
@socket = BufferedTCPSocket.connect(@host, @port, data_directory)
|
|
89
|
+
@socket.resume
|
|
90
|
+
else
|
|
91
|
+
@socket = Coolio::TCPSocket.connect(@host, @port)
|
|
92
|
+
end
|
|
96
93
|
@socket.on_write_complete do
|
|
97
94
|
log_write_complete.call
|
|
98
95
|
end
|
|
@@ -121,7 +118,7 @@ module Droonga
|
|
|
121
118
|
end
|
|
122
119
|
|
|
123
120
|
def log_tag
|
|
124
|
-
"[#{Process.ppid}]
|
|
121
|
+
"[#{Process.ppid}] fluent-message-sender"
|
|
125
122
|
end
|
|
126
123
|
end
|
|
127
124
|
end
|
data/lib/droonga/forwarder.rb
CHANGED
|
@@ -13,24 +13,27 @@
|
|
|
13
13
|
#
|
|
14
14
|
# You should have received a copy of the GNU Lesser General Public
|
|
15
15
|
# License along with this library; if not, write to the Free Software
|
|
16
|
-
# Foundation, Inc.,
|
|
16
|
+
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|
17
17
|
|
|
18
18
|
require "droonga/loggable"
|
|
19
19
|
require "droonga/path"
|
|
20
20
|
require "droonga/event_loop"
|
|
21
|
+
require "droonga/buffered_tcp_socket"
|
|
21
22
|
require "droonga/fluent_message_sender"
|
|
22
23
|
|
|
23
24
|
module Droonga
|
|
24
25
|
class Forwarder
|
|
25
26
|
include Loggable
|
|
26
27
|
|
|
27
|
-
def initialize(loop)
|
|
28
|
+
def initialize(loop, options={})
|
|
28
29
|
@loop = loop
|
|
30
|
+
@buffering = options[:buffering]
|
|
29
31
|
@senders = {}
|
|
30
32
|
end
|
|
31
33
|
|
|
32
34
|
def start
|
|
33
35
|
logger.trace("start: start")
|
|
36
|
+
resume
|
|
34
37
|
logger.trace("start: done")
|
|
35
38
|
end
|
|
36
39
|
|
|
@@ -47,8 +50,7 @@ module Droonga
|
|
|
47
50
|
command = destination["type"]
|
|
48
51
|
receiver = destination["to"]
|
|
49
52
|
arguments = destination["arguments"]
|
|
50
|
-
|
|
51
|
-
output(receiver, message, command, arguments, :reserve => reserve)
|
|
53
|
+
output(receiver, message, command, arguments)
|
|
52
54
|
logger.trace("forward: done")
|
|
53
55
|
end
|
|
54
56
|
|
|
@@ -56,10 +58,19 @@ module Droonga
|
|
|
56
58
|
return unless Path.buffer.exist?
|
|
57
59
|
Pathname.glob("#{Path.buffer}/*") do |path|
|
|
58
60
|
next unless path.directory?
|
|
59
|
-
next if Pathname.glob("#{path.to_s}/*").empty?
|
|
60
61
|
|
|
61
62
|
destination = path.basename.to_s
|
|
62
|
-
|
|
63
|
+
sender = @senders[destination]
|
|
64
|
+
if sender
|
|
65
|
+
sender.resume
|
|
66
|
+
next
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
chunk_loader = BufferedTCPSocket::ChunkLoader.new(path)
|
|
70
|
+
unless chunk_loader.have_any_chunk?
|
|
71
|
+
#FileUtils.rm_rf(path.to_s) # TODO re-enable this
|
|
72
|
+
next
|
|
73
|
+
end
|
|
63
74
|
|
|
64
75
|
components = destination.split(":")
|
|
65
76
|
port = components.pop.to_i
|
|
@@ -104,11 +115,7 @@ module Droonga
|
|
|
104
115
|
output_tag = "#{tag}.message"
|
|
105
116
|
log_info = "<#{receiver}>:<#{output_tag}>"
|
|
106
117
|
logger.trace("output: post: start: #{log_info}")
|
|
107
|
-
|
|
108
|
-
sender.reserve_send(output_tag, message)
|
|
109
|
-
else
|
|
110
|
-
sender.send(output_tag, message)
|
|
111
|
-
end
|
|
118
|
+
sender.send(output_tag, message)
|
|
112
119
|
logger.trace("output: post: done: #{log_info}")
|
|
113
120
|
logger.trace("output: done")
|
|
114
121
|
end
|
|
@@ -132,13 +139,16 @@ module Droonga
|
|
|
132
139
|
end
|
|
133
140
|
|
|
134
141
|
def create_sender(host, port)
|
|
135
|
-
|
|
142
|
+
options = {
|
|
143
|
+
:buffering => @buffering,
|
|
144
|
+
}
|
|
145
|
+
sender = FluentMessageSender.new(@loop, host, port, options)
|
|
136
146
|
sender.start
|
|
137
147
|
sender
|
|
138
148
|
end
|
|
139
149
|
|
|
140
150
|
def log_tag
|
|
141
|
-
"[#{Process.ppid}]
|
|
151
|
+
"[#{Process.ppid}] forwarder"
|
|
142
152
|
end
|
|
143
153
|
end
|
|
144
154
|
end
|
data/lib/droonga/handler.rb
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
#
|
|
12
12
|
# You should have received a copy of the GNU Lesser General Public
|
|
13
13
|
# License along with this library; if not, write to the Free Software
|
|
14
|
-
# Foundation, Inc.,
|
|
14
|
+
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|
15
15
|
|
|
16
16
|
require "droonga/pluggable"
|
|
17
17
|
require "droonga/loggable"
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
#
|
|
12
12
|
# You should have received a copy of the GNU Lesser General Public
|
|
13
13
|
# License along with this library; if not, write to the Free Software
|
|
14
|
-
# Foundation, Inc.,
|
|
14
|
+
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|
15
15
|
|
|
16
16
|
module Droonga
|
|
17
17
|
class HandlerMessage
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
#
|
|
12
12
|
# You should have received a copy of the GNU Lesser General Public
|
|
13
13
|
# License along with this library; if not, write to the Free Software
|
|
14
|
-
# Foundation, Inc.,
|
|
14
|
+
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|
15
15
|
|
|
16
16
|
require "droonga/replier"
|
|
17
17
|
require "droonga/forwarder"
|
|
@@ -114,7 +114,7 @@ module Droonga
|
|
|
114
114
|
|
|
115
115
|
private
|
|
116
116
|
def log_tag
|
|
117
|
-
"[#{Process.ppid}]
|
|
117
|
+
"[#{Process.ppid}] handler_messenger"
|
|
118
118
|
end
|
|
119
119
|
end
|
|
120
120
|
end
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
#
|
|
12
12
|
# You should have received a copy of the GNU Lesser General Public
|
|
13
13
|
# License along with this library; if not, write to the Free Software
|
|
14
|
-
# Foundation, Inc.,
|
|
14
|
+
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|
15
15
|
|
|
16
16
|
require "groonga"
|
|
17
17
|
|
|
@@ -132,7 +132,7 @@ module Droonga
|
|
|
132
132
|
end
|
|
133
133
|
|
|
134
134
|
def log_tag
|
|
135
|
-
"[#{Process.ppid}]
|
|
135
|
+
"[#{Process.ppid}] handler"
|
|
136
136
|
end
|
|
137
137
|
end
|
|
138
138
|
end
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
#
|
|
14
14
|
# You should have received a copy of the GNU Lesser General Public
|
|
15
15
|
# License along with this library; if not, write to the Free Software
|
|
16
|
-
# Foundation, Inc.,
|
|
16
|
+
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|
17
17
|
|
|
18
18
|
module Droonga
|
|
19
19
|
class InputMessage
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
#
|
|
12
12
|
# You should have received a copy of the GNU Lesser General Public
|
|
13
13
|
# License along with this library; if not, write to the Free Software
|
|
14
|
-
# Foundation, Inc.,
|
|
14
|
+
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|
15
15
|
|
|
16
16
|
require "socket"
|
|
17
17
|
require "ipaddr"
|
|
@@ -87,9 +87,10 @@ module Droonga
|
|
|
87
87
|
logger.trace("start_heartbeat_socket: done")
|
|
88
88
|
end
|
|
89
89
|
|
|
90
|
+
# TODO: Use stop_gracefully/stop_immediately interface
|
|
90
91
|
def shutdown_message_receiver
|
|
91
92
|
logger.trace("shutdown_message_receiver: start")
|
|
92
|
-
@message_receiver.
|
|
93
|
+
@message_receiver.stop_immediately
|
|
93
94
|
logger.trace("shutdown_message_receiver: done")
|
|
94
95
|
end
|
|
95
96
|
|
data/lib/droonga/job_protocol.rb
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
#
|
|
12
12
|
# You should have received a copy of the GNU Lesser General Public
|
|
13
13
|
# License along with this library; if not, write to the Free Software
|
|
14
|
-
# Foundation, Inc.,
|
|
14
|
+
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|
15
15
|
|
|
16
16
|
module Droonga
|
|
17
17
|
module JobProtocol
|
data/lib/droonga/job_pusher.rb
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
#
|
|
12
12
|
# You should have received a copy of the GNU Lesser General Public
|
|
13
13
|
# License along with this library; if not, write to the Free Software
|
|
14
|
-
# Foundation, Inc.,
|
|
14
|
+
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|
15
15
|
|
|
16
16
|
require "msgpack"
|
|
17
17
|
|
data/lib/droonga/job_receiver.rb
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
#
|
|
12
12
|
# You should have received a copy of the GNU Lesser General Public
|
|
13
13
|
# License along with this library; if not, write to the Free Software
|
|
14
|
-
# Foundation, Inc.,
|
|
14
|
+
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|
15
15
|
|
|
16
16
|
require "msgpack"
|
|
17
17
|
|
data/lib/droonga/line_buffer.rb
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
#
|
|
12
12
|
# You should have received a copy of the GNU Lesser General Public
|
|
13
13
|
# License along with this library; if not, write to the Free Software
|
|
14
|
-
# Foundation, Inc.,
|
|
14
|
+
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|
15
15
|
|
|
16
16
|
module Droonga
|
|
17
17
|
class LineBuffer
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
#
|
|
12
12
|
# You should have received a copy of the GNU Lesser General Public
|
|
13
13
|
# License along with this library; if not, write to the Free Software
|
|
14
|
-
# Foundation, Inc.,
|
|
14
|
+
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|
15
15
|
|
|
16
16
|
require "pathname"
|
|
17
17
|
require "json"
|
data/lib/droonga/loggable.rb
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
#
|
|
12
12
|
# You should have received a copy of the GNU Lesser General Public
|
|
13
13
|
# License along with this library; if not, write to the Free Software
|
|
14
|
-
# Foundation, Inc.,
|
|
14
|
+
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|
15
15
|
|
|
16
16
|
require "droonga/logger"
|
|
17
17
|
|
data/lib/droonga/logger.rb
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
#
|
|
14
14
|
# You should have received a copy of the GNU Lesser General Public
|
|
15
15
|
# License along with this library; if not, write to the Free Software
|
|
16
|
-
# Foundation, Inc.,
|
|
16
|
+
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|
17
17
|
|
|
18
18
|
module Droonga
|
|
19
19
|
class << self
|
|
@@ -110,7 +110,7 @@ module Droonga
|
|
|
110
110
|
|
|
111
111
|
def exception(message, exception, data={})
|
|
112
112
|
log(Level::ERROR,
|
|
113
|
-
"#{message}: #{exception.
|
|
113
|
+
"#{message}: #{exception.class}: #{exception.message}",
|
|
114
114
|
data)
|
|
115
115
|
log_backtrace(Level::ERROR, exception.backtrace)
|
|
116
116
|
end
|
|
@@ -133,7 +133,7 @@ module Droonga
|
|
|
133
133
|
end
|
|
134
134
|
|
|
135
135
|
def build_log_line(level, message, data={})
|
|
136
|
-
line = "#{Time.now.iso8601}[#{Level.label(level)}]: "
|
|
136
|
+
line = "#{Time.now.iso8601}[#{Process.pid}][#{Level.label(level)}]: "
|
|
137
137
|
line << "#{@tag}: " if @tag
|
|
138
138
|
line << message
|
|
139
139
|
data.each do |key, value|
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
#
|
|
12
12
|
# You should have received a copy of the GNU Lesser General Public
|
|
13
13
|
# License along with this library; if not, write to the Free Software
|
|
14
|
-
# Foundation, Inc.,
|
|
14
|
+
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|
15
15
|
|
|
16
16
|
module Droonga
|
|
17
17
|
# It checks whether the pattern matches against a message.
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
#
|
|
12
12
|
# You should have received a copy of the GNU Lesser General Public
|
|
13
13
|
# License along with this library; if not, write to the Free Software
|
|
14
|
-
# Foundation, Inc.,
|
|
14
|
+
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|
15
15
|
|
|
16
16
|
require "droonga/status_code"
|
|
17
17
|
|
data/lib/droonga/path.rb
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
#
|
|
12
12
|
# You should have received a copy of the GNU Lesser General Public
|
|
13
13
|
# License along with this library; if not, write to the Free Software
|
|
14
|
-
# Foundation, Inc.,
|
|
14
|
+
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|
15
15
|
|
|
16
16
|
require "pathname"
|
|
17
17
|
|
|
@@ -55,6 +55,10 @@ module Droonga
|
|
|
55
55
|
Pathname.new(base_file_name).expand_path(base)
|
|
56
56
|
end
|
|
57
57
|
|
|
58
|
+
def published(suffix)
|
|
59
|
+
base + "published-#{suffix}"
|
|
60
|
+
end
|
|
61
|
+
|
|
58
62
|
def buffer
|
|
59
63
|
state + "buffer"
|
|
60
64
|
end
|
data/lib/droonga/planner.rb
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
#
|
|
12
12
|
# You should have received a copy of the GNU Lesser General Public
|
|
13
13
|
# License along with this library; if not, write to the Free Software
|
|
14
|
-
# Foundation, Inc.,
|
|
14
|
+
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|
15
15
|
|
|
16
16
|
require "droonga/loggable"
|
|
17
17
|
require "droonga/distributed_command_planner"
|
data/lib/droonga/pluggable.rb
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
#
|
|
12
12
|
# You should have received a copy of the GNU Lesser General Public
|
|
13
13
|
# License along with this library; if not, write to the Free Software
|
|
14
|
-
# Foundation, Inc.,
|
|
14
|
+
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|
15
15
|
|
|
16
16
|
module Droonga
|
|
17
17
|
module Pluggable
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
#
|
|
12
12
|
# You should have received a copy of the GNU Lesser General Public
|
|
13
13
|
# License along with this library; if not, write to the Free Software
|
|
14
|
-
# Foundation, Inc.,
|
|
14
|
+
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|
15
15
|
|
|
16
16
|
module Droonga
|
|
17
17
|
module Plugin
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
#
|
|
12
12
|
# You should have received a copy of the GNU Lesser General Public
|
|
13
13
|
# License along with this library; if not, write to the Free Software
|
|
14
|
-
# Foundation, Inc.,
|
|
14
|
+
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|
15
15
|
|
|
16
16
|
module Droonga
|
|
17
17
|
module Plugin
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
#
|
|
12
12
|
# You should have received a copy of the GNU Lesser General Public
|
|
13
13
|
# License along with this library; if not, write to the Free Software
|
|
14
|
-
# Foundation, Inc.,
|
|
14
|
+
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|
15
15
|
|
|
16
16
|
module Droonga
|
|
17
17
|
module Plugin
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
#
|
|
12
12
|
# You should have received a copy of the GNU Lesser General Public
|
|
13
13
|
# License along with this library; if not, write to the Free Software
|
|
14
|
-
# Foundation, Inc.,
|
|
14
|
+
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|
15
15
|
|
|
16
16
|
module Droonga
|
|
17
17
|
module Plugin
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
#
|
|
12
12
|
# You should have received a copy of the GNU Lesser General Public
|
|
13
13
|
# License along with this library; if not, write to the Free Software
|
|
14
|
-
# Foundation, Inc.,
|
|
14
|
+
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|
15
15
|
|
|
16
16
|
module Droonga
|
|
17
17
|
module Plugin
|
data/lib/droonga/plugin.rb
CHANGED
|
@@ -11,13 +11,14 @@
|
|
|
11
11
|
#
|
|
12
12
|
# You should have received a copy of the GNU Lesser General Public
|
|
13
13
|
# License along with this library; if not, write to the Free Software
|
|
14
|
-
# Foundation, Inc.,
|
|
14
|
+
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|
15
15
|
|
|
16
16
|
require "droonga/plugin_registry"
|
|
17
17
|
require "droonga/single_step_definition"
|
|
18
18
|
require "droonga/adapter"
|
|
19
19
|
require "droonga/planner"
|
|
20
20
|
require "droonga/handler"
|
|
21
|
+
require "droonga/collector"
|
|
21
22
|
require "droonga/collectors"
|
|
22
23
|
|
|
23
24
|
module Droonga
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
#
|
|
14
14
|
# You should have received a copy of the GNU Lesser General Public
|
|
15
15
|
# License along with this library; if not, write to the Free Software
|
|
16
|
-
# Foundation, Inc.,
|
|
16
|
+
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|
17
17
|
|
|
18
18
|
require "pathname"
|
|
19
19
|
|
|
@@ -11,7 +11,9 @@
|
|
|
11
11
|
#
|
|
12
12
|
# You should have received a copy of the GNU Lesser General Public
|
|
13
13
|
# License along with this library; if not, write to the Free Software
|
|
14
|
-
# Foundation, Inc.,
|
|
14
|
+
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|
15
|
+
|
|
16
|
+
require "droonga/error"
|
|
15
17
|
|
|
16
18
|
module Droonga
|
|
17
19
|
class PluginRegistry
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
#
|
|
12
12
|
# You should have received a copy of the GNU Lesser General Public
|
|
13
13
|
# License along with this library; if not, write to the Free Software
|
|
14
|
-
# Foundation, Inc.,
|
|
14
|
+
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|
15
15
|
|
|
16
16
|
require "droonga/plugin"
|
|
17
17
|
require "droonga/reducer"
|
data/lib/droonga/plugins/crud.rb
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
#
|
|
12
12
|
# You should have received a copy of the GNU Lesser General Public
|
|
13
13
|
# License along with this library; if not, write to the Free Software
|
|
14
|
-
# Foundation, Inc.,
|
|
14
|
+
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|
15
15
|
|
|
16
16
|
require "groonga"
|
|
17
17
|
|
data/lib/droonga/plugins/dump.rb
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
#
|
|
12
12
|
# You should have received a copy of the GNU Lesser General Public
|
|
13
13
|
# License along with this library; if not, write to the Free Software
|
|
14
|
-
# Foundation, Inc.,
|
|
14
|
+
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|
15
15
|
|
|
16
16
|
require "groonga"
|
|
17
17
|
|
|
@@ -20,6 +20,17 @@ require "droonga/error_messages"
|
|
|
20
20
|
|
|
21
21
|
module Droonga
|
|
22
22
|
module Plugins
|
|
23
|
+
# TODO: Implement it by superstep:
|
|
24
|
+
# * Schema: Choose one slice in a replica.
|
|
25
|
+
# Because all slices has the same schema.
|
|
26
|
+
# (Should we add "select" type to Dataset#copmute_routes for the case?)
|
|
27
|
+
# * Fact table: Choose all slices in a replica.
|
|
28
|
+
# Because records for the fact table are distributed in all slices.
|
|
29
|
+
# (Should we add "gather" type to Dataset#copmute_routes for the case?)
|
|
30
|
+
# * Other tables: Choose one slice in a replica.
|
|
31
|
+
# Because all slices has all records for other tables.
|
|
32
|
+
# (Should we add "select" type to Dataset#copmute_routes for the case?)
|
|
33
|
+
|
|
23
34
|
module Dump
|
|
24
35
|
extend Plugin
|
|
25
36
|
register("dump")
|
|
@@ -324,7 +335,7 @@ module Droonga
|
|
|
324
335
|
end
|
|
325
336
|
|
|
326
337
|
def log_tag
|
|
327
|
-
"[#{Process.ppid}]
|
|
338
|
+
"[#{Process.ppid}] dumper"
|
|
328
339
|
end
|
|
329
340
|
end
|
|
330
341
|
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
#
|
|
12
12
|
# You should have received a copy of the GNU Lesser General Public
|
|
13
13
|
# License along with this library; if not, write to the Free Software
|
|
14
|
-
# Foundation, Inc.,
|
|
14
|
+
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|
15
15
|
|
|
16
16
|
require "droonga/plugin"
|
|
17
17
|
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
#
|
|
12
12
|
# You should have received a copy of the GNU Lesser General Public
|
|
13
13
|
# License along with this library; if not, write to the Free Software
|
|
14
|
-
# Foundation, Inc.,
|
|
14
|
+
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|
15
15
|
|
|
16
16
|
require "groonga/command/column-create"
|
|
17
17
|
|