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.1.9 lib/fluent/plugin/s3_compressor_lzo.rb
fluent-plugin-s3-1.1.8 lib/fluent/plugin/s3_compressor_lzo.rb
fluent-plugin-s3-1.1.7 lib/fluent/plugin/s3_compressor_lzo.rb
fluent-plugin-s3-1.1.6 lib/fluent/plugin/s3_compressor_lzo.rb
fluent-plugin-s3-1.1.5 lib/fluent/plugin/s3_compressor_lzo.rb
fluent-plugin-s3-1.1.4 lib/fluent/plugin/s3_compressor_lzo.rb
fluent-plugin-s3-1.1.3 lib/fluent/plugin/s3_compressor_lzo.rb
fluent-plugin-s3-1.1.2 lib/fluent/plugin/s3_compressor_lzo.rb
fluent-plugin-s3-1.1.1 lib/fluent/plugin/s3_compressor_lzo.rb
fluent-plugin-s3-1.1.0 lib/fluent/plugin/s3_compressor_lzo.rb
fluent-plugin-s3-1.0.0 lib/fluent/plugin/s3_compressor_lzo.rb
fluent-plugin-s3-1.0.0.rc8 lib/fluent/plugin/s3_compressor_lzo.rb
fluent-plugin-s3-hubspot-1.0.0.rc6.8 lib/fluent/plugin/s3_compressor_lzo.rb
fluent-plugin-s3-hubspot-1.0.0.rc6.7 lib/fluent/plugin/s3_compressor_lzo.rb
fluent-plugin-s3-1.0.0.rc7 lib/fluent/plugin/s3_compressor_lzo.rb
fluent-plugin-s3-hubspot-1.0.0.rc6.6 lib/fluent/plugin/s3_compressor_lzo.rb
fluent-plugin-s3-hubspot-1.0.0.rc6.5 lib/fluent/plugin/s3_compressor_lzo.rb
fluent-plugin-s3-hubspot-1.0.0.rc6.4 lib/fluent/plugin/s3_compressor_lzo.rb
fluent-plugin-s3-hubspot-1.0.0.rc6.3 lib/fluent/plugin/s3_compressor_lzo.rb
fluent-plugin-s3-hubspot-1.0.0.rc6.2 lib/fluent/plugin/s3_compressor_lzo.rb