Show / Hide Table of Contents

Struct CheckpointPosition

The position in a partition's event stream to use when updating a checkpoint, indicating that an event processor should begin reading from the next event.

Namespace: System.Dynamic.ExpandoObject
Assembly: Azure.Messaging.EventHubs.dll
Syntax
public struct CheckpointPosition : IEquatable<Azure.Messaging.EventHubs.Processor.CheckpointPosition>

Constructors

CheckpointPosition()

Initializes an empty CheckpointPosition which can be used to clear existing checkpoint data.

Declaration
public CheckpointPosition ();

CheckpointPosition(Int64)

Initializes a new instance of the CheckpointPosition struct.

Declaration
[System.ComponentModel.EditorBrowsable]
[System.Obsolete("The Event Hubs service does not guarantee that a sequence number-only checkpoint can access the event stream for all resource configurations.  Reading events may not work in all cases going forward. Please provide a string-based offset.", false)]
public CheckpointPosition (long sequenceNumber);
Parameters
System.Int64 sequenceNumber

The sequence number to associate with the checkpoint. This indicates that a processor should begin reading from the next event in the stream.

Remarks

This constructor is not compatible when processing a geo-replicated Event Hub. Use CheckpointPosition(String, Int64) or FromEvent(EventData) instead.

CheckpointPosition(Int64, Int64)

Obsolete.

Initializes a new instance of the CheckpointPosition struct.

Declaration
[System.ComponentModel.EditorBrowsable]
[System.Obsolete("The Event Hubs service does not guarantee a numeric offset for all resource configurations.  Checkpoints created from a numeric offset may not work in all cases going forward. Please use a string-based offset instead.", false)]
public CheckpointPosition (long offset, long sequenceNumber = -9223372036854775808);
Parameters
System.Int64 offset

The offset to associate with the checkpoint. This indicates that a processor should begin reading from the next event in the stream.

System.Int64 sequenceNumber

The sequence number to associate with the checkpoint. This is used as informational metadata.

Remarks

This constructor is obsolete and should no longer be used. Please use CheckpointPosition(String, Int64) instead.

CheckpointPosition(String, Int64)

Initializes a new instance of the CheckpointPosition struct.

Declaration
public CheckpointPosition (string offsetString, long sequenceNumber = -9223372036854775808);
Parameters
System.String offsetString

The offset to associate with the checkpoint. This indicates that a processor should begin reading from the next event in the stream.

System.Int64 sequenceNumber

The sequence number to associate with the checkpoint. This is used as informational metadata.

Properties

Offset

Obsolete. A numeric representation of the offset to associate with the checkpoint. This indicates that a processor should begin reading from the next event in the stream.

Declaration
[System.ComponentModel.EditorBrowsable]
[System.Obsolete("The Event Hubs service does not guarantee a numeric offset for all resource configurations.  Please use 'OffsetString' instead.", false)]
public long Offset { get; }
Property Value
System.Int64

This value is obsolete and should no longer be used. Please use OffsetString instead.

OffsetString

The offset to associate with the checkpoint. This indicates that a processor should begin reading from the next event in the stream.

Declaration
public string OffsetString { get; }
Property Value
System.String

SequenceNumber

The sequence number to associate with the checkpoint. The sequence number is intended to be informational, and will only be used for positioning if no Offset is set.

Declaration
public long SequenceNumber { get; }
Property Value
System.Int64

Methods

Equals(CheckpointPosition)

Determines whether the specified CheckpointPosition is equal to this instance.

Declaration
public bool Equals (Azure.Messaging.EventHubs.Processor.CheckpointPosition other);
Parameters
CheckpointPosition other

The CheckpointPosition to compare with this instance.

Returns
System.Boolean

true if the specified CheckpointPosition is equal to this instance; otherwise, false.

Equals(Object)

Determines whether the specified System.Object is equal to this instance.

Declaration
[System.ComponentModel.EditorBrowsable]
public override bool Equals (object obj);
Parameters
System.Object obj

The System.Object to compare with this instance.

Returns
System.Boolean

true if the specified System.Object is equal to this instance; otherwise, false.

FromEvent(EventData)

Initializes a new instance of the CheckpointPosition from an EventData instance.

Declaration
public static Azure.Messaging.EventHubs.Processor.CheckpointPosition FromEvent (Azure.Messaging.EventHubs.EventData eventData);
Parameters
EventData eventData

The EventData to use to determine the starting point of a checkpoint, indicating that an event processor should begin reading from the next event in the stream.

Returns
CheckpointPosition

GetHashCode()

Returns a hash code for this instance.

Declaration
[System.ComponentModel.EditorBrowsable]
public override int GetHashCode ();
Returns
System.Int32

A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table.

ToString()

Converts the instance to string representation.

Declaration
public override string ToString ();
Returns
System.String

A System.String that represents the position in the event stream.

Operators

Equality(CheckpointPosition, CheckpointPosition)

Determines whether the specified CheckpointPosition instances are equal to each other.

Declaration
public static bool operator == (Azure.Messaging.EventHubs.Processor.CheckpointPosition left, Azure.Messaging.EventHubs.Processor.CheckpointPosition right);
Parameters
CheckpointPosition left

The first CheckpointPosition to consider.

CheckpointPosition right

The second CheckpointPosition to consider.

Returns
System.Boolean

true if the two specified CheckpointPosition instances are equal; otherwise, false.

Inequality(CheckpointPosition, CheckpointPosition)

Determines whether the specified CheckpointPosition instances are not equal to each other.

Declaration
public static bool operator != (Azure.Messaging.EventHubs.Processor.CheckpointPosition left, Azure.Messaging.EventHubs.Processor.CheckpointPosition right);
Parameters
CheckpointPosition left

The first CheckpointPosition to consider.

CheckpointPosition right

The second CheckpointPosition to consider.

Returns
System.Boolean

true if the two specified CheckpointPosition instances are not equal; otherwise, false.

Back to top Azure SDK for .NET