Class: Kafka::FFI::Metadata
- Inherits:
-
FFI::Struct
- Object
- FFI::Struct
- Kafka::FFI::Metadata
- Defined in:
- lib/kafka/ffi/metadata.rb
Instance Method Summary collapse
-
#broker_id ⇒ Integer
Returns the ID of the Broker that the metadata request was served by.
-
#broker_name ⇒ String
Returns the name of the Broker that the metadata request was served by.
-
#brokers ⇒ Array<BrokerMetadata>
Returns detailed metadata for the Brokers in the cluster.
-
#destroy ⇒ Object
Destroy the Metadata response, returning it's resources back to the system.
-
#topics ⇒ Array<TopicMetadata>
Returns detailed metadata about the topics and their partitions.
Instance Method Details
#broker_id ⇒ Integer
Returns the ID of the Broker that the metadata request was served by.
39 40 41 |
# File 'lib/kafka/ffi/metadata.rb', line 39 def broker_id self[:orig_broker_id] end |
#broker_name ⇒ String
Returns the name of the Broker that the metadata request was served by.
46 47 48 |
# File 'lib/kafka/ffi/metadata.rb', line 46 def broker_name self[:orig_broker_name] end |
#brokers ⇒ Array<BrokerMetadata>
Returns detailed metadata for the Brokers in the cluster.
17 18 19 20 21 22 23 |
# File 'lib/kafka/ffi/metadata.rb', line 17 def brokers ptr = self[:brokers] self[:broker_cnt].times.map do |i| BrokerMetadata.new(ptr + (i * BrokerMetadata.size)) end end |
#destroy ⇒ Object
Destroy the Metadata response, returning it's resources back to the system.
52 53 54 55 56 |
# File 'lib/kafka/ffi/metadata.rb', line 52 def destroy if !null? ::Kafka::FFI.rd_kafka_metadata_destroy(self) end end |
#topics ⇒ Array<TopicMetadata>
Returns detailed metadata about the topics and their partitions.
28 29 30 31 32 33 34 |
# File 'lib/kafka/ffi/metadata.rb', line 28 def topics ptr = self[:topics] self[:topic_cnt].times.map do |i| TopicMetadata.new(ptr + (i * TopicMetadata.size)) end end |