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
TypeNameDescription
intpartitionId

The id of the partition this metadata relates to.

intleader

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.

Errorerror

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
TypeDescription
Error

InSyncReplicas

Gets the ids of all brokers that contain in-sync replicas of the partition.

Declaration
public int[] InSyncReplicas { get; }
Property Value
TypeDescription
int[]

Leader

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

Declaration
public int Leader { get; }
Property Value
TypeDescription
int

PartitionId

Gets the id of the partition this metadata relates to.

Declaration
public int PartitionId { get; }
Property Value
TypeDescription
int

Replicas

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

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

Methods

ToString()

Returns a JSON representation of the PartitionMetadata object.

Declaration
public override string ToString()
Returns
TypeDescription
string

A JSON representation the PartitionMetadata object.

Overrides
object.ToString()
In this article