Sha256: c1c84ff6120f3e31fb6877e34f90f61df91fa6fbc265ecf1207db2b313e48803

Contents?: true

Size: 990 Bytes

Versions: 2

Compression:

Stored size: 990 Bytes

Contents

module Kafka
  module Protocol

    class AlterConfigsRequest
      def initialize(resources:)
        @resources = resources
      end

      def api_key
        ALTER_CONFIGS_API
      end

      def api_version
        0
      end

      def response_class
        Protocol::AlterConfigsResponse
      end

      def encode(encoder)
        encoder.write_array(@resources) do |type, name, configs|
          encoder.write_int8(type)
          encoder.write_string(name)

          configs = configs.to_a
          encoder.write_array(configs) do |config_name, config_value|
            # Config value is nullable. In other cases, we must write the
            # stringified value.
            config_value = config_value.to_s unless config_value.nil?

            encoder.write_string(config_name)
            encoder.write_string(config_value)
          end
        end
        # validate_only. We'll skip this feature.
        encoder.write_boolean(false)
      end
    end

  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ruby-kafka-0.6.0.beta4 lib/kafka/protocol/alter_configs_request.rb
ruby-kafka-0.6.0.beta3 lib/kafka/protocol/alter_configs_request.rb