Class: ElasticSearch::Transport::Base

Inherits:
Object
  • Object
show all
Includes:
BaseProtocol
Defined in:
lib/elasticsearch/transport/base.rb

Direct Known Subclasses

HTTP, Memcached, Thrift

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#initialize(server, options = {}) ⇒ Base

Returns a new instance of Base.



16
17
18
19
# File 'lib/elasticsearch/transport/base.rb', line 16

def initialize(server, options={})
  @server = server
  @options = DEFAULTS.merge(options)
end

Instance Attribute Details

#optionsObject

Returns the value of attribute options.



14
15
16
# File 'lib/elasticsearch/transport/base.rb', line 14

def options
  @options
end

#serverObject

Returns the value of attribute server.



14
15
16
# File 'lib/elasticsearch/transport/base.rb', line 14

def server
  @server
end

Instance Method Details

#all_nodesObject

Raises:

  • (NotImplementedError)


32
33
34
# File 'lib/elasticsearch/transport/base.rb', line 32

def all_nodes
  raise NotImplementedError
end

#closeObject



25
26
# File 'lib/elasticsearch/transport/base.rb', line 25

def close
end

#connect!Object

Raises:

  • (NotImplementedError)


21
22
23
# File 'lib/elasticsearch/transport/base.rb', line 21

def connect!
  raise NotImplementedError
end

#encoderObject



28
29
30
# File 'lib/elasticsearch/transport/base.rb', line 28

def encoder
  @encoder ||= @options[:encoder].new
end

#request(method, operation, params = {}, body = nil, headers = {}) ⇒ Object

Raises:

  • (NotImplementedError)


36
37
38
# File 'lib/elasticsearch/transport/base.rb', line 36

def request(method, operation, params={}, body=nil, headers={})
  raise NotImplementedError
end