confluent-kafka-dotnet
Show / Hide Table of Contents

Class IAdminClientExtensions

Extension methods for default IAdminClient implementations.

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

Methods

DescribeClusterAsync(IAdminClient, DescribeClusterOptions)

Describes the cluster.

Declaration
public static Task<DescribeClusterResult> DescribeClusterAsync(this IAdminClient adminClient, DescribeClusterOptions options = null)
Parameters
TypeNameDescription
IAdminClientadminClient

AdminClient interface.

DescribeClusterOptionsoptions

The options to use while describing cluster.

Returns
TypeDescription
Task<DescribeClusterResult>

A DescribeClusterResult.

Exceptions
TypeCondition
KafkaException

Thrown if there is any client-level error.

DescribeTopicsAsync(IAdminClient, TopicCollection, DescribeTopicsOptions)

Describes topics in the cluster.

Declaration
public static Task<DescribeTopicsResult> DescribeTopicsAsync(this IAdminClient adminClient, TopicCollection topicCollection, DescribeTopicsOptions options = null)
Parameters
TypeNameDescription
IAdminClientadminClient

AdminClient interface.

TopicCollectiontopicCollection

A collection of topics to describe.

DescribeTopicsOptionsoptions

The options to use while describing topics.

Returns
TypeDescription
Task<DescribeTopicsResult>

A DescribeTopicsResult, which contains a List of TopicDescription.

Exceptions
TypeCondition
KafkaException

Thrown if there is any client-level error.

DescribeTopicsException

Thrown if any of the constituent results is in error. The entire result (which may contain constituent results that are not in error) is available via the Results property of the exception.

ElectLeadersAsync(IAdminClient, ElectionType, IEnumerable<TopicPartition>, ElectLeadersOptions)

Perform Preferred or Unclean leader election for partitions.

Declaration
public static Task<ElectLeadersResult> ElectLeadersAsync(this IAdminClient adminClient, ElectionType electionType, IEnumerable<TopicPartition> partitions = null, ElectLeadersOptions options = null)
Parameters
TypeNameDescription
IAdminClientadminClient

AdminClient interface.

ElectionTypeelectionType

The type of election to trigger(Preferred or Unclean).

IEnumerable<TopicPartition>partitions

The partitions for which election has to be performed. For NULL partitions, election will be performed for all partitions. But results will be shown only where the election is successful or an error other than ELECTION_NOT_NEEDED is encountered.

ElectLeadersOptionsoptions

The options to use for this call.

Returns
TypeDescription
Task<ElectLeadersResult>

ListOffsetsAsync(IAdminClient, IEnumerable<TopicPartitionOffsetSpec>, ListOffsetsOptions)

Enables to find the beginning offset, end offset as well as the offset matching a timestamp or the offset with max timestamp in partitions.

Declaration
public static Task<ListOffsetsResult> ListOffsetsAsync(this IAdminClient adminClient, IEnumerable<TopicPartitionOffsetSpec> topicPartitionOffsets, ListOffsetsOptions options = null)
Parameters
TypeNameDescription
IAdminClientadminClient

AdminClient interface.

IEnumerable<TopicPartitionOffsetSpec>topicPartitionOffsets

A IEnumerable with partition to offset pairs (partitions must be unique).

ListOffsetsOptionsoptions

The options to use for this call.

Returns
TypeDescription
Task<ListOffsetsResult>
In this article