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
Type Name Description
TopicPartition tp

Kafka topic name and partition.

Offset offset

A Kafka offset value.

TopicPartitionOffset(TopicPartition, Offset, int?)

Initializes a new TopicPartitionOffset instance.

Declaration
public TopicPartitionOffset(TopicPartition tp, Offset offset, int? leaderEpoch)
Parameters
Type Name Description
TopicPartition tp

Kafka topic name and partition.

Offset offset

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
Type Name Description
string topic

A Kafka topic name.

Partition partition

A Kafka partition.

Offset offset

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
Type Name Description
string topic

A Kafka topic name.

Partition partition

A Kafka partition.

Offset offset

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
Type Description
int?

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
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
object obj

The object to test.

Returns
Type Description
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
Type Description
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
Type Description
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
Type Name Description
TopicPartitionOffset a

The first TopicPartitionOffset instance to compare.

TopicPartitionOffset b

The second TopicPartitionOffset instance to compare.

Returns
Type Description
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
Type Name Description
TopicPartitionOffset a

The first TopicPartitionOffset instance to compare.

TopicPartitionOffset b

The second TopicPartitionOffset instance to compare.

Returns
Type Description
bool

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

In this article