Class: Fluent::Plugin::S3Input::GzipCommandExtractor
- Inherits:
-
Extractor
- Object
- Extractor
- Fluent::Plugin::S3Input::GzipCommandExtractor
show all
- Defined in:
- lib/fluent/plugin/s3_extractor_gzip_command.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
Instance Method Details
8
9
10
11
|
# File 'lib/fluent/plugin/s3_extractor_gzip_command.rb', line 8
def configure(conf)
super
check_command('gzip')
end
|
#content_type ⇒ Object
17
18
19
|
# File 'lib/fluent/plugin/s3_extractor_gzip_command.rb', line 17
def content_type
'application/x-gzip'.freeze
end
|
#ext ⇒ Object
13
14
15
|
# File 'lib/fluent/plugin/s3_extractor_gzip_command.rb', line 13
def ext
'gz'.freeze
end
|
21
22
23
24
25
26
27
28
29
30
31
32
|
# File 'lib/fluent/plugin/s3_extractor_gzip_command.rb', line 21
def (io)
begin
extract_with_command("gzip #{@command_parameter}", io, "gzip-temp")
rescue SizeLimitError
raise
rescue => e
log.warn "gzip command execution failed: #{e.message}. Fallback to GzipExtractor."
io.rewind
= GzipExtractor.new(log: log, decompression_size_limit: @decompression_size_limit)
.(io)
end
end
|