Class: Fluent::ArrayEventStream
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_compressed_msgpack_stream, #to_msgpack_stream, #to_msgpack_stream_forced_integer
#compress, #decompress
Constructor Details
Returns a new instance of ArrayEventStream.
120
121
122
|
# File 'lib/fluent/event.rb', line 120
def initialize(entries)
@entries = entries
end
|
Instance Method Details
#dup ⇒ Object
124
125
126
127
|
# File 'lib/fluent/event.rb', line 124
def dup
entries = @entries.map{ |time, record| [time, record.dup] }
ArrayEventStream.new(entries)
end
|
#each(unpacker: nil, &block) ⇒ Object
145
146
147
148
|
# File 'lib/fluent/event.rb', line 145
def each(unpacker: nil, &block)
@entries.each(&block)
nil
end
|
#empty? ⇒ Boolean
137
138
139
|
# File 'lib/fluent/event.rb', line 137
def empty?
@entries.empty?
end
|
#repeatable? ⇒ Boolean
133
134
135
|
# File 'lib/fluent/event.rb', line 133
def repeatable?
true
end
|
#size ⇒ Object
129
130
131
|
# File 'lib/fluent/event.rb', line 129
def size
@entries.size
end
|
#slice(index, num) ⇒ Object
141
142
143
|
# File 'lib/fluent/event.rb', line 141
def slice(index, num)
ArrayEventStream.new(@entries.slice(index, num))
end
|