Class: Fluent::MemoryBuffer
- Inherits:
-
BasicBuffer
- Object
- Buffer
- BasicBuffer
- Fluent::MemoryBuffer
- Defined in:
- lib/fluent/plugin/buf_memory.rb
Constant Summary
Constants included from Configurable
Configurable::CONFIG_TYPE_REGISTRY
Instance Method Summary collapse
- #before_shutdown(out) ⇒ Object
- #configure(conf) ⇒ Object
- #enqueue(chunk) ⇒ Object
-
#initialize ⇒ MemoryBuffer
constructor
A new instance of MemoryBuffer.
- #new_chunk(key) ⇒ Object
- #resume ⇒ Object
Methods inherited from BasicBuffer
#clear!, #emit, #enable_parallel, #keys, #pop, #push, #queue_size, #shutdown, #start, #storable?, #total_queued_chunk_size, #write_chunk
Methods inherited from Buffer
#clear!, #emit, #keys, #pop, #push, #shutdown, #start
Methods included from Configurable
#config, included, lookup_type, register_type
Constructor Details
#initialize ⇒ MemoryBuffer
Returns a new instance of MemoryBuffer.
75 76 77 |
# File 'lib/fluent/plugin/buf_memory.rb', line 75 def initialize super end |
Instance Method Details
#before_shutdown(out) ⇒ Object
94 95 96 97 98 99 100 101 102 103 104 |
# File 'lib/fluent/plugin/buf_memory.rb', line 94 def before_shutdown(out) if @flush_at_shutdown synchronize do @map.each_key {|key| push(key) } while pop(out) end end end end |
#configure(conf) ⇒ Object
85 86 87 88 89 90 91 92 |
# File 'lib/fluent/plugin/buf_memory.rb', line 85 def configure(conf) super unless @flush_at_shutdown $log.warn "When flush_at_shutdown is false, buf_memory discards buffered chunks at shutdown." $log.warn "Please confirm 'flush_at_shutdown false' configuration is correct or not." end end |
#enqueue(chunk) ⇒ Object
114 115 |
# File 'lib/fluent/plugin/buf_memory.rb', line 114 def enqueue(chunk) end |
#new_chunk(key) ⇒ Object
106 107 108 |
# File 'lib/fluent/plugin/buf_memory.rb', line 106 def new_chunk(key) MemoryBufferChunk.new(key) end |
#resume ⇒ Object
110 111 112 |
# File 'lib/fluent/plugin/buf_memory.rb', line 110 def resume return [], {} end |