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.
117
118
119
|
# File 'lib/fluent/event.rb', line 117
def initialize(entries)
@entries = entries
end
|
Instance Method Details
#dup ⇒ Object
121
122
123
124
|
# File 'lib/fluent/event.rb', line 121
def dup
entries = @entries.map{ |time, record| [time, record.dup] }
ArrayEventStream.new(entries)
end
|
#each(&block) ⇒ Object
142
143
144
145
|
# File 'lib/fluent/event.rb', line 142
def each(&block)
@entries.each(&block)
nil
end
|
#empty? ⇒ Boolean
134
135
136
|
# File 'lib/fluent/event.rb', line 134
def empty?
@entries.empty?
end
|
#repeatable? ⇒ Boolean
130
131
132
|
# File 'lib/fluent/event.rb', line 130
def repeatable?
true
end
|
#size ⇒ Object
126
127
128
|
# File 'lib/fluent/event.rb', line 126
def size
@entries.size
end
|
#slice(index, num) ⇒ Object
138
139
140
|
# File 'lib/fluent/event.rb', line 138
def slice(index, num)
ArrayEventStream.new(@entries.slice(index, num))
end
|