Class: Fluent::Plugin::Buffer::ArrowMemoryChunk
- Inherits:
-
MemoryChunk
- Object
- MemoryChunk
- Fluent::Plugin::Buffer::ArrowMemoryChunk
- Includes:
- ArrowBufferStringBuilder
- Defined in:
- lib/fluent/plugin/buffer/arrow_memory_chunk.rb
Instance Method Summary collapse
-
#initialize(metadata, schema, chunk_size: 1024, format: :arrow) ⇒ ArrowMemoryChunk
constructor
A new instance of ArrowMemoryChunk.
- #open(**kwargs, &block) ⇒ Object
- #read(**kwargs) ⇒ Object
- #write_to(io, **kwargs) ⇒ Object
Constructor Details
#initialize(metadata, schema, chunk_size: 1024, format: :arrow) ⇒ ArrowMemoryChunk
Returns a new instance of ArrowMemoryChunk.
29 30 31 32 33 34 |
# File 'lib/fluent/plugin/buffer/arrow_memory_chunk.rb', line 29 def initialize(, schema, chunk_size: 1024, format: :arrow) super(, compress: :text) @schema = schema @chunk_size = chunk_size @format = format end |
Instance Method Details
#open(**kwargs, &block) ⇒ Object
40 41 42 |
# File 'lib/fluent/plugin/buffer/arrow_memory_chunk.rb', line 40 def open(**kwargs, &block) StringIO.open(build_arrow_buffer_string, &block) end |
#read(**kwargs) ⇒ Object
36 37 38 |
# File 'lib/fluent/plugin/buffer/arrow_memory_chunk.rb', line 36 def read(**kwargs) build_arrow_buffer_string end |
#write_to(io, **kwargs) ⇒ Object
44 45 46 47 |
# File 'lib/fluent/plugin/buffer/arrow_memory_chunk.rb', line 44 def write_to(io, **kwargs) # re-implementation to optimize not to create StringIO io.write build_arrow_buffer_string end |