Class: Rdkafka::Metadata::PartitionMetadata
- Inherits:
-
CustomFFIStruct
- Object
- FFI::Struct
- CustomFFIStruct
- Rdkafka::Metadata::PartitionMetadata
- Defined in:
- lib/rdkafka/metadata.rb
Overview
FFI struct for rd_kafka_metadata_partition_t
Instance Method Summary collapse
-
#to_h ⇒ Hash{Symbol => Integer, Array<Integer>}
The base
#to_hskips FFI pointer members, which would drop the replica and in-sync replica assignments entirely.
Instance Method Details
#to_h ⇒ Hash{Symbol => Integer, Array<Integer>}
The base #to_h skips FFI pointer members, which would drop the replica and in-sync
replica assignments entirely. We dereference those pointers here so the partition hash
exposes the broker ids backing the partition (needed e.g. to plan replication changes).
186 187 188 189 190 191 |
# File 'lib/rdkafka/metadata.rb', line 186 def to_h super.merge( replicas: read_broker_ids(self[:replicas], self[:replica_count]), isrs: read_broker_ids(self[:isrs], self[:in_sync_replica_brokers]) ) end |