Class: Droonga::PlannerPlugin
- Inherits:
-
LegacyPlugin
- Object
- LegacyPlugin
- Droonga::PlannerPlugin
- Extended by:
- PluginRegisterable
- Defined in:
- lib/droonga/planner_plugin.rb
Direct Known Subclasses
Instance Method Summary collapse
- #broadcast(message, options = {}) ⇒ Object
-
#initialize(planner) ⇒ PlannerPlugin
constructor
A new instance of PlannerPlugin.
- #scatter(message, options = {}) ⇒ Object
Methods included from PluginRegisterable
command, commands, extended, find_command, inherited, method_name, processable?, repository
Methods inherited from LegacyPlugin
#process, #processable?, #shutdown, #start
Constructor Details
#initialize(planner) ⇒ PlannerPlugin
Returns a new instance of PlannerPlugin.
25 26 27 28 |
# File 'lib/droonga/planner_plugin.rb', line 25 def initialize(planner) super() @planner = planner end |
Instance Method Details
#broadcast(message, options = {}) ⇒ Object
38 39 40 41 42 43 |
# File 'lib/droonga/planner_plugin.rb', line 38 def broadcast(, ={}) planner = DistributedCommandPlanner.new() planner.broadcast(:write => [:write]) planner.reduce([:reduce]) planner.plan end |
#scatter(message, options = {}) ⇒ Object
30 31 32 33 34 35 36 |
# File 'lib/droonga/planner_plugin.rb', line 30 def scatter(, ={}) planner = DistributedCommandPlanner.new() planner.scatter planner.key = [:key] planner.reduce([:reduce]) planner.plan end |