confluent-kafka-dotnet
Show / Hide Table of Contents

Class TopicPartitionOffset

Represents a Kafka (topic, partition, offset) tuple.

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

Constructors

TopicPartitionOffset(TopicPartition, Offset)

Initializes a new TopicPartitionOffset instance.

Declaration
public TopicPartitionOffset(TopicPartition tp, Offset offset)
Parameters
TypeNameDescription
TopicPartitiontp

Kafka topic name and partition.

Offsetoffset

A Kafka offset value.

TopicPartitionOffset(TopicPartition, Offset, int?)

Initializes a new TopicPartitionOffset instance.

Declaration
public TopicPartitionOffset(TopicPartition tp, Offset offset, int? leaderEpoch)
Parameters
TypeNameDescription
TopicPartitiontp

Kafka topic name and partition.

Offsetoffset

A Kafka offset value.

int?leaderEpoch

The offset leader epoch (optional).

TopicPartitionOffset(string, Partition, Offset)

Initializes a new TopicPartitionOffset instance.

Declaration
public TopicPartitionOffset(string topic, Partition partition, Offset offset)
Parameters
TypeNameDescription
stringtopic

A Kafka topic name.

Partitionpartition

A Kafka partition.

Offsetoffset

A Kafka offset value.

TopicPartitionOffset(string, Partition, Offset, int?)

Initializes a new TopicPartitionOffset instance.

Declaration
public TopicPartitionOffset(string topic, Partition partition, Offset offset, int? leaderEpoch)
Parameters
TypeNameDescription
stringtopic

A Kafka topic name.

Partitionpartition

A Kafka partition.

Offsetoffset

A Kafka offset value.

int?leaderEpoch

The optional offset leader epoch.

Properties

LeaderEpoch

Gets the offset leader epoch (optional).

Declaration
public int? LeaderEpoch { get; }
Property Value
TypeDescription
int?

Offset

Gets the Kafka partition offset value.

Declaration
public Offset Offset { get; }
Property Value
TypeDescription
Offset

Partition

Gets the Kafka partition.

Declaration
public Partition Partition { get; }
Property Value
TypeDescription
Partition

Topic

Gets the Kafka topic name.

Declaration
public string Topic { get; }
Property Value
TypeDescription
string

TopicPartition

Gets the TopicPartition component of this TopicPartitionOffset instance.

Declaration
public TopicPartition TopicPartition { get; }
Property Value
TypeDescription
TopicPartition

Methods

Equals(object)

Tests whether this TopicPartitionOffset instance is equal to the specified object.

Declaration
public override bool Equals(object obj)
Parameters
TypeNameDescription
objectobj

The object to test.

Returns
TypeDescription
bool

true if obj is a TopicPartitionOffset and all properties are equal. false otherwise.

Overrides
object.Equals(object)

GetHashCode()

Returns a hash code for this TopicPartitionOffset.

Declaration
public override int GetHashCode()
Returns
TypeDescription
int

An integer that specifies a hash value for this TopicPartitionOffset.

Overrides
object.GetHashCode()

ToString()

Returns a string representation of the TopicPartitionOffset object.

Declaration
public override string ToString()
Returns
TypeDescription
string

A string that represents the TopicPartitionOffset object.

Overrides
object.ToString()

Operators

operator ==(TopicPartitionOffset, TopicPartitionOffset)

Tests whether TopicPartitionOffset instance a is equal to TopicPartitionOffset instance b.

Declaration
public static bool operator ==(TopicPartitionOffset a, TopicPartitionOffset b)
Parameters
TypeNameDescription
TopicPartitionOffseta

The first TopicPartitionOffset instance to compare.

TopicPartitionOffsetb

The second TopicPartitionOffset instance to compare.

Returns
TypeDescription
bool

true if TopicPartitionOffset instances a and b are equal. false otherwise.

operator !=(TopicPartitionOffset, TopicPartitionOffset)

Tests whether TopicPartitionOffset instance a is not equal to TopicPartitionOffset instance b.

Declaration
public static bool operator !=(TopicPartitionOffset a, TopicPartitionOffset b)
Parameters
TypeNameDescription
TopicPartitionOffseta

The first TopicPartitionOffset instance to compare.

TopicPartitionOffsetb

The second TopicPartitionOffset instance to compare.

Returns
TypeDescription
bool

true if TopicPartitionOffset instances a and b are not equal. false otherwise.

In this article