Class TopicPartition
Represents a Kafka (topic, partition) tuple.
Implements
Inherited Members
Namespace: Confluent.Kafka
Assembly: Confluent.Kafka.dll
Syntax
public class TopicPartition : IComparable
Constructors
TopicPartition(string, Partition)
Initializes a new TopicPartition instance.
Declaration
public TopicPartition(string topic, Partition partition)
Parameters
| Type | Name | Description |
|---|---|---|
| string | topic | A Kafka topic name. |
| Partition | partition | A Kafka partition. |
Properties
Partition
Gets the Kafka partition.
Declaration
public Partition Partition { get; }
Property Value
| Type | Description |
|---|---|
| Partition |
Topic
Gets the Kafka topic name.
Declaration
public string Topic { get; }
Property Value
| Type | Description |
|---|---|
| string |
Methods
CompareTo(object)
Compares the current instance with another object of the same type and returns an integer that indicates whether the current instance precedes, follows, or occurs in the same position in the sort order as the other object.
Declaration
public int CompareTo(object obj)
Parameters
| Type | Name | Description |
|---|---|---|
| object | obj |
Returns
| Type | Description |
|---|---|
| int | Less than zero: This instance precedes obj in the sort order. Zero: This instance occurs in the same position in the sort order as obj. Greater than zero: This instance follows obj in the sort order. |
Equals(object)
Tests whether this TopicPartition instance is equal to the specified object.
Declaration
public override bool Equals(object obj)
Parameters
| Type | Name | Description |
|---|---|---|
| object | obj | The object to test. |
Returns
| Type | Description |
|---|---|
| bool | true if obj is a TopicPartition and all properties are equal. false otherwise. |
Overrides
GetHashCode()
Returns a hash code for this TopicPartition.
Declaration
public override int GetHashCode()
Returns
| Type | Description |
|---|---|
| int | An integer that specifies a hash value for this TopicPartition. |
Overrides
ToString()
Returns a string representation of the TopicPartition object.
Declaration
public override string ToString()
Returns
| Type | Description |
|---|---|
| string | A string that represents the TopicPartition object. |
Overrides
Operators
operator ==(TopicPartition, TopicPartition)
Tests whether TopicPartition instance a is equal to TopicPartition instance b.
Declaration
public static bool operator ==(TopicPartition a, TopicPartition b)
Parameters
| Type | Name | Description |
|---|---|---|
| TopicPartition | a | The first TopicPartition instance to compare. |
| TopicPartition | b | The second TopicPartition instance to compare. |
Returns
| Type | Description |
|---|---|
| bool | true if TopicPartition instances a and b are equal. false otherwise. |
operator !=(TopicPartition, TopicPartition)
Tests whether TopicPartition instance a is not equal to TopicPartition instance b.
Declaration
public static bool operator !=(TopicPartition a, TopicPartition b)
Parameters
| Type | Name | Description |
|---|---|---|
| TopicPartition | a | The first TopicPartition instance to compare. |
| TopicPartition | b | The second TopicPartition instance to compare. |
Returns
| Type | Description |
|---|---|
| bool | true if TopicPartition instances a and b are not equal. false otherwise. |