class Fluent::AzureStorageOutput::LZMA2Compressor

Public Instance Methods

compress(chunk, tmp) click to toggle source
# File lib/fluent/plugin/azurestorage_compressor_lzma2.rb, line 21
def compress(chunk, tmp)
  w = Tempfile.new("chunk-xz-tmp")
  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
configure(conf) click to toggle source
Calls superclass method
# File lib/fluent/plugin/azurestorage_compressor_lzma2.rb, line 8
def configure(conf)
  super
  check_command('xz', 'LZMA2')
end
content_type() click to toggle source
# File lib/fluent/plugin/azurestorage_compressor_lzma2.rb, line 17
def content_type
  'application/x-xz'.freeze
end
ext() click to toggle source
# File lib/fluent/plugin/azurestorage_compressor_lzma2.rb, line 13
def ext
  'xz'.freeze
end