Package akka.cluster.ddata
Class GSet<A>
- java.lang.Object
-
- akka.cluster.ddata.GSet<A>
-
- All Implemented Interfaces:
DeltaReplicatedData
,FastMerge
,ReplicatedData
,ReplicatedDataSerialization
,ReplicatedDelta
,java.io.Serializable
,scala.Equals
,scala.Product
public final class GSet<A> extends java.lang.Object implements DeltaReplicatedData, ReplicatedDelta, ReplicatedDataSerialization, FastMerge, scala.Product, java.io.Serializable
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description GSet()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description GSet<A>
$plus(A element)
Adds an element to the setGSet<A>
add(A element)
Adds an element to the setstatic GSet<java.lang.Object>
apply()
static <A> GSet<A>
apply(scala.collection.immutable.Set<A> elements, scala.Option<GSet<A>> delta)
Implements a 'Add Set' CRDT, also called a 'G-Set'.boolean
canEqual(java.lang.Object x$1)
boolean
contains(A a)
GSet<A>
copy(scala.collection.immutable.Set<A> e)
static <A> GSet<A>
create()
Java APIscala.Option<GSet<A>>
delta()
The accumulated delta of mutator operations since previousDeltaReplicatedData.resetDelta()
.scala.collection.immutable.Set<A>
elements()
static <A> GSet<A>
empty()
boolean
equals(java.lang.Object x$1)
java.util.Set<A>
getElements()
Java APIint
hashCode()
boolean
isEmpty()
GSet<A>
merge(GSet<A> that)
GSet<A>
mergeDelta(GSet<A> thatDelta)
int
productArity()
java.lang.Object
productElement(int x$1)
java.lang.String
productElementName(int x$1)
scala.collection.Iterator<java.lang.Object>
productIterator()
java.lang.String
productPrefix()
GSet<A>
resetDelta()
Reset collection of deltas from mutator operations.int
size()
java.lang.String
toString()
static <A> scala.Option<scala.collection.immutable.Set<A>>
unapply(GSet<A> x$0)
GSet<A>
zero()
The empty full state.-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface akka.cluster.ddata.DeltaReplicatedData
mergeDelta
-
Methods inherited from interface akka.cluster.ddata.FastMerge
ancestor_$eq, assignAncestor, clearAncestor, isAncestorOf
-
Methods inherited from interface akka.cluster.ddata.ReplicatedData
merge
-
-
-
-
Method Detail
-
empty
public static <A> GSet<A> empty()
-
apply
public static GSet<java.lang.Object> apply()
-
create
public static <A> GSet<A> create()
Java API
-
apply
public static <A> GSet<A> apply(scala.collection.immutable.Set<A> elements, scala.Option<GSet<A>> delta)
Implements a 'Add Set' CRDT, also called a 'G-Set'. You can't remove elements of a G-Set.It is described in the paper A comprehensive study of Convergent and Commutative Replicated Data Types.
A G-Set doesn't accumulate any garbage apart from the elements themselves.
This class is immutable, i.e. "modifying" methods return a new instance.
-
unapply
public static <A> scala.Option<scala.collection.immutable.Set<A>> unapply(GSet<A> x$0)
-
elements
public scala.collection.immutable.Set<A> elements()
-
delta
public scala.Option<GSet<A>> delta()
Description copied from interface:DeltaReplicatedData
The accumulated delta of mutator operations since previousDeltaReplicatedData.resetDelta()
. When theReplicator
invokes themodify
function of theUpdate
message and the user code is invoking one or more mutator operations the data is collecting the delta of the operations and makes it available for theReplicator
with theDeltaReplicatedData.delta()
accessor. Themodify
function shall still return the full state in the same way asReplicatedData
without support for deltas.- Specified by:
delta
in interfaceDeltaReplicatedData
-
getElements
public java.util.Set<A> getElements()
Java API
-
contains
public boolean contains(A a)
-
isEmpty
public boolean isEmpty()
-
size
public int size()
-
zero
public GSet<A> zero()
Description copied from interface:ReplicatedDelta
The empty full state. This is used when a delta is received and no existing full state exists on the receiving side. Then the delta is merged into thezero
to create the initial full state.- Specified by:
zero
in interfaceReplicatedDelta
-
resetDelta
public GSet<A> resetDelta()
Description copied from interface:DeltaReplicatedData
Reset collection of deltas from mutator operations. When theReplicator
invokes themodify
function of theUpdate
message the delta is always "reset" and when the user code is invoking one or more mutator operations the data is collecting the delta of the operations and makes it available for theReplicator
with theDeltaReplicatedData.delta()
accessor. When theReplicator
has grabbed thedelta
it will invoke this method to get a clean data instance without the delta.- Specified by:
resetDelta
in interfaceDeltaReplicatedData
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
productPrefix
public java.lang.String productPrefix()
- Specified by:
productPrefix
in interfacescala.Product
-
productArity
public int productArity()
- Specified by:
productArity
in interfacescala.Product
-
productElement
public java.lang.Object productElement(int x$1)
- Specified by:
productElement
in interfacescala.Product
-
productIterator
public scala.collection.Iterator<java.lang.Object> productIterator()
- Specified by:
productIterator
in interfacescala.Product
-
canEqual
public boolean canEqual(java.lang.Object x$1)
- Specified by:
canEqual
in interfacescala.Equals
-
productElementName
public java.lang.String productElementName(int x$1)
- Specified by:
productElementName
in interfacescala.Product
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object x$1)
- Specified by:
equals
in interfacescala.Equals
- Overrides:
equals
in classjava.lang.Object
-
-