class Riddle::Configuration::Searchd

Attributes

mysql41[RW]

Public Class Methods

settings() click to toggle source
# File lib/riddle/configuration/searchd.rb, line 4
def self.settings
  [
    :listen, :address, :port, :log, :query_log,
    :query_log_format, :read_timeout, :client_timeout, :max_children,
    :pid_file, :max_matches, :seamless_rotate, :preopen_indexes,
    :unlink_old, :attr_flush_period, :ondisk_dict_default,
    :max_packet_size, :mva_updates_pool, :crash_log_path, :max_filters,
    :max_filter_values, :listen_backlog, :read_buffer, :read_unhinted,
    :max_batch_queries, :subtree_docs_cache, :subtree_hits_cache,
    :workers, :dist_threads, :binlog_path, :binlog_flush,
    :binlog_max_log_size, :snippets_file_prefix, :collation_server,
    :collation_libc_locale, :plugin_dir, :mysql_version_string,
    :rt_flush_period, :thread_stack, :expansion_limit,
    :compat_sphinxql_magics, :watchdog, :prefork_rotation_throttle,
    :sphinxql_state, :ha_ping_interval, :ha_period_karma,
    :persistent_connections_limit, :rt_merge_iops, :rt_merge_maxiosize,
    :predicted_time_costs, :snippets_file_prefix, :client_key
  ]
end

Public Instance Methods

render() click to toggle source
# File lib/riddle/configuration/searchd.rb, line 27
def render
  raise ConfigurationError unless valid?

  (
    ["searchd", "{"] +
    settings_body +
    ["}", ""]
  ).join("\n")
end
valid?() click to toggle source
# File lib/riddle/0.9.9/configuration/searchd.rb, line 4
def valid?
  set_listen
  clear_deprecated

  !( @listen.nil? || @listen.empty? || @pid_file.nil? )
end

Private Instance Methods

clear_deprecated() click to toggle source
# File lib/riddle/0.9.9/configuration/searchd.rb, line 26
def clear_deprecated
  return if @listen.nil?

  @address  = nil
  @port     = nil
end
set_listen() click to toggle source
# File lib/riddle/0.9.9/configuration/searchd.rb, line 13
def set_listen
  @listen = @listen.to_s if @listen.is_a?(Fixnum)

  return unless @listen.nil? || @listen.empty?

  @listen = []
  @listen << @port.to_s if @port
  @listen << "9306:mysql41" if @mysql41.is_a?(TrueClass)
  @listen << "#{@mysql41}:mysql41" if @mysql41.is_a?(Fixnum)

  @listen.each { |l| l.insert(0, "#{@address}:") } if @address
end