Navigation Menu

Skip to content

Commit

Permalink
Return all nodes correctly from version1 catalog
Browse files Browse the repository at this point in the history
  • Loading branch information
piroor committed Jan 22, 2015
1 parent c9cd403 commit 0d98ebb
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion lib/droonga/catalog/version1.rb
Expand Up @@ -439,7 +439,7 @@ def select_range_and_replicas(partition, args, routes)
end

def all_nodes
self["ring"].keys
@all_nodes ||= collect_all_nodes
end

def sliced?
Expand All @@ -449,6 +449,18 @@ def sliced?
end
return false
end

private
def collect_all_nodes
nodes = []
self["ring"].each do |ring_key, part|
part["partitions"].collect do |partition|
partition =~ /\A([^:]+:[0-9]+\/[^\.]+)/
nodes << $1
end
end
nodes.sort.uniq
end
end
end
end
Expand Down

0 comments on commit 0d98ebb

Please sign in to comment.