Sha256: 369b220690094ec1eeb5dcf09a89810d4c1c55c52e22e8c7286f03040ccde4c9

Contents?: true

Size: 511 Bytes

Versions: 46

Compression:

Stored size: 511 Bytes

Contents

require "kafka/snappy_codec"
require "kafka/gzip_codec"

module Kafka
  module Compression
    def self.find_codec(name)
      case name
      when nil then nil
      when :snappy then SnappyCodec.new
      when :gzip then GzipCodec.new
      else raise "Unknown compression codec #{name}"
      end
    end

    def self.find_codec_by_id(codec_id)
      case codec_id
      when 1 then GzipCodec.new
      when 2 then SnappyCodec.new
      else raise "Unknown codec id #{codec_id}"
      end
    end
  end
end

Version data entries

46 entries across 46 versions & 1 rubygems

Version Path
ruby-kafka-0.5.1 lib/kafka/compression.rb
ruby-kafka-0.5.1.beta2 lib/kafka/compression.rb
ruby-kafka-0.5.1.beta1 lib/kafka/compression.rb
ruby-kafka-0.4.4 lib/kafka/compression.rb
ruby-kafka-0.5.0 lib/kafka/compression.rb
ruby-kafka-0.5.0.beta6 lib/kafka/compression.rb
ruby-kafka-0.5.0.beta5 lib/kafka/compression.rb
ruby-kafka-0.5.0.beta4 lib/kafka/compression.rb
ruby-kafka-0.5.0.beta3 lib/kafka/compression.rb
ruby-kafka-0.5.0.beta2 lib/kafka/compression.rb
ruby-kafka-0.4.3 lib/kafka/compression.rb
ruby-kafka-0.4.2 lib/kafka/compression.rb
ruby-kafka-0.4.1 lib/kafka/compression.rb
ruby-kafka-0.4.0 lib/kafka/compression.rb
ruby-kafka-0.4.0.beta1 lib/kafka/compression.rb
ruby-kafka-0.3.18.beta2 lib/kafka/compression.rb
ruby-kafka-0.3.18.beta1 lib/kafka/compression.rb
ruby-kafka-0.3.17 lib/kafka/compression.rb
ruby-kafka-0.3.16 lib/kafka/compression.rb
ruby-kafka-0.3.16.beta2 lib/kafka/compression.rb