Class TopicPartitionOffsetError
Represents a Kafka (topic, partition, offset, error) tuple.
Inherited Members
Namespace: Confluent.Kafka
Assembly: Confluent.Kafka.dll
Syntax
public class TopicPartitionOffsetError
Constructors
TopicPartitionOffsetError(TopicPartition, Offset, Error, int?)
Initializes a new TopicPartitionOffsetError instance.
Declaration
public TopicPartitionOffsetError(TopicPartition tp, Offset offset, Error error, int? leaderEpoch = null)
Parameters
| Type | Name | Description |
|---|---|---|
| TopicPartition | tp | Kafka topic name and partition values. |
| Offset | offset | A Kafka offset value. |
| Error | error | A Kafka error. |
| int? | leaderEpoch | The offset leader epoch (optional). |
TopicPartitionOffsetError(TopicPartitionOffset, Error)
Initializes a new TopicPartitionOffsetError instance.
Declaration
public TopicPartitionOffsetError(TopicPartitionOffset tpo, Error error)
Parameters
| Type | Name | Description |
|---|---|---|
| TopicPartitionOffset | tpo | Kafka topic name, partition and offset values. |
| Error | error | A Kafka error. |
TopicPartitionOffsetError(string, Partition, Offset, Error, int?)
Initializes a new TopicPartitionOffsetError instance.
Declaration
public TopicPartitionOffsetError(string topic, Partition partition, Offset offset, Error error, int? leaderEpoch = null)
Parameters
| Type | Name | Description |
|---|---|---|
| string | topic | A Kafka topic name. |
| Partition | partition | A Kafka partition value. |
| Offset | offset | A Kafka offset value. |
| Error | error | A Kafka error. |
| int? | leaderEpoch | The offset leader epoch (optional). |
Properties
Error
Gets the Kafka error.
Declaration
public Error Error { get; }
Property Value
| Type | Description |
|---|---|
| Error |
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 TopicPartitionOffsetError instance.
Declaration
public TopicPartition TopicPartition { get; }
Property Value
| Type | Description |
|---|---|
| TopicPartition |
TopicPartitionOffset
Gets the TopicPartitionOffset component of this TopicPartitionOffsetError instance.
Declaration
public TopicPartitionOffset TopicPartitionOffset { get; }
Property Value
| Type | Description |
|---|---|
| TopicPartitionOffset |
Methods
Equals(object)
Tests whether this TopicPartitionOffsetError 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 TopicPartitionOffsetError and all properties are equal. false otherwise. |
Overrides
GetHashCode()
Returns a hash code for this TopicPartitionOffsetError.
Declaration
public override int GetHashCode()
Returns
| Type | Description |
|---|---|
| int | An integer that specifies a hash value for this TopicPartitionOffsetError. |
Overrides
ToString()
Returns a string representation of the TopicPartitionOffsetError object.
Declaration
public override string ToString()
Returns
| Type | Description |
|---|---|
| string | A string representation of the TopicPartitionOffsetError object. |
Overrides
Operators
operator ==(TopicPartitionOffsetError, TopicPartitionOffsetError)
Tests whether TopicPartitionOffsetError instance a is equal to TopicPartitionOffsetError instance b.
Declaration
public static bool operator ==(TopicPartitionOffsetError a, TopicPartitionOffsetError b)
Parameters
| Type | Name | Description |
|---|---|---|
| TopicPartitionOffsetError | a | The first TopicPartitionOffsetError instance to compare. |
| TopicPartitionOffsetError | b | The second TopicPartitionOffsetError instance to compare. |
Returns
| Type | Description |
|---|---|
| bool | true if TopicPartitionOffsetError instances a and b are equal. false otherwise. |
explicit operator TopicPartitionOffset(TopicPartitionOffsetError)
Converts TopicPartitionOffsetError instance to TopicPartitionOffset instance. NOTE: Throws KafkaException if Error.Code != ErrorCode.NoError
Declaration
public static explicit operator TopicPartitionOffset(TopicPartitionOffsetError tpoe)
Parameters
| Type | Name | Description |
|---|---|---|
| TopicPartitionOffsetError | tpoe | The TopicPartitionOffsetError instance to convert. |
Returns
| Type | Description |
|---|---|
| TopicPartitionOffset | TopicPartitionOffset instance converted from TopicPartitionOffsetError instance |
operator !=(TopicPartitionOffsetError, TopicPartitionOffsetError)
Tests whether TopicPartitionOffsetError instance a is not equal to TopicPartitionOffsetError instance b.
Declaration
public static bool operator !=(TopicPartitionOffsetError a, TopicPartitionOffsetError b)
Parameters
| Type | Name | Description |
|---|---|---|
| TopicPartitionOffsetError | a | The first TopicPartitionOffsetError instance to compare. |
| TopicPartitionOffsetError | b | The second TopicPartitionOffsetError instance to compare. |
Returns
| Type | Description |
|---|---|
| bool | true if TopicPartitionOffsetError instances a and b are not equal. false otherwise. |