Class: Kafka::Protocol::AddPartitionsToTxnRequest
- Inherits:
-
Object
- Object
- Kafka::Protocol::AddPartitionsToTxnRequest
- Defined in:
- lib/kafka/protocol/add_partitions_to_txn_request.rb
Instance Method Summary collapse
- #api_key ⇒ Object
- #encode(encoder) ⇒ Object
-
#initialize(transactional_id: nil, producer_id:, producer_epoch:, topics:) ⇒ AddPartitionsToTxnRequest
constructor
A new instance of AddPartitionsToTxnRequest.
- #response_class ⇒ Object
Constructor Details
#initialize(transactional_id: nil, producer_id:, producer_epoch:, topics:) ⇒ AddPartitionsToTxnRequest
Returns a new instance of AddPartitionsToTxnRequest.
6 7 8 9 10 11 |
# File 'lib/kafka/protocol/add_partitions_to_txn_request.rb', line 6 def initialize(transactional_id: nil, producer_id:, producer_epoch:, topics:) @transactional_id = transactional_id @producer_id = producer_id @producer_epoch = producer_epoch @topics = topics end |
Instance Method Details
#api_key ⇒ Object
13 14 15 |
# File 'lib/kafka/protocol/add_partitions_to_txn_request.rb', line 13 def api_key ADD_PARTITIONS_TO_TXN_API end |
#encode(encoder) ⇒ Object
21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/kafka/protocol/add_partitions_to_txn_request.rb', line 21 def encode(encoder) encoder.write_string(@transactional_id.to_s) encoder.write_int64(@producer_id) encoder.write_int16(@producer_epoch) encoder.write_array(@topics.to_a) do |topic, partitions| encoder.write_string(topic) encoder.write_array(partitions) do |partition| encoder.write_int32(partition) end end end |
#response_class ⇒ Object
17 18 19 |
# File 'lib/kafka/protocol/add_partitions_to_txn_request.rb', line 17 def response_class AddPartitionsToTxnResponse end |