public abstract class VersionVector
extends java.lang.Object
implements scala.Serializable
Reference:
1) Leslie Lamport (1978). "Time, clocks, and the ordering of events in a distributed system". Communications of the ACM 21 (7): 558-565.
2) Friedemann Mattern (1988). "Virtual Time and Global States of Distributed Systems". Workshop on Parallel and Distributed Algorithms: pp. 215-226
Based on akka.cluster.ddata.VersionVector.
This class is immutable, i.e. "modifying" methods return a new instance.
| Modifier and Type | Class and Description |
|---|---|
static class |
VersionVector.After$ |
static class |
VersionVector.Before$ |
static class |
VersionVector.Concurrent$ |
static interface |
VersionVector.Ordering |
static class |
VersionVector.Same$ |
static class |
VersionVector.Timestamp$
INTERNAL API
|
| Constructor and Description |
|---|
VersionVector() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
$eq$eq(VersionVector that)
Returns true if this VersionVector has the same history as the 'that' VersionVector else false.
|
boolean |
$greater(VersionVector that)
Returns true if
this is after that else false. |
boolean |
$less(VersionVector that)
Returns true if
this is before that else false. |
boolean |
$less$greater(VersionVector that)
Returns true if
this and that are concurrent else false. |
VersionVector |
$plus(java.lang.String key)
Increment the version for the key passed as argument.
|
static VersionVector.After$ |
AfterInstance()
Java API: The
VersionVector.After instance |
static VersionVector |
apply() |
static VersionVector |
apply(scala.collection.immutable.List<scala.Tuple2<java.lang.String,java.lang.Object>> versions)
INTERNAL API
|
static VersionVector |
apply(java.lang.String key,
long version) |
static VersionVector |
apply(scala.collection.immutable.TreeMap<java.lang.String,java.lang.Object> versions) |
static VersionVector.Before$ |
BeforeInstance()
Java API: The
VersionVector.Before instance |
VersionVector.Ordering |
compareTo(VersionVector that)
Compare two version vectors.
|
static VersionVector.Concurrent$ |
ConcurrentInstance()
Java API: The
VersionVector.Concurrent instance |
abstract boolean |
contains(java.lang.String key)
INTERNAL API
|
static VersionVector |
create()
Java API
|
static VersionVector |
empty() |
abstract VersionVector |
increment(java.lang.String key)
Increment the version for the key passed as argument.
|
abstract boolean |
isEmpty() |
abstract VersionVector |
merge(VersionVector that) |
static VersionVector.Same$ |
SameInstance()
Java API: The
VersionVector.Same instance |
abstract int |
size()
INTERNAL API
|
abstract VersionVector |
updated(java.lang.String key,
long version) |
abstract long |
versionAt(java.lang.String key) |
abstract scala.collection.Iterator<scala.Tuple2<java.lang.String,java.lang.Object>> |
versionsIterator()
INTERNAL API
|
public static VersionVector empty()
public static VersionVector apply()
public static VersionVector apply(scala.collection.immutable.TreeMap<java.lang.String,java.lang.Object> versions)
public static VersionVector apply(java.lang.String key, long version)
public static VersionVector apply(scala.collection.immutable.List<scala.Tuple2<java.lang.String,java.lang.Object>> versions)
public static VersionVector create()
public static VersionVector.After$ AfterInstance()
VersionVector.After instancepublic static VersionVector.Before$ BeforeInstance()
VersionVector.Before instancepublic static VersionVector.Same$ SameInstance()
VersionVector.Same instancepublic static VersionVector.Concurrent$ ConcurrentInstance()
VersionVector.Concurrent instancepublic VersionVector $plus(java.lang.String key)
key - (undocumented)public abstract VersionVector increment(java.lang.String key)
key - (undocumented)public abstract VersionVector updated(java.lang.String key, long version)
public abstract boolean isEmpty()
public abstract int size()
public abstract long versionAt(java.lang.String key)
public abstract boolean contains(java.lang.String key)
key - (undocumented)public boolean $less$greater(VersionVector that)
this and that are concurrent else false.that - (undocumented)public boolean $less(VersionVector that)
this is before that else false.that - (undocumented)public boolean $greater(VersionVector that)
this is after that else false.that - (undocumented)public boolean $eq$eq(VersionVector that)
that - (undocumented)public abstract scala.collection.Iterator<scala.Tuple2<java.lang.String,java.lang.Object>> versionsIterator()
public VersionVector.Ordering compareTo(VersionVector that)
1. Version 1 is SAME (==) as Version 2 iff for all i c1(i) == c2(i)
2. 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)
3. 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).
4. Version 1 is CONCURRENT (<>) to Version 2 otherwise.
that - (undocumented)public abstract VersionVector merge(VersionVector that)