Class: Kafka::Protocol::FindCoordinatorRequest

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

Instance Method Summary collapse

Constructor Details

#initialize(coordinator_key:, coordinator_type:) ⇒ FindCoordinatorRequest

Returns a new instance of FindCoordinatorRequest.



6
7
8
9
# File 'lib/kafka/protocol/find_coordinator_request.rb', line 6

def initialize(coordinator_key:, coordinator_type:)
  @coordinator_key  = coordinator_key
  @coordinator_type = coordinator_type
end

Instance Method Details

#api_keyObject



11
12
13
# File 'lib/kafka/protocol/find_coordinator_request.rb', line 11

def api_key
  FIND_COORDINATOR_API
end

#api_versionObject



15
16
17
# File 'lib/kafka/protocol/find_coordinator_request.rb', line 15

def api_version
  1
end

#encode(encoder) ⇒ Object



19
20
21
22
# File 'lib/kafka/protocol/find_coordinator_request.rb', line 19

def encode(encoder)
  encoder.write_string(@coordinator_key)
  encoder.write_int8(@coordinator_type)
end

#response_classObject



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

def response_class
  FindCoordinatorResponse
end