Class: Fluent::Plugin::S3Output::LZOCompressor
Instance Attribute Summary
Attributes inherited from Compressor
#buffer_type, #log
Instance Method Summary
collapse
Methods inherited from Compressor
#initialize
Instance Method Details
#compress(chunk, tmp) ⇒ Object
21
22
23
24
25
26
27
28
29
30
31
32
|
# File 'lib/fluent/plugin/s3_compressor_lzo.rb', line 21
def compress(chunk, tmp)
w = Tempfile.new("chunk-tmp")
w.binmode
chunk.write_to(w)
w.close
system "lzop #{@command_parameter} -o #{tmp.path} #{w.path}"
ensure
w.close rescue nil
w.unlink rescue nil
end
|
8
9
10
11
|
# File 'lib/fluent/plugin/s3_compressor_lzo.rb', line 8
def configure(conf)
super
check_command('lzop', 'LZO')
end
|
#content_type ⇒ Object
17
18
19
|
# File 'lib/fluent/plugin/s3_compressor_lzo.rb', line 17
def content_type
'application/x-lzop'.freeze
end
|
#ext ⇒ Object
13
14
15
|
# File 'lib/fluent/plugin/s3_compressor_lzo.rb', line 13
def ext
'lzo'.freeze
end
|