Class: Fluent::EventLimitedFileBuffer

Inherits:
FileBuffer
  • Object
show all
Defined in:
lib/fluent/plugin/buf_event_limited.rb

Instance Method Summary collapse

Instance Method Details

#new_chunk(key) ⇒ Object



23
24
25
26
27
28
29
# File 'lib/fluent/plugin/buf_event_limited.rb', line 23

def new_chunk(key)
  encoded_key = encode_key(key)
  path, tsuffix = make_path(encoded_key, 'b')
  unique_id = tsuffix_to_unique_id(tsuffix)

  EventLimitedBufferChunk.new(key, path, unique_id, 'a+', @symlink_path)
end

#storable?(chunk, data) ⇒ Boolean

Returns:

  • (Boolean)


31
32
33
34
# File 'lib/fluent/plugin/buf_event_limited.rb', line 31

def storable?(chunk, data)
  chunk.record_counter < @buffer_chunk_records_limit &&
    (chunk.size + data.bytesize) <= @buffer_chunk_limit
end