droonga-engine 1.0.3 → 1.0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (44) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +7 -0
  3. data/bin/droonga-engine-absorb-data +82 -0
  4. data/bin/droonga-engine-catalog-generate +16 -13
  5. data/bin/droonga-engine-catalog-modify +108 -0
  6. data/bin/droonga-engine-join +115 -0
  7. data/bin/droonga-engine-unjoin +90 -0
  8. data/doc/text/news.md +8 -0
  9. data/droonga-engine.gemspec +2 -1
  10. data/lib/droonga/buffered_tcp_socket.rb +132 -0
  11. data/lib/droonga/catalog_generator.rb +87 -4
  12. data/lib/droonga/command/droonga_engine.rb +27 -7
  13. data/lib/droonga/command/droonga_engine_service.rb +3 -2
  14. data/lib/droonga/command/serf_event_handler.rb +211 -14
  15. data/lib/droonga/data_absorber.rb +55 -0
  16. data/lib/droonga/dispatcher.rb +25 -11
  17. data/lib/droonga/engine/version.rb +1 -1
  18. data/lib/droonga/engine.rb +24 -24
  19. data/lib/droonga/engine_state.rb +23 -0
  20. data/lib/droonga/{catalog_observer.rb → file_observer.rb} +12 -7
  21. data/lib/droonga/fluent_message_sender.rb +24 -37
  22. data/lib/droonga/forwarder.rb +30 -5
  23. data/lib/droonga/handler_messenger.rb +3 -2
  24. data/lib/droonga/handler_runner.rb +29 -16
  25. data/lib/droonga/job_pusher.rb +12 -0
  26. data/lib/droonga/line_buffer.rb +42 -0
  27. data/lib/droonga/logger.rb +10 -6
  28. data/lib/droonga/path.rb +16 -0
  29. data/lib/droonga/plugins/search/distributed_search_planner.rb +1 -1
  30. data/lib/droonga/plugins/system.rb +50 -0
  31. data/lib/droonga/processor.rb +9 -4
  32. data/lib/droonga/safe_file_writer.rb +39 -0
  33. data/lib/droonga/serf.rb +212 -14
  34. data/lib/droonga/test/stub_handler_messenger.rb +3 -0
  35. data/lib/droonga/worker.rb +6 -1
  36. data/test/command/config/default/catalog.json +1 -1
  37. data/test/command/config/version1/catalog.json +2 -2
  38. data/test/command/suite/system/status.expected +12 -0
  39. data/test/command/suite/system/status.test +5 -0
  40. data/test/unit/plugins/system/test_status.rb +79 -0
  41. data/test/unit/test_catalog_generator.rb +1 -1
  42. data/test/unit/test_line_buffer.rb +62 -0
  43. metadata +46 -12
  44. data/lib/droonga/live_nodes_list_observer.rb +0 -72
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.3
4
+ version: 1.0.4
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-05-29 00:00:00.000000000 Z
11
+ date: 2014-06-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rroonga
@@ -95,21 +95,21 @@ dependencies:
95
95
  - !ruby/object:Gem::Version
96
96
  version: 1.0.1
97
97
  - !ruby/object:Gem::Dependency
98
- name: listen
98
+ name: faraday
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
- - - ~>
101
+ - - '>='
102
102
  - !ruby/object:Gem::Version
103
- version: '2.7'
103
+ version: '0'
104
104
  type: :runtime
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
- - - ~>
108
+ - - '>='
109
109
  - !ruby/object:Gem::Version
110
- version: '2.7'
110
+ version: '0'
111
111
  - !ruby/object:Gem::Dependency
112
- name: faraday
112
+ name: faraday_middleware
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: faraday_middleware
126
+ name: archive-zip
127
127
  requirement: !ruby/object:Gem::Requirement
128
128
  requirements:
129
129
  - - '>='
@@ -137,7 +137,21 @@ dependencies:
137
137
  - !ruby/object:Gem::Version
138
138
  version: '0'
139
139
  - !ruby/object:Gem::Dependency
140
- name: archive-zip
140
+ name: sigdump
141
+ requirement: !ruby/object:Gem::Requirement
142
+ requirements:
143
+ - - '>='
144
+ - !ruby/object:Gem::Version
145
+ version: '0'
146
+ type: :runtime
147
+ prerelease: false
148
+ version_requirements: !ruby/object:Gem::Requirement
149
+ requirements:
150
+ - - '>='
151
+ - !ruby/object:Gem::Version
152
+ version: '0'
153
+ - !ruby/object:Gem::Dependency
154
+ name: drndump
141
155
  requirement: !ruby/object:Gem::Requirement
142
156
  requirements:
143
157
  - - '>='
@@ -254,9 +268,13 @@ email:
254
268
  - droonga@groonga.org
255
269
  executables:
256
270
  - droonga-engine
271
+ - droonga-engine-absorb-data
257
272
  - droonga-engine-catalog-generate
273
+ - droonga-engine-catalog-modify
274
+ - droonga-engine-join
258
275
  - droonga-engine-serf-event-handler
259
276
  - droonga-engine-service
277
+ - droonga-engine-unjoin
260
278
  extensions: []
261
279
  extra_rdoc_files: []
262
280
  files:
@@ -275,13 +293,18 @@ files:
275
293
  - benchmark/watch/benchmark-publish.rb
276
294
  - benchmark/watch/benchmark-scan.rb
277
295
  - bin/droonga-engine
296
+ - bin/droonga-engine-absorb-data
278
297
  - bin/droonga-engine-catalog-generate
298
+ - bin/droonga-engine-catalog-modify
299
+ - bin/droonga-engine-join
279
300
  - bin/droonga-engine-serf-event-handler
280
301
  - bin/droonga-engine-service
302
+ - bin/droonga-engine-unjoin
281
303
  - doc/text/news.md
282
304
  - droonga-engine.gemspec
283
305
  - lib/droonga/adapter.rb
284
306
  - lib/droonga/adapter_runner.rb
307
+ - lib/droonga/buffered_tcp_socket.rb
285
308
  - lib/droonga/catalog/base.rb
286
309
  - lib/droonga/catalog/collection_volume.rb
287
310
  - lib/droonga/catalog/dataset.rb
@@ -296,7 +319,6 @@ files:
296
319
  - lib/droonga/catalog/volume_collection.rb
297
320
  - lib/droonga/catalog_generator.rb
298
321
  - lib/droonga/catalog_loader.rb
299
- - lib/droonga/catalog_observer.rb
300
322
  - lib/droonga/collector.rb
301
323
  - lib/droonga/collector_message.rb
302
324
  - lib/droonga/collector_runner.rb
@@ -307,6 +329,7 @@ files:
307
329
  - lib/droonga/command/droonga_engine.rb
308
330
  - lib/droonga/command/droonga_engine_service.rb
309
331
  - lib/droonga/command/serf_event_handler.rb
332
+ - lib/droonga/data_absorber.rb
310
333
  - lib/droonga/dispatcher.rb
311
334
  - lib/droonga/distributed_command_planner.rb
312
335
  - lib/droonga/distributor.rb
@@ -317,6 +340,7 @@ files:
317
340
  - lib/droonga/error_messages.rb
318
341
  - lib/droonga/event_loop.rb
319
342
  - lib/droonga/farm.rb
343
+ - lib/droonga/file_observer.rb
320
344
  - lib/droonga/fluent_message_receiver.rb
321
345
  - lib/droonga/fluent_message_sender.rb
322
346
  - lib/droonga/forwarder.rb
@@ -329,8 +353,8 @@ files:
329
353
  - lib/droonga/job_protocol.rb
330
354
  - lib/droonga/job_pusher.rb
331
355
  - lib/droonga/job_receiver.rb
356
+ - lib/droonga/line_buffer.rb
332
357
  - lib/droonga/live_nodes_list_loader.rb
333
- - lib/droonga/live_nodes_list_observer.rb
334
358
  - lib/droonga/loggable.rb
335
359
  - lib/droonga/logger.rb
336
360
  - lib/droonga/message_matcher.rb
@@ -364,10 +388,12 @@ files:
364
388
  - lib/droonga/plugins/groonga/table_remove.rb
365
389
  - lib/droonga/plugins/search.rb
366
390
  - lib/droonga/plugins/search/distributed_search_planner.rb
391
+ - lib/droonga/plugins/system.rb
367
392
  - lib/droonga/plugins/watch.rb
368
393
  - lib/droonga/processor.rb
369
394
  - lib/droonga/reducer.rb
370
395
  - lib/droonga/replier.rb
396
+ - lib/droonga/safe_file_writer.rb
371
397
  - lib/droonga/schema_applier.rb
372
398
  - lib/droonga/searcher.rb
373
399
  - lib/droonga/searcher/mecab_filter.rb
@@ -589,6 +615,8 @@ files:
589
615
  - test/command/suite/search/sort/default-offset-limit.test
590
616
  - test/command/suite/search/sort/invisible-column.expected
591
617
  - test/command/suite/search/sort/invisible-column.test
618
+ - test/command/suite/system/status.expected
619
+ - test/command/suite/system/status.test
592
620
  - test/command/suite/watch/subscribe.expected
593
621
  - test/command/suite/watch/subscribe.test
594
622
  - test/command/suite/watch/unsubscribe.expected
@@ -638,11 +666,13 @@ files:
638
666
  - test/unit/plugins/search/test_collector.rb
639
667
  - test/unit/plugins/search/test_handler.rb
640
668
  - test/unit/plugins/search/test_planner.rb
669
+ - test/unit/plugins/system/test_status.rb
641
670
  - test/unit/plugins/test_basic.rb
642
671
  - test/unit/plugins/test_groonga.rb
643
672
  - test/unit/plugins/test_watch.rb
644
673
  - test/unit/run-test.rb
645
674
  - test/unit/test_catalog_generator.rb
675
+ - test/unit/test_line_buffer.rb
646
676
  - test/unit/test_message_matcher.rb
647
677
  - test/unit/test_schema_applier.rb
648
678
  - test/unit/test_sweeper.rb
@@ -866,6 +896,8 @@ test_files:
866
896
  - test/command/suite/search/sort/default-offset-limit.test
867
897
  - test/command/suite/search/sort/invisible-column.expected
868
898
  - test/command/suite/search/sort/invisible-column.test
899
+ - test/command/suite/system/status.expected
900
+ - test/command/suite/system/status.test
869
901
  - test/command/suite/watch/subscribe.expected
870
902
  - test/command/suite/watch/subscribe.test
871
903
  - test/command/suite/watch/unsubscribe.expected
@@ -915,11 +947,13 @@ test_files:
915
947
  - test/unit/plugins/search/test_collector.rb
916
948
  - test/unit/plugins/search/test_handler.rb
917
949
  - test/unit/plugins/search/test_planner.rb
950
+ - test/unit/plugins/system/test_status.rb
918
951
  - test/unit/plugins/test_basic.rb
919
952
  - test/unit/plugins/test_groonga.rb
920
953
  - test/unit/plugins/test_watch.rb
921
954
  - test/unit/run-test.rb
922
955
  - test/unit/test_catalog_generator.rb
956
+ - test/unit/test_line_buffer.rb
923
957
  - test/unit/test_message_matcher.rb
924
958
  - test/unit/test_schema_applier.rb
925
959
  - test/unit/test_sweeper.rb
@@ -1,72 +0,0 @@
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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
15
-
16
- require "fileutils"
17
- require "listen"
18
-
19
- require "droonga/path"
20
- require "droonga/loggable"
21
- require "droonga/live_nodes_list_loader"
22
-
23
- module Droonga
24
- class LiveNodesListObserver
25
- class << self
26
- FILE_NAME = "live-nodes.json"
27
-
28
- def path
29
- Path.state + FILE_NAME
30
- end
31
- end
32
-
33
- include Loggable
34
-
35
- attr_accessor :on_update
36
-
37
- def initialize
38
- end
39
-
40
- def start
41
- path = self.class.path
42
- file_name = path.expand_path.to_s
43
- directory = path.dirname.to_s
44
- FileUtils.mkdir_p(directory)
45
- @listener = Listen.to(directory) do |modified, added, removed|
46
- if added.include?(file_name) or
47
- modified.include?(file_name)
48
- load_list!
49
- end
50
- end
51
- @listener.start
52
- end
53
-
54
- def stop
55
- @listener.stop
56
- end
57
-
58
- def load_list!
59
- path = self.class.path
60
- loader = LiveNodesListLoader.new(path)
61
- live_nodes = loader.load
62
- logger.info("loaded", :path => path.to_s, :live_nodes => live_nodes)
63
-
64
- on_update.call(live_nodes) if on_update
65
- end
66
-
67
- private
68
- def log_tag
69
- "live-nodes-list-observer"
70
- end
71
- end
72
- end