confluent-kafka-dotnet
Show / Hide Table of Contents

Class PartitionMetadata

Metadata pertaining to a single Kafka topic partition.

Inheritance
object
PartitionMetadata
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
Namespace: Confluent.Kafka
Assembly: Confluent.Kafka.dll
Syntax
public class PartitionMetadata

Constructors

PartitionMetadata(int, int, int[], int[], Error)

Initializes a new PartitionMetadata instance.

Declaration
public PartitionMetadata(int partitionId, int leader, int[] replicas, int[] inSyncReplicas, Error error)
Parameters
Type Name Description
int partitionId

The id of the partition this metadata relates to.

int leader

The id of the broker that is the leader for the partition.

int[] replicas

The ids of all brokers that contain replicas of the partition.

int[] 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
int[]

Leader

Gets the id of the broker that is the leader for the partition.

Declaration
public int Leader { get; }
Property Value
Type Description
int

PartitionId

Gets the id of the partition this metadata relates to.

Declaration
public int PartitionId { get; }
Property Value
Type Description
int

Replicas

Gets the ids of all brokers that contain replicas of the partition.

Declaration
public int[] Replicas { get; }
Property Value
Type Description
int[]

Methods

ToString()

Returns a JSON representation of the PartitionMetadata object.

Declaration
public override string ToString()
Returns
Type Description
string

A JSON representation the PartitionMetadata object.

Overrides
object.ToString()
In this article