Class: Fluent::SortOutput

Inherits:
BufferedOutput
  • Object
show all
Includes:
HandleTagNameMixin
Defined in:
lib/fluent/plugin/out_sort.rb

Instance Method Summary collapse

Instance Method Details

#format(tag, time, record) ⇒ Object



36
37
38
# File 'lib/fluent/plugin/out_sort.rb', line 36

def format(tag, time, record)
  [tag, time, record].to_msgpack
end

#write(chunk) ⇒ Object



40
41
42
43
44
45
# File 'lib/fluent/plugin/out_sort.rb', line 40

def write(chunk)
  messages = sort_messages(chunk.to_enum(:msgpack_each))
  messages.each do |tag, time, record|
    Engine.emit(tag, time, record)
  end
end