Class: Fluent::Plugin::S3Output::ZstdCompressor
- Inherits:
-
Compressor
- Object
- Compressor
- Fluent::Plugin::S3Output::ZstdCompressor
show all
- Defined in:
- lib/fluent/plugin/s3_compressor_zstd.rb
Instance Attribute Summary
Attributes inherited from Compressor
#buffer_type, #log
Instance Method Summary
collapse
Methods inherited from Compressor
#configure, #initialize
Instance Method Details
#compress(chunk, tmp) ⇒ Object
21
22
23
24
25
26
27
|
# File 'lib/fluent/plugin/s3_compressor_zstd.rb', line 21
def compress(chunk, tmp)
compressed = Zstd.compress(chunk.read, level: @compress_config.level)
tmp.write(compressed)
rescue => e
log.warn "zstd compression failed: #{e.message}"
raise
end
|
#content_type ⇒ Object
17
18
19
|
# File 'lib/fluent/plugin/s3_compressor_zstd.rb', line 17
def content_type
'application/x-zst'.freeze
end
|
#ext ⇒ Object
13
14
15
|
# File 'lib/fluent/plugin/s3_compressor_zstd.rb', line 13
def ext
'zst'.freeze
end
|