Class: Fluent::Plugin::WebHDFSOutput::GzipCompressor
- Inherits:
-
Compressor
- Object
- Compressor
- Fluent::Plugin::WebHDFSOutput::GzipCompressor
- Defined in:
- lib/fluent/plugin/webhdfs_compressor_gzip.rb
Instance Method Summary collapse
- #compress(chunk, tmp) ⇒ Object
- #ext ⇒ Object
-
#initialize(options = {}) ⇒ GzipCompressor
constructor
A new instance of GzipCompressor.
Methods inherited from Compressor
Constructor Details
#initialize(options = {}) ⇒ GzipCompressor
Returns a new instance of GzipCompressor.
6 7 8 |
# File 'lib/fluent/plugin/webhdfs_compressor_gzip.rb', line 6 def initialize( = {}) require "zlib" end |
Instance Method Details
#compress(chunk, tmp) ⇒ Object
14 15 16 17 18 |
# File 'lib/fluent/plugin/webhdfs_compressor_gzip.rb', line 14 def compress(chunk, tmp) w = Zlib::GzipWriter.new(tmp) chunk.write_to(w) w.finish end |
#ext ⇒ Object
10 11 12 |
# File 'lib/fluent/plugin/webhdfs_compressor_gzip.rb', line 10 def ext ".gz" end |