Sha256: ddf31229f91c750d851cd955edefe036d4ab0b8de0b891e95d926a73018ac900
Contents?: true
Size: 1.14 KB
Versions: 77
Compression:
Stored size: 1.14 KB
Contents
module Riddle class Configuration class DistributedIndex < Riddle::Configuration::Section self.settings = [:type, :local, :agent, :agent_connect_timeout, :agent_query_timeout] attr_accessor :name, :local_indexes, :remote_indexes, :agent_connect_timeout, :agent_query_timeout def initialize(name) @name = name @local_indexes = [] @remote_indexes = [] end def type "distributed" end def local self.local_indexes end def agent agents = remote_indexes.collect { |index| index.remote }.uniq agents.collect { |agent| agent + ":" + remote_indexes.select { |index| index.remote == agent }.collect { |index| index.name }.join(",") } end def render raise ConfigurationError unless valid? ( ["index #{name}", "{"] + settings_body + ["}", ""] ).join("\n") end def valid? @local_indexes.length > 0 || @remote_indexes.length > 0 end end end end
Version data entries
77 entries across 77 versions & 15 rubygems