Class TopicPartition
Represents a Kafka (topic, partition) tuple.
Inheritance
Inherited Members
Namespace: Confluent.Kafka
Assembly: cs.temp.dll.dll
Syntax
public class TopicPartition
Constructors
TopicPartition(String, Int32)
Initializes a new TopicPartition instance.
Declaration
public TopicPartition(string topic, int partition)
Parameters
Type | Name | Description |
---|---|---|
System.String | topic | A Kafka topic name. |
System.Int32 | partition | A Kafka partition. |
Properties
Partition
Gets the Kafka partition.
Declaration
public int Partition { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
Topic
Gets the Kafka topic name.
Declaration
public string Topic { get; }
Property Value
Type | Description |
---|---|
System.String |
Methods
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. |