Sha256: 7593e1a957d5777d28e83e7df4901d566d3e03b47ba7eb5e179152cac0ab85de

Contents?: true

Size: 796 Bytes

Versions: 18

Compression:

Stored size: 796 Bytes

Contents

module Fluent
  class AzureStorageGen2Output
    class LZMA2Compressor < Compressor
      AzureStorageGen2Output.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")
        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

18 entries across 18 versions & 1 rubygems

Version Path
fluent-plugin-azurestorage-gen2-0.3.9 lib/fluent/plugin/azurestorage_gen2_compressor_lzma2.rb
fluent-plugin-azurestorage-gen2-0.3.8 lib/fluent/plugin/azurestorage_gen2_compressor_lzma2.rb
fluent-plugin-azurestorage-gen2-0.3.7 lib/fluent/plugin/azurestorage_gen2_compressor_lzma2.rb
fluent-plugin-azurestorage-gen2-0.3.5 lib/fluent/plugin/azurestorage_gen2_compressor_lzma2.rb
fluent-plugin-azurestorage-gen2-0.3.4 lib/fluent/plugin/azurestorage_gen2_compressor_lzma2.rb
fluent-plugin-azurestorage-gen2-0.3.3 lib/fluent/plugin/azurestorage_gen2_compressor_lzma2.rb
fluent-plugin-azurestorage-gen2-0.3.2 lib/fluent/plugin/azurestorage_gen2_compressor_lzma2.rb
fluent-plugin-azurestorage-gen2-0.3.1 lib/fluent/plugin/azurestorage_gen2_compressor_lzma2.rb
fluent-plugin-azurestorage-gen2-0.3.0 lib/fluent/plugin/azurestorage_gen2_compressor_lzma2.rb
fluent-plugin-azurestorage-gen2-0.2.10 lib/fluent/plugin/azurestorage_gen2_compressor_lzma2.rb
fluent-plugin-azurestorage-gen2-0.2.9 lib/fluent/plugin/azurestorage_gen2_compressor_lzma2.rb
fluent-plugin-azurestorage-gen2-0.2.8 lib/fluent/plugin/azurestorage_gen2_compressor_lzma2.rb
fluent-plugin-azurestorage-gen2-0.2.7 lib/fluent/plugin/azurestorage_gen2_compressor_lzma2.rb
fluent-plugin-azurestorage-gen2-0.2.6 lib/fluent/plugin/azurestorage_gen2_compressor_lzma2.rb
fluent-plugin-azurestorage-gen2-0.2.5 lib/fluent/plugin/azurestorage_gen2_compressor_lzma2.rb
fluent-plugin-azurestorage-gen2-0.2.4 lib/fluent/plugin/azurestorage_gen2_compressor_lzma2.rb
fluent-plugin-azurestorage-gen2-0.2.3 lib/fluent/plugin/azurestorage_gen2_compressor_lzma2.rb
fluent-plugin-azurestorage-gen2-0.2.2 lib/fluent/plugin/azurestorage_gen2_compressor_lzma2.rb