Class PartitionMetadata
Metadata pertaining to a single Kafka topic partition.
Inheritance
Inherited Members
Namespace: Confluent.Kafka
Assembly: cs.temp.dll.dll
Syntax
public class PartitionMetadata
Constructors
PartitionMetadata(Int32, Int32, Int32[], Int32[], Error)
Initializes a new PartitionMetadata instance.
Declaration
public PartitionMetadata(int partitionId, int leader, int[] replicas, int[] inSyncReplicas, Error error)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | partitionId | The id of the partition this metadata relates to. |
System.Int32 | leader | The id of the broker that is the leader for the partition. |
System.Int32[] | replicas | The ids of all brokers that contain replicas of the partition. |
System.Int32[] | inSyncReplicas | The ids of all brokers that contain in-sync replicas of the partition. Note: this value is cached by the broker and is consequently not guaranteed to be up-to-date. |
Error | error | A rich Error object associated with the request for this partition metadata. |
Properties
Error
Gets a rich Error object associated with the request for this partition metadata. Note: this value is cached by the broker and is consequently not guaranteed to be up-to-date.
Declaration
public Error Error { get; }
Property Value
Type | Description |
---|---|
Error |
InSyncReplicas
Gets the ids of all brokers that contain in-sync replicas of the partition.
Declaration
public int[] InSyncReplicas { get; }
Property Value
Type | Description |
---|---|
System.Int32[] |
Leader
Gets the id of the broker that is the leader for the partition.
Declaration
public int Leader { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
PartitionId
Gets ths id of the partition this metadata relates to.
Declaration
public int PartitionId { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
Replicas
Gets the ids of all brokers that contain replicas of the partition.
Declaration
public int[] Replicas { get; }
Property Value
Type | Description |
---|---|
System.Int32[] |
Methods
ToString()
Returns a JSON representation of the PartitionMetadata object.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
System.String | A JSON representation the PartitionMetadata object. |