Class: Fluent::ObjectBufferedOutput

Inherits:
BufferedOutput show all
Defined in:
lib/fluent/output.rb

Direct Known Subclasses

ForwardOutput

Defined Under Namespace

Modules: BufferedEventStreamMixin

Constant Summary

Constants included from Configurable

Configurable::CONFIG_TYPE_REGISTRY

Instance Attribute Summary

Attributes inherited from Output

#router

Attributes included from PluginLoggerMixin

#log

Instance Method Summary collapse

Methods inherited from BufferedOutput

#before_shutdown, #calc_retry_wait, #configure, #enqueue_buffer, #flush_secondary, #force_flush, #format_stream, #shutdown, #start, #submit_flush, #try_flush, #write_abort

Methods inherited from Output

#configure, #secondary_init, #shutdown, #start

Methods included from PluginLoggerMixin

#configure, included

Methods included from PluginId

#configure, #plugin_id

Methods included from Configurable

#config, #configure, included, lookup_type, register_type

Constructor Details

#initializeObjectBufferedOutput

Returns a new instance of ObjectBufferedOutput.



449
450
451
# File 'lib/fluent/output.rb', line 449

def initialize
  super
end

Instance Method Details

#emit(tag, es, chain) ⇒ Object



453
454
455
456
457
458
459
460
# File 'lib/fluent/output.rb', line 453

def emit(tag, es, chain)
  @emit_count += 1
  data = es.to_msgpack_stream
  key = tag
  if @buffer.emit(key, data, chain)
    submit_flush
  end
end

#write(chunk) ⇒ Object



478
479
480
481
# File 'lib/fluent/output.rb', line 478

def write(chunk)
  chunk.extend(BufferedEventStreamMixin)
  write_objects(chunk.key, chunk)
end