Class: Fluent::ArrayEventStream

Inherits:
EventStream show all
Defined in:
lib/fluent/event.rb

Overview

EventStream from entries: Array of [time, record]

Use this class for many events data with a tag and its representation is [ [time, record], [time, record], .. ]

Instance Method Summary collapse

Methods inherited from EventStream

#to_msgpack_stream

Constructor Details

#initialize(entries) ⇒ ArrayEventStream

Returns a new instance of ArrayEventStream.



64
65
66
# File 'lib/fluent/event.rb', line 64

def initialize(entries)
  @entries = entries
end

Instance Method Details

#dupObject



68
69
70
71
# File 'lib/fluent/event.rb', line 68

def dup
  entries = @entries.map { |entry| entry.dup } # @entries.map(:dup) doesn't work by ArgumentError
  ArrayEventStream.new(entries)
end

#each(&block) ⇒ Object



81
82
83
84
# File 'lib/fluent/event.rb', line 81

def each(&block)
  @entries.each(&block)
  nil
end

#empty?Boolean

Returns:

  • (Boolean)


77
78
79
# File 'lib/fluent/event.rb', line 77

def empty?
  @entries.empty?
end

#repeatable?Boolean

Returns:

  • (Boolean)


73
74
75
# File 'lib/fluent/event.rb', line 73

def repeatable?
  true
end