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
#msgpack_factory, #msgpack_packer, #msgpack_unpacker
Constructor Details
Returns a new instance of ArrayEventStream.
121
122
123
|
# File 'lib/fluent/event.rb', line 121
def initialize(entries)
@entries = entries
end
|
Instance Method Details
#dup ⇒ Object
125
126
127
128
|
# File 'lib/fluent/event.rb', line 125
def dup
entries = @entries.map{ |time, record| [time, record.dup] }
ArrayEventStream.new(entries)
end
|
#each(unpacker: nil, &block) ⇒ Object
146
147
148
149
|
# File 'lib/fluent/event.rb', line 146
def each(unpacker: nil, &block)
@entries.each(&block)
nil
end
|
#empty? ⇒ Boolean
138
139
140
|
# File 'lib/fluent/event.rb', line 138
def empty?
@entries.empty?
end
|
#repeatable? ⇒ Boolean
134
135
136
|
# File 'lib/fluent/event.rb', line 134
def repeatable?
true
end
|
#size ⇒ Object
130
131
132
|
# File 'lib/fluent/event.rb', line 130
def size
@entries.size
end
|
#slice(index, num) ⇒ Object
142
143
144
|
# File 'lib/fluent/event.rb', line 142
def slice(index, num)
ArrayEventStream.new(@entries.slice(index, num))
end
|