class Riddle::Configuration::DistributedIndex
Attributes
Public Class Methods
Source
# File lib/riddle/configuration/distributed_index.rb, line 16 def initialize(name) @name = name @local_indices = [] @remote_indices = [] @agent_blackhole = [] end
Source
# File lib/riddle/configuration/distributed_index.rb, line 6 def self.settings [ :type, :local, :agent, :agent_blackhole, :agent_connect_timeout, :agent_query_timeout ] end
Public Instance Methods
Source
# File lib/riddle/configuration/distributed_index.rb, line 31 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
Source
# File lib/riddle/configuration/distributed_index.rb, line 27 def local self.local_indices end
Source
# File lib/riddle/configuration/distributed_index.rb, line 40 def render raise ConfigurationError unless valid? ( ["index #{name}", "{"] + settings_body + ["}", ""] ).join("\n") end
Source
# File lib/riddle/configuration/distributed_index.rb, line 23 def type "distributed" end
Source
# File lib/riddle/configuration/distributed_index.rb, line 50 def valid? @local_indices.length > 0 || @remote_indices.length > 0 end