Sha256: 045a7805d12491146c3f31ef64855882f2fc349cebeb5bba4d6ac30ba099b878

Contents?: true

Size: 563 Bytes

Versions: 2

Compression:

Stored size: 563 Bytes

Contents

module Fluent
  class WebHDFSOutput < Fluent::TimeSlicedOutput
    class Bzip2Compressor < Compressor
      WebHDFSOutput.register_compressor('bzip2', self)

      def initialize(options = {})
        begin
          require "bzip2/ffi"
        rescue LoadError
          raise Fluent::ConfigError, "Install bzip2-ffi before use bzip2 compressor"
        end
      end

      def ext
        ".bz2"
      end

      def compress(chunk, tmp)
        Bzip2::FFI::Writer.open(tmp) do |writer|
          chunk.write_to(writer)
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
fluent-plugin-webhdfs-0.7.1 lib/fluent/plugin/webhdfs_compressor_bzip2.rb
fluent-plugin-webhdfs-0.7.0 lib/fluent/plugin/webhdfs_compressor_bzip2.rb