Class TopicPartitionOffset
Represents a Kafka (topic, partition, offset) tuple.
Inheritance
Inherited Members
Namespace: Confluent.Kafka
Assembly: cs.temp.dll.dll
Syntax
public class TopicPartitionOffset
Constructors
TopicPartitionOffset(TopicPartition, Offset, Nullable<Int32>)
Initializes a new TopicPartitionOffset instance.
Declaration
public TopicPartitionOffset(TopicPartition tp, Offset offset, int? leaderEpoch = null)
Parameters
Type | Name | Description |
---|---|---|
TopicPartition | tp | Kafka topic name and partition. |
Offset | offset | A Kafka offset value. |
System.Nullable<System.Int32> | leaderEpoch | The offset leader epoch (optional). |
TopicPartitionOffset(String, Partition, Offset, Nullable<Int32>)
Initializes a new TopicPartitionOffset instance.
Declaration
public TopicPartitionOffset(string topic, Partition partition, Offset offset, int? leaderEpoch = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | topic | A Kafka topic name. |
Partition | partition | A Kafka partition. |
Offset | offset | A Kafka offset value. |
System.Nullable<System.Int32> | leaderEpoch | The optional offset leader epoch. |
Properties
LeaderEpoch
Gets the offset leader epoch (optional).
Declaration
public int? LeaderEpoch { get; }
Property Value
Type | Description |
---|---|
System.Nullable<System.Int32> |
Offset
Gets the Kafka partition offset value.
Declaration
public Offset Offset { get; }
Property Value
Type | Description |
---|---|
Offset |
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 |
TopicPartition
Gets the TopicPartition component of this TopicPartitionOffset instance.
Declaration
public TopicPartition TopicPartition { get; }
Property Value
Type | Description |
---|---|
TopicPartition |
Methods
Equals(Object)
Tests whether this TopicPartitionOffset 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 TopicPartitionOffset and all properties are equal. false otherwise. |
Overrides
GetHashCode()
Returns a hash code for this TopicPartitionOffset.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
System.Int32 | An integer that specifies a hash value for this TopicPartitionOffset. |
Overrides
ToString()
Returns a string representation of the TopicPartitionOffset object.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
System.String | A string that represents the TopicPartitionOffset object. |
Overrides
Operators
Equality(TopicPartitionOffset, TopicPartitionOffset)
Tests whether TopicPartitionOffset instance a is equal to TopicPartitionOffset instance b.
Declaration
public static bool operator ==(TopicPartitionOffset a, TopicPartitionOffset b)
Parameters
Type | Name | Description |
---|---|---|
TopicPartitionOffset | a | The first TopicPartitionOffset instance to compare. |
TopicPartitionOffset | b | The second TopicPartitionOffset instance to compare. |
Returns
Type | Description |
---|---|
System.Boolean | true if TopicPartitionOffset instances a and b are equal. false otherwise. |
Inequality(TopicPartitionOffset, TopicPartitionOffset)
Tests whether TopicPartitionOffset instance a is not equal to TopicPartitionOffset instance b.
Declaration
public static bool operator !=(TopicPartitionOffset a, TopicPartitionOffset b)
Parameters
Type | Name | Description |
---|---|---|
TopicPartitionOffset | a | The first TopicPartitionOffset instance to compare. |
TopicPartitionOffset | b | The second TopicPartitionOffset instance to compare. |
Returns
Type | Description |
---|---|
System.Boolean | true if TopicPartitionOffset instances a and b are not equal. false otherwise. |