Package io.github.alexandrepiveteau.echo.core.causality
Types
An EventIdentifier uniquely identifies events and their causality relationships in a distributed system. It offers the properties of a Lamport timestamp, with a unique site identifier for each client to disambiguate duplicate timestamps.
An array of event identifiers. When targeting the JVM, instances of this class are represented as long[]
.
An Iterator that is specialized for EventIdentifier. On the JVM, the values will be represented as a long
.
A sequence number is a monotonically increasing value defined for a site. It can be seen as a logical timestamp.
A SiteIdentifier is a unique identifier amongst all the sites in a distributed system. Two sites are guaranteed to have different SiteIdentifier.
Functions
Searches this EventIdentifierArray for the provided element using the binary search algorithm. The array is expected to be sorted, otherwise the result is undefined.
Searches this EventIdentifierArray for the provided element using the binary search algorithm. The array is expected to be sorted by site identifiers, otherwise the result is undefined.
Copies this array or its subrange into the destination array and returns that array.
Builds a new EventIdentifier, for a given SequenceNumber and a given SiteIdentifier.
Creates an empty EventIdentifierArray.
Returns the maximum SequenceNumber in a pair.
Returns the maximum SequenceNumber in a triple.
Gets the next random SiteIdentifier from the random number generator.
Sorts the array in-place.
If this SequenceNumber then this is returned, otherwise block is executed and its result is returned.
Creates an EventIdentifier from a ULong.
Returns a primitive array from a generic Array of EventIdentifier.
Creates a SequenceNumber from a UInt.
Creates a SiteIdentifier from the current Int.
Returns a typed object array containing all the elements of this primitive array.
Creates a UInt from a SequenceNumber.
Creates an UInt from the current SiteIdentifier.
Creates an ULong from an EventIdentifier.
Properties
false
when this has SiteIdentifier.Unspecified or SequenceNumber.Unspecified.
false
when this is SequenceNumber.Unspecified.
false
when this has SiteIdentifier.Unspecified or SequenceNumber.Unspecified.
true
when this is SequenceNumber.Unspecified.