Package akka.cluster.ddata
Class VersionVector
- java.lang.Object
-
- akka.cluster.ddata.VersionVector
-
- All Implemented Interfaces:
RemovedNodePruning
,ReplicatedData
,ReplicatedDataSerialization
,java.io.Serializable
,scala.Serializable
- Direct Known Subclasses:
ManyVersionVector
,OneVersionVector
public abstract class VersionVector extends java.lang.Object implements ReplicatedData, ReplicatedDataSerialization, RemovedNodePruning
Increment the version for the node passed as argument. Returns a new VersionVector.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class 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 Summary
Constructors Constructor Description VersionVector()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description VersionVector
$colon$plus(SelfUniqueAddress node)
Increment the version for the node passed as argument.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 ifthis
is afterthat
else false.boolean
$less(VersionVector that)
Returns true ifthis
is beforethat
else false.boolean
$less$greater(VersionVector that)
Returns true ifthis
andthat
are concurrent else false.VersionVector
$plus(Cluster node)
Deprecated.Use `:+` that takes a `SelfUniqueAddress` parameter instead.VersionVector
$plus(UniqueAddress node)
INTERNAL API Increment the version for the node passed as argument.static VersionVector.After$
AfterInstance()
static VersionVector
apply()
static VersionVector
apply(UniqueAddress node, long version)
static VersionVector
apply(scala.collection.immutable.List<scala.Tuple2<UniqueAddress,java.lang.Object>> versions)
INTERNAL APIstatic VersionVector
apply(scala.collection.immutable.TreeMap<UniqueAddress,java.lang.Object> versions)
static VersionVector.Before$
BeforeInstance()
Java API: TheVersionVector.Before
instanceVersionVector.Ordering
compareTo(VersionVector that)
Compare two version vectors.static VersionVector.Concurrent$
ConcurrentInstance()
Java API: TheVersionVector.Concurrent
instanceabstract boolean
contains(UniqueAddress node)
INTERNAL APIstatic VersionVector
create()
Java APIstatic VersionVector
empty()
VersionVector
increment(Cluster node)
Deprecated.Use `increment` that takes a `SelfUniqueAddress` parameter instead.VersionVector
increment(SelfUniqueAddress node)
Increment the version for the node passed as argument.abstract VersionVector
increment(UniqueAddress node)
INTERNAL API Increment the version for the node passed as argument.abstract boolean
isEmpty()
abstract VersionVector
merge(VersionVector that)
Merges this VersionVector with another VersionVector.abstract boolean
needPruningFrom(UniqueAddress removedNode)
Does it have any state changes from a specific node, which has been removed from the cluster.abstract VersionVector
prune(UniqueAddress removedNode, UniqueAddress collapseInto)
When theremoved
node has been removed from the cluster the state changes from that node will be pruned by collapsing the data entries to another node.abstract VersionVector
pruningCleanup(UniqueAddress removedNode)
Remove data entries from a node that has been removed from the cluster and already been pruned.static VersionVector.Same$
SameInstance()
Java API: TheVersionVector.Same
instanceabstract int
size()
INTERNAL APIabstract long
versionAt(UniqueAddress node)
INTERNAL APIabstract scala.collection.Iterator<scala.Tuple2<UniqueAddress,java.lang.Object>>
versionsIterator()
INTERNAL API-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface akka.cluster.ddata.RemovedNodePruning
modifiedByNodes
-
Methods inherited from interface akka.cluster.ddata.ReplicatedData
merge
-
-
-
-
Method Detail
-
empty
public static VersionVector empty()
-
apply
public static VersionVector apply()
-
apply
public static VersionVector apply(scala.collection.immutable.TreeMap<UniqueAddress,java.lang.Object> versions)
-
apply
public static VersionVector apply(UniqueAddress node, long version)
-
apply
public static VersionVector apply(scala.collection.immutable.List<scala.Tuple2<UniqueAddress,java.lang.Object>> versions)
INTERNAL API
-
create
public static VersionVector create()
Java API- Returns:
- (undocumented)
-
AfterInstance
public static VersionVector.After$ AfterInstance()
-
BeforeInstance
public static VersionVector.Before$ BeforeInstance()
Java API: TheVersionVector.Before
instance- Returns:
- (undocumented)
-
SameInstance
public static VersionVector.Same$ SameInstance()
Java API: TheVersionVector.Same
instance- Returns:
- (undocumented)
-
ConcurrentInstance
public static VersionVector.Concurrent$ ConcurrentInstance()
Java API: TheVersionVector.Concurrent
instance- Returns:
- (undocumented)
-
$colon$plus
public VersionVector $colon$plus(SelfUniqueAddress node)
Increment the version for the node passed as argument. Returns a new VersionVector.- Parameters:
node
- (undocumented)- Returns:
- (undocumented)
-
$plus
public VersionVector $plus(Cluster node)
Deprecated.Use `:+` that takes a `SelfUniqueAddress` parameter instead. Since 2.5.20.
-
$plus
public VersionVector $plus(UniqueAddress node)
INTERNAL API Increment the version for the node passed as argument. Returns a new VersionVector.- Parameters:
node
- (undocumented)- Returns:
- (undocumented)
-
increment
public VersionVector increment(SelfUniqueAddress node)
Increment the version for the node passed as argument. Returns a new VersionVector.- Parameters:
node
- (undocumented)- Returns:
- (undocumented)
-
increment
public VersionVector increment(Cluster node)
Deprecated.Use `increment` that takes a `SelfUniqueAddress` parameter instead. Since 2.5.20.
-
isEmpty
public abstract boolean isEmpty()
-
size
public abstract int size()
INTERNAL API- Returns:
- (undocumented)
-
increment
public abstract VersionVector increment(UniqueAddress node)
INTERNAL API Increment the version for the node passed as argument. Returns a new VersionVector.- Parameters:
node
- (undocumented)- Returns:
- (undocumented)
-
versionAt
public abstract long versionAt(UniqueAddress node)
INTERNAL API- Parameters:
node
- (undocumented)- Returns:
- (undocumented)
-
contains
public abstract boolean contains(UniqueAddress node)
INTERNAL API- Parameters:
node
- (undocumented)- Returns:
- (undocumented)
-
$less$greater
public boolean $less$greater(VersionVector that)
Returns true ifthis
andthat
are concurrent else false.- Parameters:
that
- (undocumented)- Returns:
- (undocumented)
-
$less
public boolean $less(VersionVector that)
Returns true ifthis
is beforethat
else false.- Parameters:
that
- (undocumented)- Returns:
- (undocumented)
-
$greater
public boolean $greater(VersionVector that)
Returns true ifthis
is afterthat
else false.- Parameters:
that
- (undocumented)- Returns:
- (undocumented)
-
$eq$eq
public boolean $eq$eq(VersionVector that)
Returns true if this VersionVector has the same history as the 'that' VersionVector else false.- Parameters:
that
- (undocumented)- Returns:
- (undocumented)
-
versionsIterator
public abstract scala.collection.Iterator<scala.Tuple2<UniqueAddress,java.lang.Object>> versionsIterator()
INTERNAL API- Returns:
- (undocumented)
-
compareTo
public VersionVector.Ordering compareTo(VersionVector that)
Compare two version vectors. The outcome will be one of the following: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.
- Parameters:
that
- (undocumented)- Returns:
- (undocumented)
-
merge
public abstract VersionVector merge(VersionVector that)
Merges this VersionVector with another VersionVector. E.g. merges its versioned history.- Parameters:
that
- (undocumented)- Returns:
- (undocumented)
-
needPruningFrom
public abstract boolean needPruningFrom(UniqueAddress removedNode)
Description copied from interface:RemovedNodePruning
Does it have any state changes from a specific node, which has been removed from the cluster.- Specified by:
needPruningFrom
in interfaceRemovedNodePruning
- Parameters:
removedNode
- (undocumented)- Returns:
- (undocumented)
-
prune
public abstract VersionVector prune(UniqueAddress removedNode, UniqueAddress collapseInto)
Description copied from interface:RemovedNodePruning
When theremoved
node has been removed from the cluster the state changes from that node will be pruned by collapsing the data entries to another node.- Specified by:
prune
in interfaceRemovedNodePruning
- Parameters:
removedNode
- (undocumented)collapseInto
- (undocumented)- Returns:
- (undocumented)
-
pruningCleanup
public abstract VersionVector pruningCleanup(UniqueAddress removedNode)
Description copied from interface:RemovedNodePruning
Remove data entries from a node that has been removed from the cluster and already been pruned.- Specified by:
pruningCleanup
in interfaceRemovedNodePruning
- Parameters:
removedNode
- (undocumented)- Returns:
- (undocumented)
-
-