Class: Fluent::Plugin::S3Output::GzipCompressor
Instance Attribute Summary
Attributes inherited from Compressor
#buffer_type, #log
Instance Method Summary
collapse
Methods inherited from Compressor
#configure, #initialize
Instance Method Details
#compress(chunk, tmp) ⇒ Object
654
655
656
657
658
659
660
661
662
663
664
665
666
667
|
# File 'lib/fluent/plugin/out_s3.rb', line 654
def compress(chunk, tmp)
if @buffer_compressed_type == :gzip
chunk.write_to(tmp, compressed: @buffer_compressed_type)
return
end
w = Zlib::GzipWriter.new(tmp)
chunk.write_to(w)
w.finish
ensure
if w
w.finish rescue nil
end
end
|
#content_type ⇒ Object
650
651
652
|
# File 'lib/fluent/plugin/out_s3.rb', line 650
def content_type
'application/x-gzip'.freeze
end
|
#ext ⇒ Object
646
647
648
|
# File 'lib/fluent/plugin/out_s3.rb', line 646
def ext
'gz'.freeze
end
|