Class: Kafka::Protocol::TxnOffsetCommitResponse

Inherits:
Object
  • Object
show all
Defined in:
lib/kafka/protocol/txn_offset_commit_response.rb

Defined Under Namespace

Classes: PartitionError, TopicPartitionsError

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(errors:) ⇒ TxnOffsetCommitResponse

Returns a new instance of TxnOffsetCommitResponse.



26
27
28
# File 'lib/kafka/protocol/txn_offset_commit_response.rb', line 26

def initialize(errors:)
  @errors = errors
end

Instance Attribute Details

#errorsObject (readonly)

Returns the value of attribute errors.



24
25
26
# File 'lib/kafka/protocol/txn_offset_commit_response.rb', line 24

def errors
  @errors
end

Class Method Details

.decode(decoder) ⇒ Object



30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# File 'lib/kafka/protocol/txn_offset_commit_response.rb', line 30

def self.decode(decoder)
  _throttle_time_ms = decoder.int32
  errors = decoder.array do
    TopicPartitionsError.new(
      topic: decoder.string,
      partitions: decoder.array do
        PartitionError.new(
          partition: decoder.int32,
          error_code: decoder.int16
        )
      end
    )
  end
  new(errors: errors)
end