Sha256: a860f315b2ecd0f9ce0b14bb2905d8fccf1f4811041e3622d3864bf6c0c5864b

Contents?: true

Size: 892 Bytes

Versions: 52

Compression:

Stored size: 892 Bytes

Contents

module Fluent::Plugin
  class S3Input
    class LZOExtractor < Extractor
      S3Input.register_extractor('lzo', self)

      config_param :command_parameter, :string, default: '-qdc'

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

      def ext
        'lzo'.freeze
      end

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

      def extract(io)
        path = if io.respond_to?(path)
                 io.path
               else
                 temp = Tempfile.new("lzop-temp")
                 temp.write(io.read)
                 temp.close
                 temp.path
               end

        stdout, succeeded = Open3.capture2("lzop #{@command_parameter} #{path}")
        if succeeded
          stdout
        else
          raise "Failed to extract #{path} with lzop command."
        end
      end
    end
  end
end

Version data entries

52 entries across 52 versions & 3 rubygems

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