Class: Fluent::PullBufferChunk
- Inherits:
-
FileBufferChunk
- Object
- FileBufferChunk
- Fluent::PullBufferChunk
- Defined in:
- lib/fluent/plugin/buf_pullpool.rb
Instance Attribute Summary collapse
-
#flushed ⇒ Object
Returns the value of attribute flushed.
Instance Method Summary collapse
- #actual_purge ⇒ Object
-
#initialize(key, path, unique_id, mode = "a+", symlink_path = nil) ⇒ PullBufferChunk
constructor
A new instance of PullBufferChunk.
- #purge ⇒ Object
Constructor Details
#initialize(key, path, unique_id, mode = "a+", symlink_path = nil) ⇒ PullBufferChunk
Returns a new instance of PullBufferChunk.
7 8 9 10 |
# File 'lib/fluent/plugin/buf_pullpool.rb', line 7 def initialize(key, path, unique_id, mode="a+", symlink_path = nil) super @flushed = false end |
Instance Attribute Details
#flushed ⇒ Object
Returns the value of attribute flushed.
5 6 7 |
# File 'lib/fluent/plugin/buf_pullpool.rb', line 5 def flushed @flushed end |
Instance Method Details
#actual_purge ⇒ Object
19 20 21 22 |
# File 'lib/fluent/plugin/buf_pullpool.rb', line 19 def actual_purge @file.close File.unlink(@path) rescue nil # TODO: check @path exists or not, and remove-or-rename if exists end |
#purge ⇒ Object
12 13 14 15 16 17 |
# File 'lib/fluent/plugin/buf_pullpool.rb', line 12 def purge # do not anything if not flushed yet: call actual_purge explicitly. if @flushed actual_purge end end |