Table of Contents

Struct ShardChangeRecord

Namespace
DynaSharp.Streams
Assembly
DynaSharp.dll

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

shardId string

The identifier of the shard the record came from.

record ChangeRecord

The 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

public ChangeRecord Record { get; init; }

Property Value

ChangeRecord

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

string

ShardId

Gets the identifier of the shard the record came from.

public string ShardId { get; init; }

Property Value

string

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

shardId string

The identifier of the shard.

record ChangeRecord

The record.

Equals(ShardChangeRecord)

Tells whether this value holds the same shard as other, ordinal, and an equal record.

public bool Equals(ShardChangeRecord other)

Parameters

other ShardChangeRecord

The other value.

Returns

bool

true if they are equal.

Equals(object?)

Tells whether obj is a ShardChangeRecord equal to this one.

public override bool Equals(object? obj)

Parameters

obj object

The object.

Returns

bool

true if it is an equal value.

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

left ShardChangeRecord

The first value.

right ShardChangeRecord

The second value.

Returns

bool

true if they are equal.

operator !=(ShardChangeRecord, ShardChangeRecord)

Tells whether two values differ in their shard or their record.

public static bool operator !=(ShardChangeRecord left, ShardChangeRecord right)

Parameters

left ShardChangeRecord

The first value.

right ShardChangeRecord

The second value.

Returns

bool

true if they are not equal.