Sha256: 6c5b2d6c6cfd8031661700ef1733d28d1b70e043c6235875d270611100102b5e

Contents?: true

Size: 553 Bytes

Versions: 12

Compression:

Stored size: 553 Bytes

Contents

module Fluent::Plugin
  class WebHDFSOutput < Output
    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

12 entries across 12 versions & 1 rubygems

Version Path
fluent-plugin-webhdfs-1.6.0 lib/fluent/plugin/webhdfs_compressor_bzip2.rb
fluent-plugin-webhdfs-1.5.0 lib/fluent/plugin/webhdfs_compressor_bzip2.rb
fluent-plugin-webhdfs-1.4.0 lib/fluent/plugin/webhdfs_compressor_bzip2.rb
fluent-plugin-webhdfs-1.3.2 lib/fluent/plugin/webhdfs_compressor_bzip2.rb
fluent-plugin-webhdfs-1.3.1 lib/fluent/plugin/webhdfs_compressor_bzip2.rb
fluent-plugin-webhdfs-1.3.0 lib/fluent/plugin/webhdfs_compressor_bzip2.rb
fluent-plugin-webhdfs-1.2.5 lib/fluent/plugin/webhdfs_compressor_bzip2.rb
fluent-plugin-webhdfs-1.2.4 lib/fluent/plugin/webhdfs_compressor_bzip2.rb
fluent-plugin-webhdfs-1.2.3 lib/fluent/plugin/webhdfs_compressor_bzip2.rb
fluent-plugin-webhdfs-1.2.2 lib/fluent/plugin/webhdfs_compressor_bzip2.rb
fluent-plugin-webhdfs-1.2.1 lib/fluent/plugin/webhdfs_compressor_bzip2.rb
fluent-plugin-webhdfs-1.2.0 lib/fluent/plugin/webhdfs_compressor_bzip2.rb