Navigation Menu

Skip to content

Commit

Permalink
Use private methods directly
Browse files Browse the repository at this point in the history
  • Loading branch information
piroor committed Apr 14, 2015
1 parent efa95d6 commit 8fc3d7b
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions lib/droonga/planner.rb
Expand Up @@ -33,8 +33,6 @@ def initialize(dataset)

def plan(message, params={})
options = {
:write => write?,
:random => random?,
:record => params[:record],
}
if @collector_class
Expand Down Expand Up @@ -67,10 +65,10 @@ def random?
def scatter(message, options={})
planner = DistributedCommandPlanner.new(@dataset, message)
scatter_options = {
:write => options[:write],
:write => write?,
:record => options[:record],
}
scatter_options[:replica] = "random" if options[:random]
scatter_options[:replica] = "random" if random?
planner.scatter(scatter_options)
planner.reduce(options[:reduce])
planner.plan
Expand All @@ -79,9 +77,9 @@ def scatter(message, options={})
def broadcast(message, options={})
planner = DistributedCommandPlanner.new(@dataset, message)
broadcast_options = {
:write => options[:write],
:write => write?,
}
broadcast_options[:replica] = "all" if options[:write]
broadcast_options[:replica] = "all" if write?
planner.broadcast(broadcast_options)
planner.reduce(options[:reduce])
planner.plan
Expand Down

0 comments on commit 8fc3d7b

Please sign in to comment.