Class ConcurrencyViolation

Namespace
Cratis.Chronicle.EventSequences.Concurrency
Assembly
Cratis.Chronicle.dll

Represents a concurrency violation that occurred during an append operation.

public record ConcurrencyViolation : IEquatable<ConcurrencyViolation>
Inheritance
ConcurrencyViolation
Implements
Inherited Members
Extension Methods

Constructors

ConcurrencyViolation(ConcurrencyViolation)

protected ConcurrencyViolation(ConcurrencyViolation original)

Parameters

original ConcurrencyViolation

ConcurrencyViolation(EventSourceId, EventSequenceNumber, EventSequenceNumber)

Represents a concurrency violation that occurred during an append operation.

public ConcurrencyViolation(EventSourceId EventSourceId, EventSequenceNumber ExpectedEventSequenceNumber, EventSequenceNumber ActualEventSequenceNumber)

Parameters

EventSourceId EventSourceId

The EventSourceId of the event source where the violation occurred.

ExpectedEventSequenceNumber EventSequenceNumber

The expected EventSequenceNumber.

ActualEventSequenceNumber EventSequenceNumber

The actual EventSequenceNumber.

Properties

ActualEventSequenceNumber

The actual EventSequenceNumber.

public EventSequenceNumber ActualEventSequenceNumber { get; init; }

Property Value

EventSequenceNumber

ConflictingEventSequenceNumber

Gets the EventSequenceNumber of the first event that caused the violation, if the kernel reported it.

public EventSequenceNumber? ConflictingEventSequenceNumber { get; init; }

Property Value

EventSequenceNumber

Remarks

This is the first event matching the concurrency scope after the expected sequence number. It is null when the kernel is older than this client or could not read the event.

ConflictingEventTypeId

Gets the EventTypeId of the first event that caused the violation, if the kernel reported it.

public EventTypeId? ConflictingEventTypeId { get; init; }

Property Value

EventTypeId

Remarks

This is the first event matching the concurrency scope after the expected sequence number. It is null when the kernel is older than this client or could not read the event.

EqualityContract

protected virtual Type EqualityContract { get; }

Property Value

Type

EventSourceId

The EventSourceId of the event source where the violation occurred.

public EventSourceId EventSourceId { get; init; }

Property Value

EventSourceId

ExpectedEventSequenceNumber

The expected EventSequenceNumber.

public EventSequenceNumber ExpectedEventSequenceNumber { get; init; }

Property Value

EventSequenceNumber

Scope

Gets the predicate and expected boundary that failed, when reported.

public ConcurrencyScope? Scope { get; init; }

Property Value

ConcurrencyScope

ScopeIndex

Gets the failed scope's zero-based position in the request sent by the client, after de-duplication and resolution, when reported.

public uint? ScopeIndex { get; init; }

Property Value

uint?

Methods

Deconstruct(out EventSourceId, out EventSequenceNumber, out EventSequenceNumber)

public void Deconstruct(out EventSourceId EventSourceId, out EventSequenceNumber ExpectedEventSequenceNumber, out EventSequenceNumber ActualEventSequenceNumber)

Parameters

EventSourceId EventSourceId
ExpectedEventSequenceNumber EventSequenceNumber
ActualEventSequenceNumber EventSequenceNumber

Equals(ConcurrencyViolation?)

public virtual bool Equals(ConcurrencyViolation? other)

Parameters

other ConcurrencyViolation

Returns

bool

Equals(object?)

public override bool Equals(object? obj)

Parameters

obj object

Returns

bool

GetHashCode()

public override int GetHashCode()

Returns

int

PrintMembers(StringBuilder)

protected virtual bool PrintMembers(StringBuilder builder)

Parameters

builder StringBuilder

Returns

bool

ToString()

public override string ToString()

Returns

string

Operators

operator ==(ConcurrencyViolation?, ConcurrencyViolation?)

public static bool operator ==(ConcurrencyViolation? left, ConcurrencyViolation? right)

Parameters

left ConcurrencyViolation
right ConcurrencyViolation

Returns

bool

operator !=(ConcurrencyViolation?, ConcurrencyViolation?)

public static bool operator !=(ConcurrencyViolation? left, ConcurrencyViolation? right)

Parameters

left ConcurrencyViolation
right ConcurrencyViolation

Returns

bool