Sha256: 15f4d3d59722aebe7a1bdcbcda1111640313b4656c705fa6d10ee5992dd6c66f

Contents?: true

Size: 769 Bytes

Versions: 51

Compression:

Stored size: 769 Bytes

Contents

module Fluent::Plugin
  class S3Output
    class LZOCompressor < Compressor
      S3Output.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

51 entries across 51 versions & 3 rubygems

Version Path
fluent-plugin-s3-1.8.1 lib/fluent/plugin/s3_compressor_lzo.rb
fluent-plugin-s3-1.8.0 lib/fluent/plugin/s3_compressor_lzo.rb
fluent-plugin-s3-1.7.2 lib/fluent/plugin/s3_compressor_lzo.rb
fluent-plugin-s3-1.7.1 lib/fluent/plugin/s3_compressor_lzo.rb
fluent-plugin-s3-1.7.0 lib/fluent/plugin/s3_compressor_lzo.rb
fluent-plugin-s3-1.6.1 lib/fluent/plugin/s3_compressor_lzo.rb
fluent-plugin-s3-1.6.0 lib/fluent/plugin/s3_compressor_lzo.rb
fluent-plugin-s3-1.5.1 lib/fluent/plugin/s3_compressor_lzo.rb
fluent-plugin-s3-1.5.0 lib/fluent/plugin/s3_compressor_lzo.rb
fluent-plugin-s3-file-inclusion-1.4.1 lib/fluent/plugin/s3_compressor_lzo.rb
fluent-plugin-s3-1.4.0 lib/fluent/plugin/s3_compressor_lzo.rb
fluent-plugin-s3-1.3.4 lib/fluent/plugin/s3_compressor_lzo.rb
fluent-plugin-s3-1.3.3 lib/fluent/plugin/s3_compressor_lzo.rb
fluent-plugin-s3-1.3.2 lib/fluent/plugin/s3_compressor_lzo.rb
fluent-plugin-s3-1.3.1 lib/fluent/plugin/s3_compressor_lzo.rb
fluent-plugin-s3-1.3.0 lib/fluent/plugin/s3_compressor_lzo.rb
fluent-plugin-s3-1.2.1 lib/fluent/plugin/s3_compressor_lzo.rb
fluent-plugin-s3-1.2.0 lib/fluent/plugin/s3_compressor_lzo.rb
fluent-plugin-s3-1.1.11 lib/fluent/plugin/s3_compressor_lzo.rb
fluent-plugin-s3-1.1.10 lib/fluent/plugin/s3_compressor_lzo.rb