VectorClock Class

Vector clock

DECLARATION
public class VectorClock : IEquatable<VectorClock>
NAMESPACE
LanguageExt

Fields

Empty
DECLARATION
public static readonly VectorClock Empty
Versions
DECLARATION
public readonly Lst<ClockEntry> Versions

Methods

Compare(VectorClock, VectorClock)
SUMMARY

Is this reflexive, antisymetic, and transitive? Compare two VectorClocks, the outcomes will be one of the following:

* Clock 1 is /before/ clock 2
if there exists an i such that c1(i) <= c(2) and there does not
exist a j such that c1(j) > c2(j).


* Clock 1 is /concurrent/ to clock 2 if there exists an i, j such that
c1(i) < c2(i) and c1(j) > c2(j)


* Clock 1 is /after/ clock 2 otherwise


PARAMETERS
v1
VectorClock
The first VectorClock
v2
VectorClock
The second VectorClock
DECLARATION
public static Occured Compare(VectorClock v1, VectorClock v2)
RETURNS
Occured
Whether the change occured before, after or concurrently
Equals(object)
SUMMARY

Equality test

PARAMETERS
obj
object
DECLARATION
public override bool Equals(object obj)
RETURNS
bool
Equals(VectorClock)
PARAMETERS
rhs
VectorClock
DECLARATION
public bool Equals(VectorClock rhs)
RETURNS
bool
GetHashCode()
DECLARATION
public override int GetHashCode()
RETURNS
int
Incr(int)
SUMMARY

Increment the version info associated with the given node

PARAMETERS
nodeId
int
Node to increment
DECLARATION
public VectorClock Incr(int nodeId)
RETURNS
VectorClock
Merge(VectorClock)
SUMMARY

Merge clocks

PARAMETERS
clock
VectorClock
DECLARATION
public VectorClock Merge(VectorClock clock)
RETURNS
VectorClock
ToString()
SUMMARY

ToString

DECLARATION
public override string ToString()
RETURNS
string

Enums

Occured

SUMMARY

The result of comparing two times

either t1 is before t2,
t1 is after t2,
or t1 happens concurrently to t2

Before
-1
Event occurred before
After
1
Event occurred after
Concurrently
0
Event occurred independantly
DECLARATION
public enum Occured : int