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.



71
72
73
74
75
# File 'lib/kafka/protocol/metadata_response.rb', line 71

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:



67
68
69
# File 'lib/kafka/protocol/metadata_response.rb', line 67

def partitions
  @partitions
end

#topic_error_codeObject (readonly)

Returns the value of attribute topic_error_code.



69
70
71
# File 'lib/kafka/protocol/metadata_response.rb', line 69

def topic_error_code
  @topic_error_code
end

#topic_nameString (readonly)

Returns the name of the topic.

Returns:

  • (String)

    the name of the topic



64
65
66
# File 'lib/kafka/protocol/metadata_response.rb', line 64

def topic_name
  @topic_name
end