Class: LogStash::Outputs::Elasticsearch::Protocols::NodeClient
- Defined in:
- lib/logstash/outputs/elasticsearch/protocol.rb
Overview
class HTTPClient
Direct Known Subclasses
Instance Method Summary collapse
-
#bulk(actions) ⇒ Object
def build_client.
-
#initialize(options = {}) ⇒ NodeClient
constructor
A new instance of NodeClient.
Methods inherited from Base
Constructor Details
#initialize(options = {}) ⇒ NodeClient
Returns a new instance of NodeClient.
111 112 113 114 115 116 117 |
# File 'lib/logstash/outputs/elasticsearch/protocol.rb', line 111 def initialize(={}) super require "java" @options = DEFAULT_OPTIONS.merge() setup(@options) @client = client end |
Instance Method Details
#bulk(actions) ⇒ Object
def build_client
184 185 186 187 188 189 190 191 192 193 |
# File 'lib/logstash/outputs/elasticsearch/protocol.rb', line 184 def bulk(actions) # Actions an array of [ action, action_metadata, source ] prep = @client.prepareBulk actions.each do |action, args, source| prep.add(build_request(action, args, source)) end response = prep.execute.actionGet() # TODO(sissel): What format should the response be in? end |