Class: Fluent::Plugin::ArrowFileBuffer

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#arrow_schemaObject (readonly)

Returns the value of attribute arrow_schema.



30
31
32
# File 'lib/fluent/plugin/buf_arrow_file.rb', line 30

def arrow_schema
  @arrow_schema
end

Instance Method Details

#configure(conf) ⇒ Object



32
33
34
35
36
37
# File 'lib/fluent/plugin/buf_arrow_file.rb', line 32

def configure(conf)
  super

  # [{"name" => foo1, "type" => "uint64"}, {"name" => foo2, "type" => "struct", "fields" => [{"name" => bar1, "type" => "string"}]}
  @arrow_schema = ::Arrow::Schema.new(@schema)
end

#generate_chunk(metadata) ⇒ Object



43
44
45
46
47
48
49
50
51
52
53
54
# File 'lib/fluent/plugin/buf_arrow_file.rb', line 43

def generate_chunk()
  # FileChunk generates real path with unique_id
  if @file_permission
    chunk = Fluent::Plugin::Buffer::ArrowFileChunk.new(, @path, :create, @arrow_schema, perm: @file_permission, chunk_size: @row_group_chunk_size, format: @arrow_format)
  else
    chunk = Fluent::Plugin::Buffer::ArrowFileChunk.new(, @path, :create, @arrow_schema, chunk_size: @row_group_chunk_size, format: @arrow_format)
  end

  log.debug "Created new chunk", chunk_id: dump_unique_id_hex(chunk.unique_id), metadata: 

  return chunk
end

#resumeObject



39
40
41
# File 'lib/fluent/plugin/buf_arrow_file.rb', line 39

def resume
  return {}, []
end