class Riddle::Configuration::DistributedIndex
Attributes
agent_blackhole[RW]
agent_connect_timeout[RW]
agent_query_timeout[RW]
local_indices[RW]
name[RW]
remote_indices[RW]
Public Class Methods
new(name)
click to toggle source
# File lib/riddle/configuration/distributed_index.rb, line 15 def initialize(name) @name = name @local_indices = [] @remote_indices = [] @agent_blackhole = [] end
settings()
click to toggle source
# File lib/riddle/configuration/distributed_index.rb, line 5 def self.settings [ :type, :local, :agent, :agent_blackhole, :agent_connect_timeout, :agent_query_timeout ] end
Public Instance Methods
agent()
click to toggle source
# File lib/riddle/configuration/distributed_index.rb, line 30 def agent agents = remote_indices.collect { |index| index.remote }.uniq agents.collect { |agent| agent + ":" + remote_indices.select { |index| index.remote == agent }.collect { |index| index.name }.join(",") } end
local()
click to toggle source
# File lib/riddle/configuration/distributed_index.rb, line 26 def local self.local_indices end
render()
click to toggle source
# File lib/riddle/configuration/distributed_index.rb, line 39 def render raise ConfigurationError unless valid? ( ["index #{name}", "{"] + settings_body + ["}", ""] ).join("\n") end
type()
click to toggle source
# File lib/riddle/configuration/distributed_index.rb, line 22 def type "distributed" end
valid?()
click to toggle source
# File lib/riddle/configuration/distributed_index.rb, line 49 def valid? @local_indices.length > 0 || @remote_indices.length > 0 end