Class: Fluent::S3Output::GzipCompressor

Inherits:
Compressor
  • Object
show all
Defined in:
lib/fluent/plugin/out_s3.rb

Instance Attribute Summary

Attributes inherited from Compressor

#buffer_type, #log

Instance Method Summary collapse

Methods inherited from Compressor

#configure, #initialize

Constructor Details

This class inherits a constructor from Fluent::S3Output::Compressor

Instance Method Details

#compress(chunk, tmp) ⇒ Object



454
455
456
457
458
459
460
# File 'lib/fluent/plugin/out_s3.rb', line 454

def compress(chunk, tmp)
  w = Zlib::GzipWriter.new(tmp)
  chunk.write_to(w)
  w.finish
ensure
  w.finish rescue nil
end

#content_typeObject



450
451
452
# File 'lib/fluent/plugin/out_s3.rb', line 450

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

#extObject



446
447
448
# File 'lib/fluent/plugin/out_s3.rb', line 446

def ext
  'gz'.freeze
end