Sha256: ddf1140e0c13ff4be95a6dcfc204abfce4b90619972efbba8fbadcdaf8f4401a

Contents?: true

Size: 792 Bytes

Versions: 18

Compression:

Stored size: 792 Bytes

Contents

module Fluent
  class AzureStorageGen2Output
    class LZOCompressor < Compressor
      AzureStorageGen2Output.register_compressor('lzo', self)

      config_param :command_parameter, :string, :default => '-qf1'

      def configure(conf)
        super
        check_command('lzop', 'LZO')
      end

      def ext
        'lzo'.freeze
      end

      def content_type
        'application/x-lzop'.freeze
      end

      def compress(chunk, tmp)
        w = Tempfile.new("chunk-tmp")
        w.binmode
        chunk.write_to(w)
        w.close

        # We don't check the return code because we can't recover lzop failure.
        system "lzop #{@command_parameter} -o #{tmp.path} #{w.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_lzo.rb
fluent-plugin-azurestorage-gen2-0.3.8 lib/fluent/plugin/azurestorage_gen2_compressor_lzo.rb
fluent-plugin-azurestorage-gen2-0.3.7 lib/fluent/plugin/azurestorage_gen2_compressor_lzo.rb
fluent-plugin-azurestorage-gen2-0.3.5 lib/fluent/plugin/azurestorage_gen2_compressor_lzo.rb
fluent-plugin-azurestorage-gen2-0.3.4 lib/fluent/plugin/azurestorage_gen2_compressor_lzo.rb
fluent-plugin-azurestorage-gen2-0.3.3 lib/fluent/plugin/azurestorage_gen2_compressor_lzo.rb
fluent-plugin-azurestorage-gen2-0.3.2 lib/fluent/plugin/azurestorage_gen2_compressor_lzo.rb
fluent-plugin-azurestorage-gen2-0.3.1 lib/fluent/plugin/azurestorage_gen2_compressor_lzo.rb
fluent-plugin-azurestorage-gen2-0.3.0 lib/fluent/plugin/azurestorage_gen2_compressor_lzo.rb
fluent-plugin-azurestorage-gen2-0.2.10 lib/fluent/plugin/azurestorage_gen2_compressor_lzo.rb
fluent-plugin-azurestorage-gen2-0.2.9 lib/fluent/plugin/azurestorage_gen2_compressor_lzo.rb
fluent-plugin-azurestorage-gen2-0.2.8 lib/fluent/plugin/azurestorage_gen2_compressor_lzo.rb
fluent-plugin-azurestorage-gen2-0.2.7 lib/fluent/plugin/azurestorage_gen2_compressor_lzo.rb
fluent-plugin-azurestorage-gen2-0.2.6 lib/fluent/plugin/azurestorage_gen2_compressor_lzo.rb
fluent-plugin-azurestorage-gen2-0.2.5 lib/fluent/plugin/azurestorage_gen2_compressor_lzo.rb
fluent-plugin-azurestorage-gen2-0.2.4 lib/fluent/plugin/azurestorage_gen2_compressor_lzo.rb
fluent-plugin-azurestorage-gen2-0.2.3 lib/fluent/plugin/azurestorage_gen2_compressor_lzo.rb
fluent-plugin-azurestorage-gen2-0.2.2 lib/fluent/plugin/azurestorage_gen2_compressor_lzo.rb