Class: ArrowFormat::Org::Apache::Arrow::Flatbuf::BodyCompression

Inherits:
FlatBuffers::Table
  • Object
show all
Defined in:
lib/arrow-format/org/apache/arrow/flatbuf/body_compression.rb

Overview

Optional compression for the memory buffers constituting IPC message bodies. Intended for use with RecordBatch but could be used for other message types

Constant Summary collapse

FIELDS =
{
  codec: ::FlatBuffers::Field.new(:codec, 0, 4, :byte, 0),
  method: ::FlatBuffers::Field.new(:method, 1, 6, :byte, 0),
}
Data =
define_data_class

Instance Method Summary collapse

Instance Method Details

#codecObject

Compressor library. For LZ4_FRAME, each compressed buffer must consist of a single frame.



29
30
31
32
33
34
35
36
37
# File 'lib/arrow-format/org/apache/arrow/flatbuf/body_compression.rb', line 29

def codec
  field_offset = @view.unpack_virtual_offset(4)
  if field_offset.zero?
    enum_value = 0
  else
    enum_value = @view.unpack_byte(field_offset)
  end
  ::ArrowFormat::Org::Apache::Arrow::Flatbuf::CompressionType.try_convert(enum_value) || enum_value
end

#methodObject

Indicates the way the record batch body was compressed



40
41
42
43
44
45
46
47
48
# File 'lib/arrow-format/org/apache/arrow/flatbuf/body_compression.rb', line 40

def method
  field_offset = @view.unpack_virtual_offset(6)
  if field_offset.zero?
    enum_value = 0
  else
    enum_value = @view.unpack_byte(field_offset)
  end
  ::ArrowFormat::Org::Apache::Arrow::Flatbuf::BodyCompressionMethod.try_convert(enum_value) || enum_value
end