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.3.16.beta1 lib/kafka/compression.rb
ruby-kafka-0.3.15 lib/kafka/compression.rb
ruby-kafka-0.3.15.beta3 lib/kafka/compression.rb
ruby-kafka-0.3.15.beta2 lib/kafka/compression.rb
ruby-kafka-0.3.15.beta1 lib/kafka/compression.rb
ruby-kafka-0.3.14 lib/kafka/compression.rb
ruby-kafka-0.3.13.beta4 lib/kafka/compression.rb
ruby-kafka-0.3.13.beta3 lib/kafka/compression.rb
ruby-kafka-0.3.13.beta2 lib/kafka/compression.rb
ruby-kafka-0.3.13.beta1 lib/kafka/compression.rb
ruby-kafka-0.3.12 lib/kafka/compression.rb
ruby-kafka-0.3.11 lib/kafka/compression.rb
ruby-kafka-0.3.10 lib/kafka/compression.rb
ruby-kafka-0.3.9 lib/kafka/compression.rb
ruby-kafka-0.3.8 lib/kafka/compression.rb
ruby-kafka-0.3.7 lib/kafka/compression.rb
ruby-kafka-0.3.6 lib/kafka/compression.rb
ruby-kafka-0.3.5 lib/kafka/compression.rb
ruby-kafka-0.3.4 lib/kafka/compression.rb
ruby-kafka-0.3.3 lib/kafka/compression.rb