fluent-plugin-droonga 0.9.9 → 1.0.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/.dir-locals.el +3 -0
- data/.travis.yml +6 -2
- data/README.md +6 -7
- data/Rakefile +23 -6
- data/fluent-plugin-droonga.gemspec +2 -2
- data/lib/droonga/adapter.rb +12 -3
- data/lib/droonga/adapter_runner.rb +28 -23
- data/lib/droonga/catalog/base.rb +7 -111
- data/lib/droonga/catalog/dataset.rb +13 -25
- data/lib/droonga/catalog/errors.rb +94 -0
- data/lib/droonga/catalog/schema.rb +277 -0
- data/lib/droonga/catalog/version1.rb +404 -0
- data/lib/droonga/catalog/version2.rb +160 -0
- data/lib/droonga/catalog_loader.rb +27 -4
- data/lib/droonga/catalog_observer.rb +44 -6
- data/lib/droonga/collector.rb +12 -10
- data/lib/droonga/{handler_plugin.rb → collector_message.rb} +47 -20
- data/lib/droonga/collector_runner.rb +64 -0
- data/lib/droonga/collectors.rb +18 -0
- data/lib/droonga/{catalog.rb → collectors/add.rb} +9 -7
- data/lib/droonga/{command_repository.rb → collectors/and.rb} +7 -14
- data/lib/droonga/collectors/sum.rb +26 -0
- data/lib/droonga/dispatcher.rb +74 -41
- data/lib/droonga/distributed_command_planner.rb +2 -2
- data/lib/droonga/engine.rb +13 -5
- data/lib/droonga/{message_processing_error.rb → error.rb} +33 -12
- data/lib/droonga/{plugin/planner/search.rb → error_messages.rb} +12 -10
- data/lib/droonga/farm.rb +15 -14
- data/lib/droonga/fluent_message_sender.rb +15 -11
- data/lib/droonga/forwarder.rb +22 -18
- data/lib/droonga/handler.rb +8 -2
- data/lib/droonga/handler_runner.rb +47 -26
- data/lib/droonga/input_message.rb +6 -6
- data/lib/droonga/{command.rb → loggable.rb} +7 -14
- data/lib/droonga/logger.rb +56 -15
- data/lib/droonga/message_matcher.rb +12 -7
- data/lib/droonga/message_pusher.rb +8 -4
- data/lib/droonga/message_receiver.rb +11 -9
- data/lib/droonga/output_message.rb +2 -0
- data/lib/droonga/planner.rb +21 -10
- data/lib/droonga/plugin.rb +15 -0
- data/lib/droonga/plugin/metadata/{adapter_message.rb → adapter_input_message.rb} +6 -14
- data/lib/droonga/plugin/metadata/adapter_output_message.rb +39 -0
- data/lib/droonga/plugin/metadata/collector_message.rb +39 -0
- data/lib/droonga/plugin/metadata/input_message.rb +15 -0
- data/lib/droonga/plugin_loader.rb +33 -25
- data/lib/droonga/plugin_registry.rb +9 -1
- data/lib/droonga/plugins/basic.rb +54 -0
- data/lib/droonga/plugins/crud.rb +36 -15
- data/lib/droonga/plugins/error.rb +5 -4
- data/lib/droonga/plugins/groonga.rb +9 -6
- data/lib/droonga/plugins/groonga/column_create.rb +10 -5
- data/lib/droonga/plugins/groonga/generic_command.rb +2 -8
- data/lib/droonga/plugins/groonga/generic_response.rb +2 -2
- data/lib/droonga/plugins/groonga/select.rb +2 -2
- data/lib/droonga/plugins/groonga/table_create.rb +9 -4
- data/lib/droonga/plugins/groonga/table_remove.rb +10 -5
- data/lib/droonga/plugins/search.rb +106 -5
- data/lib/droonga/plugins/search/distributed_search_planner.rb +398 -0
- data/lib/droonga/plugins/watch.rb +41 -20
- data/lib/droonga/processor.rb +12 -9
- data/lib/droonga/{plugin/collector/basic.rb → reducer.rb} +36 -50
- data/lib/droonga/replier.rb +7 -4
- data/lib/droonga/searcher.rb +40 -37
- data/lib/droonga/server.rb +8 -6
- data/lib/droonga/session.rb +17 -7
- data/lib/droonga/single_step.rb +53 -0
- data/lib/droonga/{plugin/planner/watch.rb → single_step_definition.rb} +27 -26
- data/lib/droonga/{partition.rb → slice.rb} +23 -12
- data/lib/droonga/status_code.rb +25 -0
- data/lib/droonga/step_runner.rb +63 -0
- data/lib/droonga/watch_schema.rb +7 -3
- data/lib/droonga/watcher.rb +4 -4
- data/lib/droonga/worker.rb +6 -6
- data/lib/fluent/plugin/out_droonga.rb +27 -2
- data/sample/cluster/catalog.json +33 -32
- data/test/command/config/default/catalog.json +72 -45
- data/test/command/config/version1/catalog.json +68 -0
- data/test/command/config/version1/fluentd.conf +11 -0
- data/test/command/suite/message/error/missing-dataset.expected +1 -1
- data/test/command/suite/message/error/unknown-dataset.expected +1 -1
- data/test/command/suite/message/error/unknown-type.expected +13 -0
- data/test/command/suite/message/error/{unknown-command.test → unknown-type.test} +1 -1
- data/test/command/suite/search/error/missing-source-parameter.expected +1 -1
- data/test/command/suite/search/error/unknown-source.expected +15 -3
- data/test/command/suite/watch/subscribe.expected +1 -3
- data/test/command/suite/watch/unsubscribe.expected +1 -3
- data/test/performance/watch/catalog.json +1 -0
- data/test/unit/catalog/test_dataset.rb +16 -358
- data/test/unit/catalog/test_schema.rb +285 -0
- data/test/unit/catalog/test_version1.rb +222 -28
- data/test/unit/catalog/test_version2.rb +155 -0
- data/test/unit/fixtures/catalog/version2.json +62 -0
- data/test/unit/helper/distributed_search_planner_helper.rb +2 -2
- data/test/unit/plugins/crud/test_add.rb +13 -13
- data/test/unit/plugins/groonga/test_column_create.rb +14 -11
- data/test/unit/plugins/groonga/test_table_create.rb +4 -9
- data/test/unit/plugins/groonga/test_table_remove.rb +4 -9
- data/test/unit/{plugin/planner/search_planner → plugins/search/planner}/test_basic.rb +0 -0
- data/test/unit/{plugin/planner/search_planner → plugins/search/planner}/test_group_by.rb +0 -0
- data/test/unit/{plugin/planner/search_planner → plugins/search/planner}/test_output.rb +0 -0
- data/test/unit/{plugin/planner/search_planner → plugins/search/planner}/test_sort_by.rb +0 -0
- data/test/unit/{plugin/collector/test_search.rb → plugins/search/test_collector.rb} +40 -39
- data/test/unit/plugins/{test_search.rb → search/test_handler.rb} +6 -5
- data/test/unit/{plugin/planner/test_search.rb → plugins/search/test_planner.rb} +3 -3
- data/test/unit/{plugin/collector → plugins}/test_basic.rb +68 -50
- data/test/unit/plugins/test_groonga.rb +2 -15
- data/test/unit/plugins/test_watch.rb +25 -22
- data/test/unit/test_message_matcher.rb +29 -6
- data/test/unit/test_output.rb +4 -0
- metadata +58 -50
- data/lib/droonga/collector_plugin.rb +0 -50
- data/lib/droonga/legacy_pluggable.rb +0 -66
- data/lib/droonga/legacy_plugin.rb +0 -57
- data/lib/droonga/legacy_plugin_repository.rb +0 -54
- data/lib/droonga/planner_plugin.rb +0 -54
- data/lib/droonga/plugin/collector/search.rb +0 -98
- data/lib/droonga/plugin/planner/crud.rb +0 -49
- data/lib/droonga/plugin/planner/distributed_search_planner.rb +0 -393
- data/lib/droonga/plugin/planner/groonga.rb +0 -54
- data/lib/droonga/plugin_registerable.rb +0 -75
- data/test/command/suite/message/error/unknown-command.expected +0 -13
- data/test/unit/test_command_repository.rb +0 -39
- data/test/unit/test_legacy_plugin.rb +0 -50
- data/test/unit/test_legacy_plugin_repository.rb +0 -89
data/test/unit/test_output.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: fluent-plugin-droonga
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 1.0.0
|
|
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-02-
|
|
11
|
+
date: 2014-02-28 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: fluentd
|
|
@@ -178,13 +178,14 @@ dependencies:
|
|
|
178
178
|
- - '>='
|
|
179
179
|
- !ruby/object:Gem::Version
|
|
180
180
|
version: '0'
|
|
181
|
-
description: Droonga(distributed Groonga) plugin for Fluent event collector
|
|
181
|
+
description: Droonga (distributed Groonga) plugin for Fluent event collector
|
|
182
182
|
email:
|
|
183
183
|
- droonga@groonga.org
|
|
184
184
|
executables: []
|
|
185
185
|
extensions: []
|
|
186
186
|
extra_rdoc_files: []
|
|
187
187
|
files:
|
|
188
|
+
- .dir-locals.el
|
|
188
189
|
- .gitignore
|
|
189
190
|
- .travis.yml
|
|
190
191
|
- .yardopts
|
|
@@ -202,20 +203,27 @@ files:
|
|
|
202
203
|
- fluent-plugin-droonga.gemspec
|
|
203
204
|
- lib/droonga/adapter.rb
|
|
204
205
|
- lib/droonga/adapter_runner.rb
|
|
205
|
-
- lib/droonga/catalog.rb
|
|
206
206
|
- lib/droonga/catalog/base.rb
|
|
207
207
|
- lib/droonga/catalog/dataset.rb
|
|
208
|
+
- lib/droonga/catalog/errors.rb
|
|
209
|
+
- lib/droonga/catalog/schema.rb
|
|
208
210
|
- lib/droonga/catalog/version1.rb
|
|
211
|
+
- lib/droonga/catalog/version2.rb
|
|
209
212
|
- lib/droonga/catalog_loader.rb
|
|
210
213
|
- lib/droonga/catalog_observer.rb
|
|
211
214
|
- lib/droonga/collector.rb
|
|
212
|
-
- lib/droonga/
|
|
213
|
-
- lib/droonga/
|
|
214
|
-
- lib/droonga/
|
|
215
|
+
- lib/droonga/collector_message.rb
|
|
216
|
+
- lib/droonga/collector_runner.rb
|
|
217
|
+
- lib/droonga/collectors.rb
|
|
218
|
+
- lib/droonga/collectors/add.rb
|
|
219
|
+
- lib/droonga/collectors/and.rb
|
|
220
|
+
- lib/droonga/collectors/sum.rb
|
|
215
221
|
- lib/droonga/dispatcher.rb
|
|
216
222
|
- lib/droonga/distributed_command_planner.rb
|
|
217
223
|
- lib/droonga/distributor.rb
|
|
218
224
|
- lib/droonga/engine.rb
|
|
225
|
+
- lib/droonga/error.rb
|
|
226
|
+
- lib/droonga/error_messages.rb
|
|
219
227
|
- lib/droonga/event_loop.rb
|
|
220
228
|
- lib/droonga/farm.rb
|
|
221
229
|
- lib/droonga/fluent_message_sender.rb
|
|
@@ -223,37 +231,26 @@ files:
|
|
|
223
231
|
- lib/droonga/handler.rb
|
|
224
232
|
- lib/droonga/handler_message.rb
|
|
225
233
|
- lib/droonga/handler_messenger.rb
|
|
226
|
-
- lib/droonga/handler_plugin.rb
|
|
227
234
|
- lib/droonga/handler_runner.rb
|
|
228
235
|
- lib/droonga/input_message.rb
|
|
229
|
-
- lib/droonga/
|
|
230
|
-
- lib/droonga/legacy_plugin.rb
|
|
231
|
-
- lib/droonga/legacy_plugin_repository.rb
|
|
236
|
+
- lib/droonga/loggable.rb
|
|
232
237
|
- lib/droonga/logger.rb
|
|
233
238
|
- lib/droonga/message_matcher.rb
|
|
234
239
|
- lib/droonga/message_pack_packer.rb
|
|
235
|
-
- lib/droonga/message_processing_error.rb
|
|
236
240
|
- lib/droonga/message_pusher.rb
|
|
237
241
|
- lib/droonga/message_receiver.rb
|
|
238
242
|
- lib/droonga/output_message.rb
|
|
239
|
-
- lib/droonga/partition.rb
|
|
240
243
|
- lib/droonga/planner.rb
|
|
241
|
-
- lib/droonga/planner_plugin.rb
|
|
242
244
|
- lib/droonga/pluggable.rb
|
|
243
245
|
- lib/droonga/plugin.rb
|
|
244
|
-
- lib/droonga/plugin/
|
|
245
|
-
- lib/droonga/plugin/
|
|
246
|
-
- lib/droonga/plugin/metadata/
|
|
246
|
+
- lib/droonga/plugin/metadata/adapter_input_message.rb
|
|
247
|
+
- lib/droonga/plugin/metadata/adapter_output_message.rb
|
|
248
|
+
- lib/droonga/plugin/metadata/collector_message.rb
|
|
247
249
|
- lib/droonga/plugin/metadata/handler_action.rb
|
|
248
250
|
- lib/droonga/plugin/metadata/input_message.rb
|
|
249
|
-
- lib/droonga/plugin/planner/crud.rb
|
|
250
|
-
- lib/droonga/plugin/planner/distributed_search_planner.rb
|
|
251
|
-
- lib/droonga/plugin/planner/groonga.rb
|
|
252
|
-
- lib/droonga/plugin/planner/search.rb
|
|
253
|
-
- lib/droonga/plugin/planner/watch.rb
|
|
254
251
|
- lib/droonga/plugin_loader.rb
|
|
255
|
-
- lib/droonga/plugin_registerable.rb
|
|
256
252
|
- lib/droonga/plugin_registry.rb
|
|
253
|
+
- lib/droonga/plugins/basic.rb
|
|
257
254
|
- lib/droonga/plugins/crud.rb
|
|
258
255
|
- lib/droonga/plugins/error.rb
|
|
259
256
|
- lib/droonga/plugins/groonga.rb
|
|
@@ -264,13 +261,20 @@ files:
|
|
|
264
261
|
- lib/droonga/plugins/groonga/table_create.rb
|
|
265
262
|
- lib/droonga/plugins/groonga/table_remove.rb
|
|
266
263
|
- lib/droonga/plugins/search.rb
|
|
264
|
+
- lib/droonga/plugins/search/distributed_search_planner.rb
|
|
267
265
|
- lib/droonga/plugins/watch.rb
|
|
268
266
|
- lib/droonga/processor.rb
|
|
267
|
+
- lib/droonga/reducer.rb
|
|
269
268
|
- lib/droonga/replier.rb
|
|
270
269
|
- lib/droonga/searcher.rb
|
|
271
270
|
- lib/droonga/searcher/mecab_filter.rb
|
|
272
271
|
- lib/droonga/server.rb
|
|
273
272
|
- lib/droonga/session.rb
|
|
273
|
+
- lib/droonga/single_step.rb
|
|
274
|
+
- lib/droonga/single_step_definition.rb
|
|
275
|
+
- lib/droonga/slice.rb
|
|
276
|
+
- lib/droonga/status_code.rb
|
|
277
|
+
- lib/droonga/step_runner.rb
|
|
274
278
|
- lib/droonga/sweeper.rb
|
|
275
279
|
- lib/droonga/test.rb
|
|
276
280
|
- lib/droonga/test/stub_handler.rb
|
|
@@ -290,6 +294,8 @@ files:
|
|
|
290
294
|
- sample/mecab_filter/search_without_mecab_filter.json
|
|
291
295
|
- test/command/config/default/catalog.json
|
|
292
296
|
- test/command/config/default/fluentd.conf
|
|
297
|
+
- test/command/config/version1/catalog.json
|
|
298
|
+
- test/command/config/version1/fluentd.conf
|
|
293
299
|
- test/command/fixture/documents.jsons
|
|
294
300
|
- test/command/fixture/event.jsons
|
|
295
301
|
- test/command/fixture/user-table-array.jsons
|
|
@@ -331,10 +337,10 @@ files:
|
|
|
331
337
|
- test/command/suite/groonga/table_remove/unknown-table.test
|
|
332
338
|
- test/command/suite/message/error/missing-dataset.expected
|
|
333
339
|
- test/command/suite/message/error/missing-dataset.test
|
|
334
|
-
- test/command/suite/message/error/unknown-command.expected
|
|
335
|
-
- test/command/suite/message/error/unknown-command.test
|
|
336
340
|
- test/command/suite/message/error/unknown-dataset.expected
|
|
337
341
|
- test/command/suite/message/error/unknown-dataset.test
|
|
342
|
+
- test/command/suite/message/error/unknown-type.expected
|
|
343
|
+
- test/command/suite/message/error/unknown-type.test
|
|
338
344
|
- test/command/suite/search/attributes/array.expected
|
|
339
345
|
- test/command/suite/search/attributes/array.test
|
|
340
346
|
- test/command/suite/search/attributes/hash.expected
|
|
@@ -395,9 +401,12 @@ files:
|
|
|
395
401
|
- test/performance/watch/fluentd.conf
|
|
396
402
|
- test/performance/watch/subscribe.json
|
|
397
403
|
- test/unit/catalog/test_dataset.rb
|
|
404
|
+
- test/unit/catalog/test_schema.rb
|
|
398
405
|
- test/unit/catalog/test_version1.rb
|
|
406
|
+
- test/unit/catalog/test_version2.rb
|
|
399
407
|
- test/unit/fixtures/array.grn
|
|
400
408
|
- test/unit/fixtures/catalog/version1.json
|
|
409
|
+
- test/unit/fixtures/catalog/version2.json
|
|
401
410
|
- test/unit/fixtures/document.grn
|
|
402
411
|
- test/unit/fixtures/reference/array.grn
|
|
403
412
|
- test/unit/fixtures/reference/hash.grn
|
|
@@ -408,26 +417,23 @@ files:
|
|
|
408
417
|
- test/unit/helper/sandbox.rb
|
|
409
418
|
- test/unit/helper/stub_worker.rb
|
|
410
419
|
- test/unit/helper/watch_helper.rb
|
|
411
|
-
- test/unit/plugin/collector/test_basic.rb
|
|
412
|
-
- test/unit/plugin/collector/test_search.rb
|
|
413
|
-
- test/unit/plugin/planner/search_planner/test_basic.rb
|
|
414
|
-
- test/unit/plugin/planner/search_planner/test_group_by.rb
|
|
415
|
-
- test/unit/plugin/planner/search_planner/test_output.rb
|
|
416
|
-
- test/unit/plugin/planner/search_planner/test_sort_by.rb
|
|
417
|
-
- test/unit/plugin/planner/test_search.rb
|
|
418
420
|
- test/unit/plugins/crud/test_add.rb
|
|
419
421
|
- test/unit/plugins/groonga/select/test_adapter_input.rb
|
|
420
422
|
- test/unit/plugins/groonga/select/test_adapter_output.rb
|
|
421
423
|
- test/unit/plugins/groonga/test_column_create.rb
|
|
422
424
|
- test/unit/plugins/groonga/test_table_create.rb
|
|
423
425
|
- test/unit/plugins/groonga/test_table_remove.rb
|
|
426
|
+
- test/unit/plugins/search/planner/test_basic.rb
|
|
427
|
+
- test/unit/plugins/search/planner/test_group_by.rb
|
|
428
|
+
- test/unit/plugins/search/planner/test_output.rb
|
|
429
|
+
- test/unit/plugins/search/planner/test_sort_by.rb
|
|
430
|
+
- test/unit/plugins/search/test_collector.rb
|
|
431
|
+
- test/unit/plugins/search/test_handler.rb
|
|
432
|
+
- test/unit/plugins/search/test_planner.rb
|
|
433
|
+
- test/unit/plugins/test_basic.rb
|
|
424
434
|
- test/unit/plugins/test_groonga.rb
|
|
425
|
-
- test/unit/plugins/test_search.rb
|
|
426
435
|
- test/unit/plugins/test_watch.rb
|
|
427
436
|
- test/unit/run-test.rb
|
|
428
|
-
- test/unit/test_command_repository.rb
|
|
429
|
-
- test/unit/test_legacy_plugin.rb
|
|
430
|
-
- test/unit/test_legacy_plugin_repository.rb
|
|
431
437
|
- test/unit/test_message_matcher.rb
|
|
432
438
|
- test/unit/test_message_pack_packer.rb
|
|
433
439
|
- test/unit/test_output.rb
|
|
@@ -457,10 +463,12 @@ rubyforge_project:
|
|
|
457
463
|
rubygems_version: 2.0.14
|
|
458
464
|
signing_key:
|
|
459
465
|
specification_version: 4
|
|
460
|
-
summary: Droonga(distributed Groonga) plugin for Fluent event collector
|
|
466
|
+
summary: Droonga (distributed Groonga) plugin for Fluent event collector
|
|
461
467
|
test_files:
|
|
462
468
|
- test/command/config/default/catalog.json
|
|
463
469
|
- test/command/config/default/fluentd.conf
|
|
470
|
+
- test/command/config/version1/catalog.json
|
|
471
|
+
- test/command/config/version1/fluentd.conf
|
|
464
472
|
- test/command/fixture/documents.jsons
|
|
465
473
|
- test/command/fixture/event.jsons
|
|
466
474
|
- test/command/fixture/user-table-array.jsons
|
|
@@ -502,10 +510,10 @@ test_files:
|
|
|
502
510
|
- test/command/suite/groonga/table_remove/unknown-table.test
|
|
503
511
|
- test/command/suite/message/error/missing-dataset.expected
|
|
504
512
|
- test/command/suite/message/error/missing-dataset.test
|
|
505
|
-
- test/command/suite/message/error/unknown-command.expected
|
|
506
|
-
- test/command/suite/message/error/unknown-command.test
|
|
507
513
|
- test/command/suite/message/error/unknown-dataset.expected
|
|
508
514
|
- test/command/suite/message/error/unknown-dataset.test
|
|
515
|
+
- test/command/suite/message/error/unknown-type.expected
|
|
516
|
+
- test/command/suite/message/error/unknown-type.test
|
|
509
517
|
- test/command/suite/search/attributes/array.expected
|
|
510
518
|
- test/command/suite/search/attributes/array.test
|
|
511
519
|
- test/command/suite/search/attributes/hash.expected
|
|
@@ -566,9 +574,12 @@ test_files:
|
|
|
566
574
|
- test/performance/watch/fluentd.conf
|
|
567
575
|
- test/performance/watch/subscribe.json
|
|
568
576
|
- test/unit/catalog/test_dataset.rb
|
|
577
|
+
- test/unit/catalog/test_schema.rb
|
|
569
578
|
- test/unit/catalog/test_version1.rb
|
|
579
|
+
- test/unit/catalog/test_version2.rb
|
|
570
580
|
- test/unit/fixtures/array.grn
|
|
571
581
|
- test/unit/fixtures/catalog/version1.json
|
|
582
|
+
- test/unit/fixtures/catalog/version2.json
|
|
572
583
|
- test/unit/fixtures/document.grn
|
|
573
584
|
- test/unit/fixtures/reference/array.grn
|
|
574
585
|
- test/unit/fixtures/reference/hash.grn
|
|
@@ -579,26 +590,23 @@ test_files:
|
|
|
579
590
|
- test/unit/helper/sandbox.rb
|
|
580
591
|
- test/unit/helper/stub_worker.rb
|
|
581
592
|
- test/unit/helper/watch_helper.rb
|
|
582
|
-
- test/unit/plugin/collector/test_basic.rb
|
|
583
|
-
- test/unit/plugin/collector/test_search.rb
|
|
584
|
-
- test/unit/plugin/planner/search_planner/test_basic.rb
|
|
585
|
-
- test/unit/plugin/planner/search_planner/test_group_by.rb
|
|
586
|
-
- test/unit/plugin/planner/search_planner/test_output.rb
|
|
587
|
-
- test/unit/plugin/planner/search_planner/test_sort_by.rb
|
|
588
|
-
- test/unit/plugin/planner/test_search.rb
|
|
589
593
|
- test/unit/plugins/crud/test_add.rb
|
|
590
594
|
- test/unit/plugins/groonga/select/test_adapter_input.rb
|
|
591
595
|
- test/unit/plugins/groonga/select/test_adapter_output.rb
|
|
592
596
|
- test/unit/plugins/groonga/test_column_create.rb
|
|
593
597
|
- test/unit/plugins/groonga/test_table_create.rb
|
|
594
598
|
- test/unit/plugins/groonga/test_table_remove.rb
|
|
599
|
+
- test/unit/plugins/search/planner/test_basic.rb
|
|
600
|
+
- test/unit/plugins/search/planner/test_group_by.rb
|
|
601
|
+
- test/unit/plugins/search/planner/test_output.rb
|
|
602
|
+
- test/unit/plugins/search/planner/test_sort_by.rb
|
|
603
|
+
- test/unit/plugins/search/test_collector.rb
|
|
604
|
+
- test/unit/plugins/search/test_handler.rb
|
|
605
|
+
- test/unit/plugins/search/test_planner.rb
|
|
606
|
+
- test/unit/plugins/test_basic.rb
|
|
595
607
|
- test/unit/plugins/test_groonga.rb
|
|
596
|
-
- test/unit/plugins/test_search.rb
|
|
597
608
|
- test/unit/plugins/test_watch.rb
|
|
598
609
|
- test/unit/run-test.rb
|
|
599
|
-
- test/unit/test_command_repository.rb
|
|
600
|
-
- test/unit/test_legacy_plugin.rb
|
|
601
|
-
- test/unit/test_legacy_plugin_repository.rb
|
|
602
610
|
- test/unit/test_message_matcher.rb
|
|
603
611
|
- test/unit/test_message_pack_packer.rb
|
|
604
612
|
- test/unit/test_output.rb
|
|
@@ -1,50 +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/legacy_plugin"
|
|
19
|
-
|
|
20
|
-
module Droonga
|
|
21
|
-
class CollectorPlugin < LegacyPlugin
|
|
22
|
-
extend PluginRegisterable
|
|
23
|
-
|
|
24
|
-
attr_reader :task, :input_name, :step, :output_values, :body, :output_names
|
|
25
|
-
def initialize
|
|
26
|
-
super()
|
|
27
|
-
end
|
|
28
|
-
|
|
29
|
-
def process(command, message)
|
|
30
|
-
return false unless message.is_a? Hash
|
|
31
|
-
@task = message["task"]
|
|
32
|
-
return false unless @task.is_a? Hash
|
|
33
|
-
@step = @task["step"]
|
|
34
|
-
return false unless @step.is_a? Hash
|
|
35
|
-
@output_values = @task["values"]
|
|
36
|
-
@body = @step["body"]
|
|
37
|
-
@output_names = @step["outputs"]
|
|
38
|
-
@id = message["id"]
|
|
39
|
-
@value = message["value"]
|
|
40
|
-
@input_name = message["name"]
|
|
41
|
-
super(command, @value)
|
|
42
|
-
true
|
|
43
|
-
end
|
|
44
|
-
|
|
45
|
-
# TODO: consider better name
|
|
46
|
-
def emit(name, value)
|
|
47
|
-
@output_values[name] = value
|
|
48
|
-
end
|
|
49
|
-
end
|
|
50
|
-
end
|
|
@@ -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
|
-
module Droonga
|
|
17
|
-
module LegacyPluggable
|
|
18
|
-
class UnknownPlugin < StandardError
|
|
19
|
-
attr_reader :command
|
|
20
|
-
|
|
21
|
-
def initialize(command)
|
|
22
|
-
@command = command
|
|
23
|
-
end
|
|
24
|
-
end
|
|
25
|
-
|
|
26
|
-
def shutdown
|
|
27
|
-
$log.trace("#{log_tag}: shutdown: plugin: start")
|
|
28
|
-
@plugins.each do |plugin|
|
|
29
|
-
plugin.shutdown
|
|
30
|
-
end
|
|
31
|
-
$log.trace("#{log_tag}: shutdown: plugin: done")
|
|
32
|
-
end
|
|
33
|
-
|
|
34
|
-
def processable?(command)
|
|
35
|
-
not find_plugin(command).nil?
|
|
36
|
-
end
|
|
37
|
-
|
|
38
|
-
def process(command, *arguments)
|
|
39
|
-
plugin = find_plugin(command)
|
|
40
|
-
$log.trace("#{log_tag}: process: start: <#{command}>",
|
|
41
|
-
:plugin => plugin.class)
|
|
42
|
-
raise UnknownPlugin.new(command) if plugin.nil?
|
|
43
|
-
result = plugin.process(command, *arguments)
|
|
44
|
-
$log.trace("#{log_tag}: process: done: <#{command}>",
|
|
45
|
-
:plugin => plugin.class)
|
|
46
|
-
result
|
|
47
|
-
end
|
|
48
|
-
|
|
49
|
-
private
|
|
50
|
-
def load_plugins(names)
|
|
51
|
-
@plugins = names.collect do |name|
|
|
52
|
-
plugin = instantiate_plugin(name)
|
|
53
|
-
if plugin.nil?
|
|
54
|
-
raise "unknown plugin: <#{name}>: TODO: improve error handling"
|
|
55
|
-
end
|
|
56
|
-
plugin
|
|
57
|
-
end
|
|
58
|
-
end
|
|
59
|
-
|
|
60
|
-
def find_plugin(command)
|
|
61
|
-
@plugins.find do |plugin|
|
|
62
|
-
plugin.processable?(command)
|
|
63
|
-
end
|
|
64
|
-
end
|
|
65
|
-
end
|
|
66
|
-
end
|
|
@@ -1,57 +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/plugin_registerable"
|
|
19
|
-
|
|
20
|
-
module Droonga
|
|
21
|
-
class LegacyPlugin
|
|
22
|
-
def initialize
|
|
23
|
-
end
|
|
24
|
-
|
|
25
|
-
def start
|
|
26
|
-
end
|
|
27
|
-
|
|
28
|
-
def shutdown
|
|
29
|
-
end
|
|
30
|
-
|
|
31
|
-
def processable?(command)
|
|
32
|
-
self.class.processable?(command)
|
|
33
|
-
end
|
|
34
|
-
|
|
35
|
-
def process(command, *arguments)
|
|
36
|
-
run_command(command, *arguments)
|
|
37
|
-
rescue => exception
|
|
38
|
-
process_error(command, exception, arguments)
|
|
39
|
-
end
|
|
40
|
-
|
|
41
|
-
private
|
|
42
|
-
def run_command(command, *arguments)
|
|
43
|
-
if command.is_a?(Command)
|
|
44
|
-
method_name = command.method_name
|
|
45
|
-
else
|
|
46
|
-
method_name = self.class.method_name(command)
|
|
47
|
-
end
|
|
48
|
-
__send__(method_name, *arguments)
|
|
49
|
-
end
|
|
50
|
-
|
|
51
|
-
def process_error(command, error, arguments)
|
|
52
|
-
Logger.error("error while processing: <#{command}>",
|
|
53
|
-
error,
|
|
54
|
-
:arguments => arguments)
|
|
55
|
-
end
|
|
56
|
-
end
|
|
57
|
-
end
|