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_msgpack_stream, #to_msgpack_stream_forced_integer
#msgpack_factory, #msgpack_packer, #msgpack_unpacker
Constructor Details
Returns a new instance of ArrayEventStream.
110
111
112
|
# File 'lib/fluent/event.rb', line 110
def initialize(entries)
@entries = entries
end
|
Instance Method Details
#dup ⇒ Object
114
115
116
117
|
# File 'lib/fluent/event.rb', line 114
def dup
entries = @entries.map{ |time, record| [time, record.dup] }
ArrayEventStream.new(entries)
end
|
#each(&block) ⇒ Object
135
136
137
138
|
# File 'lib/fluent/event.rb', line 135
def each(&block)
@entries.each(&block)
nil
end
|
#empty? ⇒ Boolean
127
128
129
|
# File 'lib/fluent/event.rb', line 127
def empty?
@entries.empty?
end
|
#repeatable? ⇒ Boolean
123
124
125
|
# File 'lib/fluent/event.rb', line 123
def repeatable?
true
end
|
#size ⇒ Object
119
120
121
|
# File 'lib/fluent/event.rb', line 119
def size
@entries.size
end
|
#slice(index, num) ⇒ Object
131
132
133
|
# File 'lib/fluent/event.rb', line 131
def slice(index, num)
ArrayEventStream.new(@entries.slice(index, num))
end
|