Class: Fluent::BufferChunk
- Inherits:
-
Object
- Object
- Fluent::BufferChunk
show all
- Includes:
- MonitorMixin
- Defined in:
- lib/fluent/buffer.rb
Instance Attribute Summary collapse
Instance Method Summary
collapse
Constructor Details
Returns a new instance of BufferChunk.
78
79
80
81
|
# File 'lib/fluent/buffer.rb', line 78
def initialize(key)
super()
@key = key
end
|
Instance Attribute Details
#key ⇒ Object
Returns the value of attribute key.
83
84
85
|
# File 'lib/fluent/buffer.rb', line 83
def key
@key
end
|
Instance Method Details
#<<(data) ⇒ Object
85
86
87
|
# File 'lib/fluent/buffer.rb', line 85
def <<(data)
raise NotImplementedError, "Implement this method in child class"
end
|
#close ⇒ Object
97
98
99
|
# File 'lib/fluent/buffer.rb', line 97
def close
raise NotImplementedError, "Implement this method in child class"
end
|
#empty? ⇒ Boolean
93
94
95
|
# File 'lib/fluent/buffer.rb', line 93
def empty?
size == 0
end
|
#msgpack_each(&block) ⇒ Object
119
120
121
122
123
124
125
126
127
|
# File 'lib/fluent/buffer.rb', line 119
def msgpack_each(&block)
open {|io|
u = Fluent::Engine.msgpack_factory.unpacker(io)
begin
u.each(&block)
rescue EOFError
end
}
end
|
#open ⇒ Object
109
110
111
|
# File 'lib/fluent/buffer.rb', line 109
def open
raise NotImplementedError, "Implement this method in child class"
end
|
#purge ⇒ Object
101
102
103
|
# File 'lib/fluent/buffer.rb', line 101
def purge
raise NotImplementedError, "Implement this method in child class"
end
|
#read ⇒ Object
105
106
107
|
# File 'lib/fluent/buffer.rb', line 105
def read
raise NotImplementedError, "Implement this method in child class"
end
|
#size ⇒ Object
89
90
91
|
# File 'lib/fluent/buffer.rb', line 89
def size
raise NotImplementedError, "Implement this method in child class"
end
|
#write_to(io) ⇒ Object
113
114
115
116
117
|
# File 'lib/fluent/buffer.rb', line 113
def write_to(io)
open {|i|
FileUtils.copy_stream(i, io)
}
end
|