Class: Fluent::Plugin::S3Input::LZOExtractor

Inherits:
Extractor
  • Object
show all
Defined in:
lib/fluent/plugin/s3_extractor_lzo.rb

Constant Summary

Constants inherited from Extractor

Extractor::BYTES_TO_READ

Instance Attribute Summary

Attributes inherited from Extractor

#log

Instance Method Summary collapse

Methods inherited from Extractor

#initialize

Constructor Details

This class inherits a constructor from Fluent::Plugin::S3Input::Extractor

Instance Method Details

#configure(conf) ⇒ Object



8
9
10
11
# File 'lib/fluent/plugin/s3_extractor_lzo.rb', line 8

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

#content_typeObject



17
18
19
# File 'lib/fluent/plugin/s3_extractor_lzo.rb', line 17

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

#extObject



13
14
15
# File 'lib/fluent/plugin/s3_extractor_lzo.rb', line 13

def ext
  'lzo'.freeze
end

#extract(io) ⇒ Object



21
22
23
24
25
26
27
28
29
# File 'lib/fluent/plugin/s3_extractor_lzo.rb', line 21

def extract(io)
  begin
    extract_with_command("lzop #{@command_parameter}", io, "lzop-temp")
  rescue SizeLimitError
    raise
  rescue
    raise "Failed to extract #{path} with lzop command."
  end
end