Class: ElasticSearch::Transport::Memcached
- Defined in:
- lib/elasticsearch/transport/memcached.rb
Defined Under Namespace
Classes: Response
Constant Summary collapse
- DEFAULTS =
{ :timeout => 5 }.freeze
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
- #all_nodes ⇒ Object
- #close ⇒ Object
- #connect! ⇒ Object
-
#initialize(server, options = {}) ⇒ Memcached
constructor
A new instance of Memcached.
Methods inherited from Base
Methods included from ClusterAdminProtocol
#cluster_health, #cluster_state, #nodes_info, #nodes_stats, #restart_nodes, #shutdown_nodes
Methods included from IndexAdminProtocol
#alias_index, #create_index, #create_river, #delete_index, #delete_mapping, #delete_river, #flush, #get_aliases, #get_river, #get_settings, #index_mapping, #index_status, #optimize, #refresh, #river_status, #snapshot, #update_mapping, #update_settings
Methods included from IndexProtocol
#bulk, #count, #delete, #delete_by_query, #get, #index, #multi_get, #scroll, #search
Constructor Details
Instance Method Details
#all_nodes ⇒ Object
29 30 31 32 33 34 35 36 37 |
# File 'lib/elasticsearch/transport/memcached.rb', line 29 def all_nodes memcached_addresses = nodes_info([])["nodes"].collect { |id, node| node["memcached_address"] } memcached_addresses.collect! do |a| if a =~ /inet\[.*\/([\d.:]+)\]/ $1 end end.compact! memcached_addresses end |
#close ⇒ Object
25 26 27 |
# File 'lib/elasticsearch/transport/memcached.rb', line 25 def close @memcached.quit end |
#connect! ⇒ Object
21 22 23 |
# File 'lib/elasticsearch/transport/memcached.rb', line 21 def connect! @memcached = ::Memcached.new(@server, :timeout => @options[:timeout]) #TODO allow passing other options? end |