Struct ShardChangeRecord
A record of ReadStreamAsync(ReadStreamRequest, CancellationToken), with the shard it came from.
public readonly struct ShardChangeRecord : IEquatable<ShardChangeRecord>
- Implements
- Inherited Members
Remarks
The shard and the sequence number of the record are the position to keep: ReadShardAsync(ReadShardRequest, CancellationToken) with this ShardId, AfterSequenceNumber and SequenceNumber reads the shard on after this record.
The shard is here and not on ChangeRecord because GetRecords does not say it: a record of
GetRecordsAsync(GetRecordsRequest, CancellationToken) comes from an iterator, which is opaque, so a property of ChangeRecord would be
null there and set elsewhere, and would change the equality of records that are the same change.
Two values are equal when their shard ids are equal, ordinal, and their records are equal. It is a plain struct and not a record struct, whose
generated Equals(object) carries no nullable annotation. The default value has null in both properties and comes
from no reading.
Constructors
ShardChangeRecord(string, ChangeRecord)
A record of ReadStreamAsync(ReadStreamRequest, CancellationToken), with the shard it came from.
public ShardChangeRecord(string shardId, ChangeRecord record)
Parameters
shardIdstringThe identifier of the shard the record came from.
recordChangeRecordThe record, as ReadShardAsync(ReadShardRequest, CancellationToken) returns it.
Remarks
The shard and the sequence number of the record are the position to keep: ReadShardAsync(ReadShardRequest, CancellationToken) with this ShardId, AfterSequenceNumber and SequenceNumber reads the shard on after this record.
The shard is here and not on ChangeRecord because GetRecords does not say it: a record of
GetRecordsAsync(GetRecordsRequest, CancellationToken) comes from an iterator, which is opaque, so a property of ChangeRecord would be
null there and set elsewhere, and would change the equality of records that are the same change.
Two values are equal when their shard ids are equal, ordinal, and their records are equal. It is a plain struct and not a record struct, whose
generated Equals(object) carries no nullable annotation. The default value has null in both properties and comes
from no reading.
Properties
Record
Gets the record, as ReadShardAsync(ReadShardRequest, CancellationToken) returns it.
public ChangeRecord Record { get; init; }
Property Value
SequenceNumber
Gets the sequence number of the record, SequenceNumber of DynamoDb, or null if the record has none, which DynamoDB always sends. It orders the records of one shard, and it is no number to compare across shards.
public string? SequenceNumber { get; }
Property Value
ShardId
Gets the identifier of the shard the record came from.
public string ShardId { get; init; }
Property Value
Methods
Deconstruct(out string, out ChangeRecord)
Takes the value apart, as var (shardId, record) = change.
public void Deconstruct(out string shardId, out ChangeRecord record)
Parameters
shardIdstringThe identifier of the shard.
recordChangeRecordThe record.
Equals(ShardChangeRecord)
Tells whether this value holds the same shard as other, ordinal, and an equal record.
public bool Equals(ShardChangeRecord other)
Parameters
otherShardChangeRecordThe other value.
Returns
Equals(object?)
Tells whether obj is a ShardChangeRecord equal to this one.
public override bool Equals(object? obj)
Parameters
objobjectThe object.
Returns
GetHashCode()
Gets a hash code from the shard and the record.
public override int GetHashCode()
Returns
- int
The hash code.
ToString()
Gets the shard and the record, as a record prints itself: ShardChangeRecord { ShardId = ..., Record = ... }.
public override string ToString()
Returns
- string
The text, which holds the record with its images and so the values of the item.
Operators
operator ==(ShardChangeRecord, ShardChangeRecord)
Tells whether two values hold the same shard and equal records.
public static bool operator ==(ShardChangeRecord left, ShardChangeRecord right)
Parameters
leftShardChangeRecordThe first value.
rightShardChangeRecordThe second value.
Returns
operator !=(ShardChangeRecord, ShardChangeRecord)
Tells whether two values differ in their shard or their record.
public static bool operator !=(ShardChangeRecord left, ShardChangeRecord right)
Parameters
leftShardChangeRecordThe first value.
rightShardChangeRecordThe second value.