Sha256: 5c4a0f5a0855a7ef815afefcf3b874230361b0acea5d90ec67803f6311478f25
Contents?: true
Size: 778 Bytes
Versions: 6
Compression:
Stored size: 778 Bytes
Contents
module Fluent class S3Output class LZMA2Compressor < Compressor S3Output.register_compressor('lzma2', self) config_param :command_parameter, :string, :default => '-qf0' def configure(conf) super check_command('xz', 'LZMA2') end def ext 'xz'.freeze end def content_type 'application/x-xz'.freeze end def compress(chunk, tmp) w = Tempfile.new("chunk-xz-tmp", @tmp_dir) w.binmode chunk.write_to(w) w.close # We don't check the return code because we can't recover lzop failure. system "xz #{@command_parameter} -c #{w.path} > #{tmp.path}" ensure w.close rescue nil w.unlink rescue nil end end end end
Version data entries
6 entries across 6 versions & 1 rubygems