Class VersionVector
Representation of a Vector-based clock (counting clock), inspired by Lamport logical clocks.
Based on code from VectorClock.
This class is immutable, i.e. "modifying" methods return a new instance.
Inheritance
VersionVector
Assembly: Akka.DistributedData.dll
Syntax
[Serializable]
public abstract class VersionVector : IReplicatedDataSerialization, IRemovedNodePruning<VersionVector>, IRemovedNodePruning, IReplicatedData<VersionVector>, IReplicatedData, IEquatable<VersionVector>
Fields
|
Edit this page
View Source
Counter
Declaration
protected static readonly AtomicCounterLong Counter
Field Value
|
Edit this page
View Source
Empty
Declaration
public static readonly VersionVector Empty
Field Value
Properties
|
Edit this page
View Source
Count
Declaration
public abstract int Count { get; }
Property Value
|
Edit this page
View Source
IsEmpty
Declaration
public abstract bool IsEmpty { get; }
Property Value
|
Edit this page
View Source
ModifiedByNodes
The nodes that have changed the state for this data
and would need pruning when such node is no longer part
of the cluster.
Declaration
public abstract ImmutableHashSet<UniqueAddress> ModifiedByNodes { get; }
Property Value
|
Edit this page
View Source
VersionEnumerator
Declaration
public abstract IEnumerator<KeyValuePair<UniqueAddress, long>> VersionEnumerator { get; }
Property Value
Methods
|
Edit this page
View Source
Compare(VersionVector)
Compare two version vectors. The outcome will be one of the following:
Version 1 is SAME (==) as Version 2 iff for all i c1(i) == c2(i)
Version 1 is BEFORE (<) Version 2 iff for all i c1(i) <= c2(i) and there exist a j such that c1(j) < c2(j)
Version 1 is AFTER (>) Version 2 iff for all i c1(i) >= c2(i) and there exist a j such that c1(j) > c2(j)
Version 1 is CONCURRENT to Version 2 otherwise
Declaration
public VersionVector.Ordering Compare(VersionVector other)
Parameters
Returns
|
Edit this page
View Source
Contains(UniqueAddress)
Declaration
public abstract bool Contains(UniqueAddress node)
Parameters
Returns
|
Edit this page
View Source
Create(UniqueAddress, long)
Declaration
public static VersionVector Create(UniqueAddress node, long version)
Parameters
Returns
|
Edit this page
View Source
Create(ImmutableDictionary<UniqueAddress, long>)
Declaration
public static VersionVector Create(ImmutableDictionary<UniqueAddress, long> versions)
Parameters
Returns
|
Edit this page
View Source
Equals(VersionVector)
Declaration
public bool Equals(VersionVector other)
Parameters
Returns
|
Edit this page
View Source
Equals(object)
Declaration
public override bool Equals(object obj)
Parameters
Type |
Name |
Description |
object |
obj |
|
Returns
Overrides
|
Edit this page
View Source
Increment(UniqueAddress)
Increment the version for the node passed as argument. Returns a new VersionVector.
Declaration
public abstract VersionVector Increment(UniqueAddress node)
Parameters
Returns
|
Edit this page
View Source
IsAfter(VersionVector)
Declaration
public bool IsAfter(VersionVector y)
Parameters
Returns
|
Edit this page
View Source
IsBefore(VersionVector)
Declaration
public bool IsBefore(VersionVector y)
Parameters
Returns
|
Edit this page
View Source
IsConcurrent(VersionVector)
Declaration
public bool IsConcurrent(VersionVector y)
Parameters
Returns
|
Edit this page
View Source
IsSame(VersionVector)
Returns true if this VersionVector has the same history
as the y
VersionVector else false.
Declaration
public bool IsSame(VersionVector y)
Parameters
Returns
|
Edit this page
View Source
Merge(IReplicatedData)
Declaration
public IReplicatedData Merge(IReplicatedData other)
Parameters
Returns
|
Edit this page
View Source
Merge(VersionVector)
Merges this VersionVector with another VersionVector. E.g. merges its versioned history.
Declaration
public abstract VersionVector Merge(VersionVector other)
Parameters
Returns
|
Edit this page
View Source
NeedPruningFrom(UniqueAddress)
Does it have any state changes from a specific node,
which has been removed from the cluster.
Declaration
public abstract bool NeedPruningFrom(UniqueAddress removedNode)
Parameters
Returns
|
Edit this page
View Source
Prune(UniqueAddress, UniqueAddress)
When the removedNode
node has been removed from the cluster the state
changes from that node will be pruned by collapsing the data entries
to another node.
Declaration
public abstract VersionVector Prune(UniqueAddress removedNode, UniqueAddress collapseInto)
Parameters
Returns
|
Edit this page
View Source
PruningCleanup(UniqueAddress)
Remove data entries from a node that has been removed from the cluster
and already been pruned.
Declaration
public abstract VersionVector PruningCleanup(UniqueAddress removedNode)
Parameters
Returns
|
Edit this page
View Source
VersionAt(UniqueAddress)
Declaration
public abstract long VersionAt(UniqueAddress node)
Parameters
Returns
Operators
|
Edit this page
View Source
operator ==(VersionVector, VersionVector)
Declaration
public static bool operator ==(VersionVector x, VersionVector y)
Parameters
Returns
|
Edit this page
View Source
operator >(VersionVector, VersionVector)
Returns true if x
is after y
else false.
Declaration
public static bool operator >(VersionVector x, VersionVector y)
Parameters
Returns
|
Edit this page
View Source
operator !=(VersionVector, VersionVector)
Returns true if x
VersionVector has other
history than the y
VersionVector else false.
Declaration
public static bool operator !=(VersionVector x, VersionVector y)
Parameters
Returns
|
Edit this page
View Source
operator <(VersionVector, VersionVector)
Returns true if x
is before y
else false.
Declaration
public static bool operator <(VersionVector x, VersionVector y)
Parameters
Returns
Implements
Extension Methods