Class: Fluent::S3Output::GzipCompressor

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

Instance Method Summary collapse

Methods inherited from Compressor

#configure

Instance Method Details

#compress(chunk, tmp) ⇒ Object



184
185
186
187
188
189
190
191
# File 'lib/fluent/plugin/out_s3.rb', line 184

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

#content_typeObject



180
181
182
# File 'lib/fluent/plugin/out_s3.rb', line 180

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

#extObject



176
177
178
# File 'lib/fluent/plugin/out_s3.rb', line 176

def ext
  'gz'.freeze
end