Class: Kafka::Protocol::MetadataResponse::TopicMetadata

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(topic_error_code: 0, topic_name:, partitions:) ⇒ TopicMetadata

Returns a new instance of TopicMetadata.



59
60
61
62
63
# File 'lib/kafka/protocol/metadata_response.rb', line 59

def initialize(topic_error_code: 0, topic_name:, partitions:)
  @topic_error_code = topic_error_code
  @topic_name = topic_name
  @partitions = partitions
end

Instance Attribute Details

#partitionsArray<PartitionMetadata> (readonly)

Returns the partitions in the topic.

Returns:



55
56
57
# File 'lib/kafka/protocol/metadata_response.rb', line 55

def partitions
  @partitions
end

#topic_error_codeObject (readonly)

Returns the value of attribute topic_error_code.



57
58
59
# File 'lib/kafka/protocol/metadata_response.rb', line 57

def topic_error_code
  @topic_error_code
end

#topic_nameString (readonly)

Returns the name of the topic.

Returns:

  • (String)

    the name of the topic



52
53
54
# File 'lib/kafka/protocol/metadata_response.rb', line 52

def topic_name
  @topic_name
end