- Relation
- VectorClock <A> (Seq<(A, long)> Entries)
- Empty = new(Seq<(A, long)>())
- Equals (VectorClock<A>? rhs)
- GetHashCode ()
- Single (A x, long y)
- fromList (Seq<(A x, long y)> list)
- ToSeq ()
- IsEmpty
- Count
- Extract (A index)
- Lookup (A index)
- Contains (A index)
- Remove (A index)
- Insert (A index, long value)
- Inc (A index)
- Inc (A index, long defaultValue)
- combine ( Func<A, Option<long>, Option<long>, Option<long>> f, VectorClock<A> vc1, VectorClock<A> vc2)
- Max (VectorClock<A> vc2)
- max (VectorClock<A> vc1, VectorClock<A> vc2)
- Relation (VectorClock<A> vc2)
- relation (VectorClock<A> vc1, VectorClock<A> vc2)
- Causes (VectorClock<A> vc2)
- causes (VectorClock<A> vc1, VectorClock<A> vc2)
- Diff (VectorClock<A> vc2)
- diff (VectorClock<A> vc1, VectorClock<A> vc2)
- Valid
- VectorClock
- Single <A> (A x, long y)
- Single <OrdA, NumB, A, B> (A x, B y)
- fromList <A> (Seq<(A x, long y)> list)
- fromList <OrdA, NumB, A, B> (Seq<(A x, B y)> list)
- combine <A> ( Func<A, Option<long>, Option<long>, Option<long>> f, VectorClock<A> vc1, VectorClock<A> vc2)
- combine <OrdA, NumB, A, B> ( Func<A, Option<B>, Option<B>, Option<B>> f, VectorClock<OrdA, NumB, A, B> vc1, VectorClock<OrdA, NumB, A, B> vc2)
- max <A> (VectorClock<A> vc1, VectorClock<A> vc2)
- max <OrdA, NumB, A, B> (VectorClock<OrdA, NumB, A, B> vc1, VectorClock<OrdA, NumB, A, B> vc2)
- relation <A> (VectorClock<A> vc1, VectorClock<A> vc2)
- relation <OrdA, NumB, A, B> (VectorClock<OrdA, NumB, A, B> vc1, VectorClock<OrdA, NumB, A, B> vc2)
- causes <A> (VectorClock<A> vc1, VectorClock<A> vc2)
- causes <OrdA, NumB, A, B> (VectorClock<OrdA, NumB, A, B>vc1, VectorClock<OrdA, NumB, A, B> vc2)
- diff <A> (VectorClock<A> vc1, VectorClock<A> vc2)
- diff <OrdA, NumB, A, B> (VectorClock<OrdA, NumB, A, B> vc1, VectorClock<OrdA, NumB, A, B> vc2)
- VectorClock <OrdA, NumB, A, B> (Seq<(A, B)> Entries)
- Empty = new(Seq<(A, B)>())
- Equals (VectorClock<OrdA, NumB, A, B>? rhs)
- GetHashCode ()
- Single (A x, B y)
- fromList (Seq<(A x, B y)> list)
- ToList ()
- IsEmpty
- Count
- Extract (A index)
- Lookup (A index)
- Contains (A index)
- Remove (A index)
- Insert (A index, B value)
- Inc (A index)
- Inc (A index, B defaultValue)
- combine ( Func<A, Option<B>, Option<B>, Option<B>> f, VectorClock<OrdA, NumB, A, B> vc1, VectorClock<OrdA, NumB, A, B> vc2)
- max (VectorClock<OrdA, NumB, A, B> vc1, VectorClock<OrdA, NumB, A, B> vc2)
- Relation (VectorClock<OrdA, NumB, A, B> vc1, VectorClock<OrdA, NumB, A, B> vc2)
- relation (VectorClock<OrdA, NumB, A, B> vc1, VectorClock<OrdA, NumB, A, B> vc2)
- Causes (VectorClock<OrdA, NumB, A, B> vc2)
- causes (VectorClock<OrdA, NumB, A, B> vc1, VectorClock<OrdA, NumB, A, B> vc2)
- Diff (VectorClock<OrdA, NumB, A, B> vc2)
- diff (VectorClock<OrdA, NumB, A, B> vc1, VectorClock<OrdA, NumB, A, B> vc2)
- Valid
record VectorClock <A> (Seq<(A, long)> Entries) Source #
To create a vector clock, start from Empty
or Single
and Insert
elements into it. As a shortcut, fromList
just inserts all the
elements in a list, in order.
var vc = VectorClock<char>.Empty;
vc = vc.Insert('a', 1);
vc = vc.Insert('b', 2);
vc == VectorClock<char>.fromList(Seq(('a', 1), ('b', 2)))
Note that, for different keys, the order of insertion does not matter:
fromList(Seq(('a', 1), ('b', 2)) == fromList(Seq(('b', 2), ('a', 1))
Once you have a given vector clock, you can 'lookup' its fields, check that keys are 'member's, or convert it back 'toList' form.
vc.Lookup('a') == Some(1)
vc.Lookup('c') == None
The main operations that you would do with a vector clock are to increment the entry corresponding to the current process and to update the process's vector clock with the 'max' of its and the received message's clocks.
vc.Inc('a') == Some [('a', 2), ('b', 2)]
VectorClock.max( [('a', 1), ('b', 2)], [('c', 3), ('b', 1)] ) == [('a', 1), ('b', 2), ('c' 3)]
Finally, upon receiving different messages, you may wish to discover the relationship, if any, between them. This information could be useful in determining the correct order to process the messages.
VectorClock.relation (fromList [('a', 1), ('b', 2)], fromList [('a', 2), ('b', 2)]) == Causes
VectorClock.relation (fromList [('a', 2), ('b', 2)], fromList [('a', 1), ('b', 2)]) == CausedBy
VectorClock.relation (fromList [('a', 2), ('b', 2)], fromList [('a', 1), ('b', 3)]) == Concurrent
A vector clock is, conceptually, an associative list sorted by the value of the key, where each key appears only once.
field VectorClock<A> Empty = new(Seq<(A, long)>()) Source #
method int GetHashCode () Source #
method VectorClock<A> fromList (Seq<(A x, long y)> list) Source #
Insert each entry in the list one at a time.
method Seq<(A x, long y)> ToSeq () Source #
All the entries in the vector clock. Note that this is /not/ the inverse of 'fromList'
method (Option<long> Value, VectorClock<A> Clock) Extract (A index) Source #
Lookup the value for a key in the vector clock and remove the corresponding entry
method VectorClock<A> combine ( Func<A, Option<long>, Option<long>, Option<long>> f, VectorClock<A> vc1, VectorClock<A> vc2) Source #
Combine two vector clocks entry-by-entry
param | f | a function that takes the /key/, the value of the entry in the left hand vector clock, if it exists, the value in the right hand vector clock, if it exists, and, if it wishes to keep a value for this /key/ in the resulting vector clock, returns it. |
param | vc1 | the left hand vector clock |
param | vc2 | he right hand vector clock |
returns |
method VectorClock<A> max (VectorClock<A> vc1, VectorClock<A> vc2) Source #
The maximum of the two vector clocks.
method Relation relation (VectorClock<A> vc1, VectorClock<A> vc2) Source #
The relation between the two vector clocks.
method bool Causes (VectorClock<A> vc2) Source #
Short-hand for relation(vc1, vc2) == Relation.Causes
method bool causes (VectorClock<A> vc1, VectorClock<A> vc2) Source #
Short-hand for relation(vc1, vc2) == Relation.Causes
class VectorClock Source #
To create a vector clock, start from Empty
or Single
and Insert
elements into it. As a shortcut, fromList
just inserts all the
elements in a list, in order.
var vc = VectorClock<char>.Empty;
vc = vc.Insert('a', 1);
vc = vc.Insert('b', 2);
vc == VectorClock<char>.fromList(Seq(('a', 1), ('b', 2)))
Note that, for different keys, the order of insertion does not matter:
fromList(Seq(('a', 1), ('b', 2)) == fromList(Seq(('b', 2), ('a', 1))
Once you have a given vector clock, you can 'lookup' its fields, check that keys are 'member's, or convert it back 'toList' form.
vc.Lookup('a') == Some(1)
vc.Lookup('c') == None
The main operations that you would do with a vector clock are to increment the entry corresponding to the current process and to update the process's vector clock with the 'max' of its and the received message's clocks.
vc.Inc('a') == Some [('a', 2), ('b', 2)]
VectorClock.max( [('a', 1), ('b', 2)], [('c', 3), ('b', 1)] ) == [('a', 1), ('b', 2), ('c' 3)]
Finally, upon receiving different messages, you may wish to discover the relationship, if any, between them. This information could be useful in determining the correct order to process the messages.
VectorClock.relation (fromList [('a', 1), ('b', 2)], fromList [('a', 2), ('b', 2)]) == Causes
VectorClock.relation (fromList [('a', 2), ('b', 2)], fromList [('a', 1), ('b', 2)]) == CausedBy
VectorClock.relation (fromList [('a', 2), ('b', 2)], fromList [('a', 1), ('b', 3)]) == Concurrent
A vector clock is, conceptually, an associative list sorted by the value of the key, where each key appears only once.
method VectorClock<A> Single <A> (A x, long y) Source #
A vector clock with a single element
method VectorClock<OrdA, NumB, A, B> Single <OrdA, NumB, A, B> (A x, B y) Source #
A vector clock with a single element
method VectorClock<A> fromList <A> (Seq<(A x, long y)> list) Source #
Insert each entry in the list one at a time.
method VectorClock<OrdA, NumB, A, B> fromList <OrdA, NumB, A, B> (Seq<(A x, B y)> list) Source #
Insert each entry in the list one at a time.
method VectorClock<A> combine <A> ( Func<A, Option<long>, Option<long>, Option<long>> f, VectorClock<A> vc1, VectorClock<A> vc2) Source #
Combine two vector clocks entry-by-entry
param | f | a function that takes the /key/, the value of the entry in the left hand vector clock, if it exists, the value in the right hand vector clock, if it exists, and, if it wishes to keep a value for this /key/ in the resulting vector clock, returns it. |
param | vc1 | the left hand vector clock |
param | vc2 | he right hand vector clock |
returns |
method VectorClock<OrdA, NumB, A, B> combine <OrdA, NumB, A, B> ( Func<A, Option<B>, Option<B>, Option<B>> f, VectorClock<OrdA, NumB, A, B> vc1, VectorClock<OrdA, NumB, A, B> vc2) Source #
Combine two vector clocks entry-by-entry
param | f | a function that takes the /key/, the value of the entry in the left hand vector clock, if it exists, the value in the right hand vector clock, if it exists, and, if it wishes to keep a value for this /key/ in the resulting vector clock, returns it. |
param | vc1 | the left hand vector clock |
param | vc2 | he right hand vector clock |
returns |
method VectorClock<A> max <A> (VectorClock<A> vc1, VectorClock<A> vc2) Source #
The maximum of the two vector clocks.
method VectorClock<OrdA, NumB, A, B> max <OrdA, NumB, A, B> (VectorClock<OrdA, NumB, A, B> vc1, VectorClock<OrdA, NumB, A, B> vc2) Source #
The maximum of the two vector clocks.
method Relation relation <A> (VectorClock<A> vc1, VectorClock<A> vc2) Source #
The relation between the two vector clocks.
method Relation relation <OrdA, NumB, A, B> (VectorClock<OrdA, NumB, A, B> vc1, VectorClock<OrdA, NumB, A, B> vc2) Source #
The relation between the two vector clocks.
method bool causes <A> (VectorClock<A> vc1, VectorClock<A> vc2) Source #
Short-hand for relation(vc1, vc2) == Relation.Causes
method bool causes <OrdA, NumB, A, B> (VectorClock<OrdA, NumB, A, B>vc1, VectorClock<OrdA, NumB, A, B> vc2) Source #
Short-hand for relation(vc1, vc2) == Relation.Causes
record VectorClock <OrdA, NumB, A, B> (Seq<(A, B)> Entries) Source #
To create a vector clock, start from Empty
or Single
and Insert
elements into it. As a shortcut, fromList
just inserts all the
elements in a list, in order.
var vc = VectorClock<char>.Empty;
vc = vc.Insert('a', 1);
vc = vc.Insert('b', 2);
vc == VectorClock<char>.fromList(Seq(('a', 1), ('b', 2)))
Note that, for different keys, the order of insertion does not matter:
fromList(Seq(('a', 1), ('b', 2)) == fromList(Seq(('b', 2), ('a', 1))
Once you have a given vector clock, you can 'lookup' its fields, check that keys are 'member's, or convert it back 'toList' form.
vc.Lookup('a') == Some(1)
vc.Lookup('c') == None
The main operations that you would do with a vector clock are to increment the entry corresponding to the current process and to update the process's vector clock with the 'max' of its and the received message's clocks.
vc.Inc('a') == Some [('a', 2), ('b', 2)]
VectorClock.max( [('a', 1), ('b', 2)], [('c', 3), ('b', 1)] ) == [('a', 1), ('b', 2), ('c' 3)]
Finally, upon receiving different messages, you may wish to discover the relationship, if any, between them. This information could be useful in determining the correct order to process the messages.
VectorClock.relation (fromList [('a', 1), ('b', 2)], fromList [('a', 2), ('b', 2)]) == Causes
VectorClock.relation (fromList [('a', 2), ('b', 2)], fromList [('a', 1), ('b', 2)]) == CausedBy
VectorClock.relation (fromList [('a', 2), ('b', 2)], fromList [('a', 1), ('b', 3)]) == Concurrent
A vector clock is, conceptually, an associative list sorted by the value of the key, where each key appears only once.
field VectorClock<OrdA, NumB, A, B> Empty = new(Seq<(A, B)>()) Source #
Empty vector clock
method int GetHashCode () Source #
method VectorClock<OrdA, NumB, A, B> Single (A x, B y) Source #
A vector clock with a single element
method VectorClock<OrdA, NumB, A, B> fromList (Seq<(A x, B y)> list) Source #
Insert each entry in the list one at a time.
method Seq<(A x, B y)> ToList () Source #
All the entries in the vector clock. Note that this is /not/ the inverse of 'fromList'
method (Option<B> Value, VectorClock<OrdA, NumB, A, B> Clock) Extract (A index) Source #
Lookup the value for a key in the vector clock and remove the corresponding entry
method VectorClock<OrdA, NumB, A, B> Insert (A index, B value) Source #
Insert or replace the entry for a key.
method Option<VectorClock<OrdA, NumB, A, B>> Inc (A index) Source #
Increment the entry for a key by 1
method VectorClock<OrdA, NumB, A, B> Inc (A index, B defaultValue) Source #
Increment the entry for a key by 1
method VectorClock<OrdA, NumB, A, B> combine ( Func<A, Option<B>, Option<B>, Option<B>> f, VectorClock<OrdA, NumB, A, B> vc1, VectorClock<OrdA, NumB, A, B> vc2) Source #
Combine two vector clocks entry-by-entry
param | f | a function that takes the /key/, the value of the entry in the left hand vector clock, if it exists, the value in the right hand vector clock, if it exists, and, if it wishes to keep a value for this /key/ in the resulting vector clock, returns it. |
param | vc1 | the left hand vector clock |
param | vc2 | he right hand vector clock |
returns |
method VectorClock<OrdA, NumB, A, B> max (VectorClock<OrdA, NumB, A, B> vc1, VectorClock<OrdA, NumB, A, B> vc2) Source #
The maximum of the two vector clocks.
method Relation Relation (VectorClock<OrdA, NumB, A, B> vc1, VectorClock<OrdA, NumB, A, B> vc2) Source #
The relation between the two vector clocks.
method Relation relation (VectorClock<OrdA, NumB, A, B> vc1, VectorClock<OrdA, NumB, A, B> vc2) Source #
The relation between the two vector clocks.
method bool Causes (VectorClock<OrdA, NumB, A, B> vc2) Source #
Short-hand for relation(vc1, vc2) == Relation.Causes
method bool causes (VectorClock<OrdA, NumB, A, B> vc1, VectorClock<OrdA, NumB, A, B> vc2) Source #
Short-hand for relation(vc1, vc2) == Relation.Causes