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
-
#initialize(options = {}) ⇒ NodeClient
constructor
A new instance of NodeClient.
Methods inherited from Base
Constructor Details
#initialize(options = {}) ⇒ NodeClient
Returns a new instance of NodeClient.
153 154 155 156 157 158 159 |
# File 'lib/logstash/outputs/elasticsearch/protocol.rb', line 153 def initialize(={}) super require "java" @options = DEFAULT_OPTIONS.merge() setup(@options) @client = client end |
Instance Method Details
#bulk(actions) ⇒ Object
239 240 241 242 243 244 245 246 247 248 |
# File 'lib/logstash/outputs/elasticsearch/protocol.rb', line 239 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() self.class.normalize_bulk_response(response) end |