Class: Fluent::EventStream
Instance Method Summary
collapse
#compress, #decompress
#msgpack_factory, #msgpack_packer, #msgpack_unpacker
Instance Method Details
#==(other) ⇒ Object
41
42
43
|
# File 'lib/fluent/event.rb', line 41
def ==(other)
other.is_a?(EventStream) && self.to_msgpack_stream == other.to_msgpack_stream
end
|
#dup ⇒ Object
dup does deep copy for event stream
27
28
29
|
# File 'lib/fluent/event.rb', line 27
def dup
raise NotImplementedError, "DO NOT USE THIS CLASS directly."
end
|
#each(&block) ⇒ Object
53
54
55
|
# File 'lib/fluent/event.rb', line 53
def each(&block)
raise NotImplementedError, "DO NOT USE THIS CLASS directly."
end
|
#empty? ⇒ Boolean
36
37
38
|
# File 'lib/fluent/event.rb', line 36
def empty?
size == 0
end
|
#repeatable? ⇒ Boolean
45
46
47
|
# File 'lib/fluent/event.rb', line 45
def repeatable?
false
end
|
#size ⇒ Object
Also known as:
length
31
32
33
|
# File 'lib/fluent/event.rb', line 31
def size
raise NotImplementedError, "DO NOT USE THIS CLASS directly."
end
|
#slice(index, num) ⇒ Object
49
50
51
|
# File 'lib/fluent/event.rb', line 49
def slice(index, num)
raise NotImplementedError, "DO NOT USE THIS CLASS directly."
end
|
#to_compressed_msgpack_stream(time_int: false) ⇒ Object
66
67
68
69
|
# File 'lib/fluent/event.rb', line 66
def to_compressed_msgpack_stream(time_int: false)
packed = to_msgpack_stream(time_int: time_int)
compress(packed)
end
|
#to_msgpack_stream(time_int: false) ⇒ Object
57
58
59
60
61
62
63
64
|
# File 'lib/fluent/event.rb', line 57
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
71
72
73
74
75
76
77
|
# File 'lib/fluent/event.rb', line 71
def to_msgpack_stream_forced_integer
out = msgpack_packer
each {|time,record|
out.write([time.to_i,record])
}
out.to_s
end
|