droonga-engine 1.0.4 → 1.0.5
Sign up to get free protection for your applications and to get access to all the features.
- 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
@@ -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
|
class DistributedSearchPlannerSortByTest < Test::Unit::TestCase
|
17
17
|
include DistributedSearchPlannerHelper
|
@@ -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/plugins/search"
|
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 "droonga/plugins/search"
|
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 "droonga/plugins/search"
|
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 "droonga/plugins/system"
|
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 "droonga/plugins/basic"
|
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 "droonga/plugins/groonga"
|
17
17
|
|
@@ -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 "droonga/plugins/watch"
|
19
19
|
|
data/test/unit/run-test.rb
CHANGED
@@ -14,7 +14,7 @@
|
|
14
14
|
#
|
15
15
|
# You should have received a copy of the GNU Lesser General Public
|
16
16
|
# License along with this library; if not, write to the Free Software
|
17
|
-
# Foundation, Inc.,
|
17
|
+
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
18
18
|
|
19
19
|
require "pathname"
|
20
20
|
|
@@ -0,0 +1,53 @@
|
|
1
|
+
# Copyright (C) 2014 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 "droonga/address"
|
17
|
+
|
18
|
+
class AddressTest < Test::Unit::TestCase
|
19
|
+
def address(host, port, tag, name)
|
20
|
+
Droonga::Address.new(:host => host,
|
21
|
+
:port => port,
|
22
|
+
:tag => tag,
|
23
|
+
:name => name)
|
24
|
+
end
|
25
|
+
|
26
|
+
class ParseTest < self
|
27
|
+
def parse(string)
|
28
|
+
Droonga::Address.parse(string)
|
29
|
+
end
|
30
|
+
|
31
|
+
def test_full
|
32
|
+
assert_equal(address("192.168.0.1", 2929, "droonga", "name"),
|
33
|
+
parse("192.168.0.1:2929/droonga.name"))
|
34
|
+
end
|
35
|
+
|
36
|
+
def test_internal_name
|
37
|
+
assert_equal(address("192.168.0.1", 2929, "droonga", "#1"),
|
38
|
+
parse("192.168.0.1:2929/droonga.\#1"))
|
39
|
+
end
|
40
|
+
|
41
|
+
def test_no_name
|
42
|
+
assert_equal(address("192.168.0.1", 2929, "droonga", nil),
|
43
|
+
parse("192.168.0.1:2929/droonga"))
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
class FormatterTest < self
|
48
|
+
def test_node
|
49
|
+
assert_equal("192.168.0.1:2929/droonga",
|
50
|
+
address("192.168.0.1", 2929, "droonga", "000").node)
|
51
|
+
end
|
52
|
+
end
|
53
|
+
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 "droonga/catalog_generator"
|
17
17
|
|
@@ -89,5 +89,63 @@ class CatalogGeneratorTest < Test::Unit::TestCase
|
|
89
89
|
@generator.add_dataset("Droonga", :fact => "Entries")
|
90
90
|
assert_equal("Entries", generate["datasets"]["Droonga"]["fact"])
|
91
91
|
end
|
92
|
+
|
93
|
+
class LoadTest < self
|
94
|
+
def test_replicas
|
95
|
+
dataset = {
|
96
|
+
"nWorkers" => 4,
|
97
|
+
"plugins" => ["groonga", "search", "crud", "dump", "system"],
|
98
|
+
"schema" => [],
|
99
|
+
"replicas" => [
|
100
|
+
{
|
101
|
+
"dimension" => "_key",
|
102
|
+
"slicer" => "hash",
|
103
|
+
"slices" => [
|
104
|
+
{
|
105
|
+
"volume" => {
|
106
|
+
"address" => "127.0.0.1:10031/droonga.000",
|
107
|
+
},
|
108
|
+
"weight" => 100,
|
109
|
+
},
|
110
|
+
],
|
111
|
+
},
|
112
|
+
],
|
113
|
+
}
|
114
|
+
catalog = {
|
115
|
+
"datasets" => {
|
116
|
+
"Default" => dataset,
|
117
|
+
}
|
118
|
+
}
|
119
|
+
@generator.load(catalog)
|
120
|
+
assert_equal(dataset, generate["datasets"]["Default"])
|
121
|
+
end
|
122
|
+
end
|
123
|
+
end
|
124
|
+
|
125
|
+
class ReplicasTest < self
|
126
|
+
def test_catalog
|
127
|
+
replicas = [
|
128
|
+
{
|
129
|
+
"dimension" => "_key",
|
130
|
+
"slicer" => "hash",
|
131
|
+
"slices" => [
|
132
|
+
{
|
133
|
+
"volume" => {
|
134
|
+
"address" => "127.0.0.1:10031/droonga.000",
|
135
|
+
},
|
136
|
+
"weight" => 100,
|
137
|
+
},
|
138
|
+
],
|
139
|
+
},
|
140
|
+
]
|
141
|
+
@generator.add_dataset("Droonga", :replicas => replicas)
|
142
|
+
dataset = {
|
143
|
+
"nWorkers" => 4,
|
144
|
+
"plugins" => ["groonga", "search", "crud", "dump", "system"],
|
145
|
+
"schema" => {},
|
146
|
+
"replicas" => replicas,
|
147
|
+
}
|
148
|
+
assert_equal(dataset, generate["datasets"]["Droonga"])
|
149
|
+
end
|
92
150
|
end
|
93
151
|
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 "droonga/line_buffer"
|
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 "droonga/message_matcher"
|
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 "droonga/schema_applier"
|
17
17
|
|
data/test/unit/test_sweeper.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
|
require "droonga/watcher"
|
19
19
|
require "droonga/sweeper"
|
@@ -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 "helper"
|
17
17
|
|
data/test/unit/test_watcher.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
|
require "droonga/watcher"
|
19
19
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: droonga-engine
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Droonga Project
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-07-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rroonga
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '>='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: 4.0.1
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - '>='
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
26
|
+
version: 4.0.1
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: groonga-command-parser
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -67,35 +67,35 @@ dependencies:
|
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
|
-
name:
|
70
|
+
name: droonga-message-pack-packer
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
73
|
- - '>='
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version:
|
75
|
+
version: 1.0.1
|
76
76
|
type: :runtime
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
80
|
- - '>='
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version:
|
82
|
+
version: 1.0.1
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
|
-
name:
|
84
|
+
name: faraday
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
87
|
- - '>='
|
88
88
|
- !ruby/object:Gem::Version
|
89
|
-
version:
|
89
|
+
version: '0'
|
90
90
|
type: :runtime
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
94
|
- - '>='
|
95
95
|
- !ruby/object:Gem::Version
|
96
|
-
version:
|
96
|
+
version: '0'
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
|
-
name:
|
98
|
+
name: faraday_middleware
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
100
100
|
requirements:
|
101
101
|
- - '>='
|
@@ -109,7 +109,7 @@ dependencies:
|
|
109
109
|
- !ruby/object:Gem::Version
|
110
110
|
version: '0'
|
111
111
|
- !ruby/object:Gem::Dependency
|
112
|
-
name:
|
112
|
+
name: archive-zip
|
113
113
|
requirement: !ruby/object:Gem::Requirement
|
114
114
|
requirements:
|
115
115
|
- - '>='
|
@@ -123,7 +123,7 @@ dependencies:
|
|
123
123
|
- !ruby/object:Gem::Version
|
124
124
|
version: '0'
|
125
125
|
- !ruby/object:Gem::Dependency
|
126
|
-
name:
|
126
|
+
name: sigdump
|
127
127
|
requirement: !ruby/object:Gem::Requirement
|
128
128
|
requirements:
|
129
129
|
- - '>='
|
@@ -137,19 +137,19 @@ dependencies:
|
|
137
137
|
- !ruby/object:Gem::Version
|
138
138
|
version: '0'
|
139
139
|
- !ruby/object:Gem::Dependency
|
140
|
-
name:
|
140
|
+
name: droonga-client
|
141
141
|
requirement: !ruby/object:Gem::Requirement
|
142
142
|
requirements:
|
143
143
|
- - '>='
|
144
144
|
- !ruby/object:Gem::Version
|
145
|
-
version:
|
145
|
+
version: 0.1.9
|
146
146
|
type: :runtime
|
147
147
|
prerelease: false
|
148
148
|
version_requirements: !ruby/object:Gem::Requirement
|
149
149
|
requirements:
|
150
150
|
- - '>='
|
151
151
|
- !ruby/object:Gem::Version
|
152
|
-
version:
|
152
|
+
version: 0.1.9
|
153
153
|
- !ruby/object:Gem::Dependency
|
154
154
|
name: drndump
|
155
155
|
requirement: !ruby/object:Gem::Requirement
|
@@ -271,10 +271,12 @@ executables:
|
|
271
271
|
- droonga-engine-absorb-data
|
272
272
|
- droonga-engine-catalog-generate
|
273
273
|
- droonga-engine-catalog-modify
|
274
|
+
- droonga-engine-data-publisher
|
274
275
|
- droonga-engine-join
|
275
276
|
- droonga-engine-serf-event-handler
|
276
277
|
- droonga-engine-service
|
277
278
|
- droonga-engine-unjoin
|
279
|
+
- droonga-engine-worker
|
278
280
|
extensions: []
|
279
281
|
extra_rdoc_files: []
|
280
282
|
files:
|
@@ -296,14 +298,17 @@ files:
|
|
296
298
|
- bin/droonga-engine-absorb-data
|
297
299
|
- bin/droonga-engine-catalog-generate
|
298
300
|
- bin/droonga-engine-catalog-modify
|
301
|
+
- bin/droonga-engine-data-publisher
|
299
302
|
- bin/droonga-engine-join
|
300
303
|
- bin/droonga-engine-serf-event-handler
|
301
304
|
- bin/droonga-engine-service
|
302
305
|
- bin/droonga-engine-unjoin
|
306
|
+
- bin/droonga-engine-worker
|
303
307
|
- doc/text/news.md
|
304
308
|
- droonga-engine.gemspec
|
305
309
|
- lib/droonga/adapter.rb
|
306
310
|
- lib/droonga/adapter_runner.rb
|
311
|
+
- lib/droonga/address.rb
|
307
312
|
- lib/droonga/buffered_tcp_socket.rb
|
308
313
|
- lib/droonga/catalog/base.rb
|
309
314
|
- lib/droonga/catalog/collection_volume.rb
|
@@ -328,6 +333,7 @@ files:
|
|
328
333
|
- lib/droonga/collectors/sum.rb
|
329
334
|
- lib/droonga/command/droonga_engine.rb
|
330
335
|
- lib/droonga/command/droonga_engine_service.rb
|
336
|
+
- lib/droonga/command/droonga_engine_worker.rb
|
331
337
|
- lib/droonga/command/serf_event_handler.rb
|
332
338
|
- lib/droonga/data_absorber.rb
|
333
339
|
- lib/droonga/dispatcher.rb
|
@@ -390,6 +396,8 @@ files:
|
|
390
396
|
- lib/droonga/plugins/search/distributed_search_planner.rb
|
391
397
|
- lib/droonga/plugins/system.rb
|
392
398
|
- lib/droonga/plugins/watch.rb
|
399
|
+
- lib/droonga/process_control_protocol.rb
|
400
|
+
- lib/droonga/process_supervisor.rb
|
393
401
|
- lib/droonga/processor.rb
|
394
402
|
- lib/droonga/reducer.rb
|
395
403
|
- lib/droonga/replier.rb
|
@@ -399,14 +407,13 @@ files:
|
|
399
407
|
- lib/droonga/searcher/mecab_filter.rb
|
400
408
|
- lib/droonga/serf.rb
|
401
409
|
- lib/droonga/serf_downloader.rb
|
402
|
-
- lib/droonga/server.rb
|
403
|
-
- lib/droonga/service_control_protocol.rb
|
404
410
|
- lib/droonga/session.rb
|
405
411
|
- lib/droonga/single_step.rb
|
406
412
|
- lib/droonga/single_step_definition.rb
|
407
413
|
- lib/droonga/slice.rb
|
408
414
|
- lib/droonga/status_code.rb
|
409
415
|
- lib/droonga/step_runner.rb
|
416
|
+
- lib/droonga/supervisor.rb
|
410
417
|
- lib/droonga/sweeper.rb
|
411
418
|
- lib/droonga/test.rb
|
412
419
|
- lib/droonga/test/stub_handler.rb
|
@@ -415,16 +422,14 @@ files:
|
|
415
422
|
- lib/droonga/test/stub_planner.rb
|
416
423
|
- lib/droonga/watch_schema.rb
|
417
424
|
- lib/droonga/watcher.rb
|
418
|
-
- lib/droonga/
|
419
|
-
- sample/cluster/
|
425
|
+
- lib/droonga/worker_process_agent.rb
|
426
|
+
- sample/cluster/Rakefile
|
420
427
|
- sample/mecab_filter/data.grn
|
421
428
|
- sample/mecab_filter/ddl.grn
|
422
429
|
- sample/mecab_filter/search_with_mecab_filter.json
|
423
430
|
- sample/mecab_filter/search_without_mecab_filter.json
|
424
431
|
- test/command/config/default/catalog.json
|
425
|
-
- test/command/config/default/fluentd.conf
|
426
432
|
- test/command/config/version1/catalog.json
|
427
|
-
- test/command/config/version1/fluentd.conf
|
428
433
|
- test/command/fixture/documents.jsons
|
429
434
|
- test/command/fixture/event.jsons
|
430
435
|
- test/command/fixture/user-table-array.jsons
|
@@ -591,6 +596,9 @@ files:
|
|
591
596
|
- test/command/suite/search/output/attributes/invalid.catalog.json
|
592
597
|
- test/command/suite/search/output/attributes/invalid.expected
|
593
598
|
- test/command/suite/search/output/attributes/invalid.test
|
599
|
+
- test/command/suite/search/output/attributes/reference_vector.catalog.json
|
600
|
+
- test/command/suite/search/output/attributes/reference_vector.expected
|
601
|
+
- test/command/suite/search/output/attributes/reference_vector.test
|
594
602
|
- test/command/suite/search/output/attributes/star.catalog.json
|
595
603
|
- test/command/suite/search/output/attributes/star.expected
|
596
604
|
- test/command/suite/search/output/attributes/star.test
|
@@ -617,8 +625,10 @@ files:
|
|
617
625
|
- test/command/suite/search/sort/invisible-column.test
|
618
626
|
- test/command/suite/system/status.expected
|
619
627
|
- test/command/suite/system/status.test
|
628
|
+
- test/command/suite/watch/subscribe.catalog.json
|
620
629
|
- test/command/suite/watch/subscribe.expected
|
621
630
|
- test/command/suite/watch/subscribe.test
|
631
|
+
- test/command/suite/watch/unsubscribe.catalog.json
|
622
632
|
- test/command/suite/watch/unsubscribe.expected
|
623
633
|
- test/command/suite/watch/unsubscribe.test
|
624
634
|
- test/performance/run-test.rb
|
@@ -671,6 +681,7 @@ files:
|
|
671
681
|
- test/unit/plugins/test_groonga.rb
|
672
682
|
- test/unit/plugins/test_watch.rb
|
673
683
|
- test/unit/run-test.rb
|
684
|
+
- test/unit/test_address.rb
|
674
685
|
- test/unit/test_catalog_generator.rb
|
675
686
|
- test/unit/test_line_buffer.rb
|
676
687
|
- test/unit/test_message_matcher.rb
|
@@ -703,9 +714,7 @@ specification_version: 4
|
|
703
714
|
summary: Droonga engine
|
704
715
|
test_files:
|
705
716
|
- test/command/config/default/catalog.json
|
706
|
-
- test/command/config/default/fluentd.conf
|
707
717
|
- test/command/config/version1/catalog.json
|
708
|
-
- test/command/config/version1/fluentd.conf
|
709
718
|
- test/command/fixture/documents.jsons
|
710
719
|
- test/command/fixture/event.jsons
|
711
720
|
- test/command/fixture/user-table-array.jsons
|
@@ -872,6 +881,9 @@ test_files:
|
|
872
881
|
- test/command/suite/search/output/attributes/invalid.catalog.json
|
873
882
|
- test/command/suite/search/output/attributes/invalid.expected
|
874
883
|
- test/command/suite/search/output/attributes/invalid.test
|
884
|
+
- test/command/suite/search/output/attributes/reference_vector.catalog.json
|
885
|
+
- test/command/suite/search/output/attributes/reference_vector.expected
|
886
|
+
- test/command/suite/search/output/attributes/reference_vector.test
|
875
887
|
- test/command/suite/search/output/attributes/star.catalog.json
|
876
888
|
- test/command/suite/search/output/attributes/star.expected
|
877
889
|
- test/command/suite/search/output/attributes/star.test
|
@@ -898,8 +910,10 @@ test_files:
|
|
898
910
|
- test/command/suite/search/sort/invisible-column.test
|
899
911
|
- test/command/suite/system/status.expected
|
900
912
|
- test/command/suite/system/status.test
|
913
|
+
- test/command/suite/watch/subscribe.catalog.json
|
901
914
|
- test/command/suite/watch/subscribe.expected
|
902
915
|
- test/command/suite/watch/subscribe.test
|
916
|
+
- test/command/suite/watch/unsubscribe.catalog.json
|
903
917
|
- test/command/suite/watch/unsubscribe.expected
|
904
918
|
- test/command/suite/watch/unsubscribe.test
|
905
919
|
- test/performance/run-test.rb
|
@@ -952,6 +966,7 @@ test_files:
|
|
952
966
|
- test/unit/plugins/test_groonga.rb
|
953
967
|
- test/unit/plugins/test_watch.rb
|
954
968
|
- test/unit/run-test.rb
|
969
|
+
- test/unit/test_address.rb
|
955
970
|
- test/unit/test_catalog_generator.rb
|
956
971
|
- test/unit/test_line_buffer.rb
|
957
972
|
- test/unit/test_message_matcher.rb
|
data/lib/droonga/server.rb
DELETED
@@ -1,45 +0,0 @@
|
|
1
|
-
# -*- coding: utf-8 -*-
|
2
|
-
#
|
3
|
-
# Copyright (C) 2013 Droonga Project
|
4
|
-
#
|
5
|
-
# This library is free software; you can redistribute it and/or
|
6
|
-
# modify it under the terms of the GNU Lesser General Public
|
7
|
-
# License version 2.1 as published by the Free Software Foundation.
|
8
|
-
#
|
9
|
-
# This library is distributed in the hope that it will be useful,
|
10
|
-
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
11
|
-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
12
|
-
# Lesser General Public License for more details.
|
13
|
-
#
|
14
|
-
# You should have received a copy of the GNU Lesser General Public
|
15
|
-
# License along with this library; if not, write to the Free Software
|
16
|
-
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
17
|
-
|
18
|
-
require "droonga/logger"
|
19
|
-
|
20
|
-
module Droonga
|
21
|
-
module Server
|
22
|
-
def before_run
|
23
|
-
Droonga.logger.trace("#{log_tag}: before_run: start")
|
24
|
-
config[:job_pusher].close
|
25
|
-
config.delete(:job_pusher)
|
26
|
-
Droonga.logger.trace("#{log_tag}: before_run: done")
|
27
|
-
end
|
28
|
-
|
29
|
-
def after_run
|
30
|
-
Droonga.logger.trace("#{log_tag}: after_run: start")
|
31
|
-
Droonga.logger.trace("#{log_tag}: after_run: done")
|
32
|
-
end
|
33
|
-
|
34
|
-
def stop(stop_gracefully)
|
35
|
-
Droonga.logger.trace("#{log_tag}: stop: start")
|
36
|
-
super(stop_gracefully)
|
37
|
-
Droonga.logger.trace("#{log_tag}: stop: done")
|
38
|
-
end
|
39
|
-
|
40
|
-
private
|
41
|
-
def log_tag
|
42
|
-
"[#{Process.ppid}][#{Process.pid}] server"
|
43
|
-
end
|
44
|
-
end
|
45
|
-
end
|
data/lib/droonga/worker.rb
DELETED
@@ -1,66 +0,0 @@
|
|
1
|
-
# Copyright (C) 2013-2014 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
15
|
-
|
16
|
-
require "droonga/event_loop"
|
17
|
-
require "droonga/handler_runner"
|
18
|
-
require "droonga/job_receiver"
|
19
|
-
|
20
|
-
module Droonga
|
21
|
-
module Worker
|
22
|
-
def initialize
|
23
|
-
@raw_loop = Coolio::Loop.new
|
24
|
-
@loop = EventLoop.new(@raw_loop)
|
25
|
-
@forwarder = Forwarder.new(@loop)
|
26
|
-
@handler_runner = HandlerRunner.new(@loop,
|
27
|
-
config.merge(:dispatcher => nil,
|
28
|
-
:engine_state => nil,
|
29
|
-
:forwarder => @forwarder))
|
30
|
-
receive_socket_path = config[:job_receive_socket_path]
|
31
|
-
@job_receiver = JobReceiver.new(@loop, receive_socket_path) do |message|
|
32
|
-
process(message)
|
33
|
-
end
|
34
|
-
end
|
35
|
-
|
36
|
-
def run
|
37
|
-
Droonga.logger.trace("#{log_tag}: run: start")
|
38
|
-
@forwarder.start
|
39
|
-
@handler_runner.start
|
40
|
-
@job_receiver.start
|
41
|
-
@raw_loop.run
|
42
|
-
@handler_runner.shutdown
|
43
|
-
@forwarder.shutdown
|
44
|
-
Droonga.logger.trace("#{log_tag}: run: done")
|
45
|
-
end
|
46
|
-
|
47
|
-
def stop
|
48
|
-
Droonga.logger.trace("#{log_tag}: stop: start")
|
49
|
-
@job_receiver.shutdown
|
50
|
-
@raw_loop.stop
|
51
|
-
@loop.break_current_loop
|
52
|
-
Droonga.logger.trace("#{log_tag}: stop: done")
|
53
|
-
end
|
54
|
-
|
55
|
-
private
|
56
|
-
def process(message)
|
57
|
-
Droonga.logger.trace("#{log_tag}: process: start")
|
58
|
-
@handler_runner.process(message)
|
59
|
-
Droonga.logger.trace("#{log_tag}: process: done")
|
60
|
-
end
|
61
|
-
|
62
|
-
def log_tag
|
63
|
-
"[#{Process.ppid}][#{Process.pid}] worker"
|
64
|
-
end
|
65
|
-
end
|
66
|
-
end
|