class Siberite::Client::Partitioning
Public Class Methods
new(client_map)
click to toggle source
# File lib/siberite/client/partitioning.rb, line 5 def initialize(client_map) @clients = client_map.inject({}) do |clients, (keys, client)| Array(keys).inject(clients) do |_, key| clients.update(key => client) end end end
Public Instance Methods
client_for(key)
click to toggle source
# File lib/siberite/client/partitioning.rb, line 30 def client_for(key) @clients[key.to_s.split('/', 2).first] || default_client end
clients()
click to toggle source
# File lib/siberite/client/partitioning.rb, line 13 def clients @clients.values.uniq end
default_client()
click to toggle source
# File lib/siberite/client/partitioning.rb, line 17 def default_client @clients[:default] end
Also aliased as: client
stats()
click to toggle source
# File lib/siberite/client/partitioning.rb, line 26 def stats merge_stats(clients.map {|c| c.stats }) end