class Fluent::Plugin::Buffer::ArrowFileChunk

Public Class Methods

new(metadata, path, mode, schema, perm: system_config.file_permission || FILE_PERMISSION, chunk_size: 1024, format: :arrow) click to toggle source
Calls superclass method
# File lib/fluent/plugin/buffer/arrow_file_chunk.rb, line 29
def initialize(metadata, path, mode, schema, perm: system_config.file_permission || FILE_PERMISSION, chunk_size: 1024, format: :arrow)
  super(metadata, path, mode, perm: perm, compress: :text)
  @schema = schema
  @chunk_size = chunk_size
  @format = format
end

Public Instance Methods

open(**kwargs, &block) click to toggle source
# File lib/fluent/plugin/buffer/arrow_file_chunk.rb, line 41
def open(**kwargs, &block)
  @chunk.seek(0, IO::SEEK_SET)
  val = StringIO.open(build_arrow_buffer_string, &block)
  @chunk.seek(0, IO::SEEK_END) if self.staged?
  val
end
read(**kwargs) click to toggle source
# File lib/fluent/plugin/buffer/arrow_file_chunk.rb, line 36
def read(**kwargs)
  @chunk.seek(0, IO::SEEK_SET)
  build_arrow_buffer_string
end
write_to(io, **kwargs) click to toggle source
# File lib/fluent/plugin/buffer/arrow_file_chunk.rb, line 48
def write_to(io, **kwargs)
  @chunk.seek(0, IO::SEEK_SET)
  io.write build_arrow_buffer_string
end

Private Instance Methods

each_record(&block) click to toggle source
# File lib/fluent/plugin/buffer/arrow_file_chunk.rb, line 55
def each_record(&block)
  Fluent::MessagePackFactory.engine_factory.unpacker(@chunk).each(&block)
end