Class TopicPartition
Represents a Kafka (topic, partition) tuple.
Inheritance
Implements
Inherited Members
Namespace: Confluent.Kafka
Assembly: cs.temp.dll.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 |
---|---|---|
System.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 |
---|---|
System.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 |
---|---|---|
System.Object | obj |
Returns
Type | Description |
---|---|
System.Int32 | 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 |
---|---|---|
System.Object | obj | The object to test. |
Returns
Type | Description |
---|---|
System.Boolean | 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 |
---|---|
System.Int32 | 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 |
---|---|
System.String | A string that represents the TopicPartition object. |
Overrides
Operators
Equality(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 |
---|---|
System.Boolean | true if TopicPartition instances a and b are equal. false otherwise. |
Inequality(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 |
---|---|
System.Boolean | true if TopicPartition instances a and b are not equal. false otherwise. |