Class: Droonga::PlannerPlugin

Inherits:
LegacyPlugin show all
Extended by:
PluginRegisterable
Defined in:
lib/droonga/planner_plugin.rb

Instance Method Summary collapse

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(message, options={})
  planner = DistributedCommandPlanner.new(message)
  planner.broadcast(:write => options[:write])
  planner.reduce(options[: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(message, options={})
  planner = DistributedCommandPlanner.new(message)
  planner.scatter
  planner.key = options[:key]
  planner.reduce(options[:reduce])
  planner.plan
end