Class: Fluent::EventStream
Instance Method Summary
collapse
#msgpack_factory, #msgpack_packer, #msgpack_unpacker
Instance Method Details
#==(other) ⇒ Object
39
40
41
|
# File 'lib/fluent/event.rb', line 39
def ==(other)
other.is_a?(EventStream) && self.to_msgpack_stream == other.to_msgpack_stream
end
|
#dup ⇒ Object
dup does deep copy for event stream
25
26
27
|
# File 'lib/fluent/event.rb', line 25
def dup
raise NotImplementedError, "DO NOT USE THIS CLASS directly."
end
|
#each(&block) ⇒ Object
51
52
53
|
# File 'lib/fluent/event.rb', line 51
def each(&block)
raise NotImplementedError, "DO NOT USE THIS CLASS directly."
end
|
#empty? ⇒ Boolean
34
35
36
|
# File 'lib/fluent/event.rb', line 34
def empty?
size == 0
end
|
#repeatable? ⇒ Boolean
43
44
45
|
# File 'lib/fluent/event.rb', line 43
def repeatable?
false
end
|
#size ⇒ Object
Also known as:
length
29
30
31
|
# File 'lib/fluent/event.rb', line 29
def size
raise NotImplementedError, "DO NOT USE THIS CLASS directly."
end
|
#slice(index, num) ⇒ Object
47
48
49
|
# File 'lib/fluent/event.rb', line 47
def slice(index, num)
raise NotImplementedError, "DO NOT USE THIS CLASS directly."
end
|
#to_msgpack_stream(time_int: false) ⇒ Object
55
56
57
58
59
60
61
62
|
# File 'lib/fluent/event.rb', line 55
def to_msgpack_stream(time_int: false)
return to_msgpack_stream_forced_integer if time_int
out = msgpack_packer
each {|time,record|
out.write([time,record])
}
out.to_s
end
|
#to_msgpack_stream_forced_integer ⇒ Object
64
65
66
67
68
69
70
|
# File 'lib/fluent/event.rb', line 64
def to_msgpack_stream_forced_integer
out = msgpack_packer
each {|time,record|
out.write([time.to_i,record])
}
out.to_s
end
|