Package akka.cluster.ddata
Class ORMultiMap<A,B>
- java.lang.Object
- 
- akka.cluster.ddata.ORMultiMap<A,B>
 
- 
- All Implemented Interfaces:
- DeltaReplicatedData,- RemovedNodePruning,- ReplicatedData,- ReplicatedDataSerialization,- java.io.Serializable
 
 public final class ORMultiMap<A,B> extends java.lang.Object implements DeltaReplicatedData, ReplicatedDataSerialization, RemovedNodePruning An immutable multi-map implementation. This class wraps anORMapwith anORSetfor the map's value.This class is immutable, i.e. "modifying" methods return a new instance. Note that on concurrent adds and removals for the same key (on the same set), removals can be lost. - See Also:
- Serialized Form
 
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description static classORMultiMap.ORMultiMapTag$INTERNAL APIstatic classORMultiMap.ORMultiMapWithValueDeltasTag$INTERNAL API
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ORMultiMap<java.lang.Object,java.lang.Object>_empty()static ORMultiMap<java.lang.Object,java.lang.Object>_emptyWithValueDeltas()ORMultiMap<A,B>$colon$plus(scala.Tuple2<A,scala.collection.immutable.Set<B>> entry, SelfUniqueAddress node)Convenience for put.ORMultiMap<A,B>addBinding(SelfUniqueAddress node, A key, B element)Add an element to a set associated with a key.ORMultiMap<A,B>addBindingBy(A key, B element, SelfUniqueAddress node)static ORMultiMap<java.lang.Object,java.lang.Object>apply()booleancontains(A key)static <A,B>
 ORMultiMap<A,B>create()Java APIscala.Option<ORMap.DeltaOp>delta()The accumulated delta of mutator operations since previousDeltaReplicatedData.resetDelta().static <A,B>
 ORMultiMap<A,B>empty()Provides an empty multimap.static <A,B>
 ORMultiMap<A,B>emptyWithValueDeltas()scala.collection.immutable.Map<A,scala.collection.immutable.Set<B>>entries()Scala API: All entries of a multimap where keys are strings and values are sets.booleanequals(java.lang.Object o)scala.Option<scala.collection.immutable.Set<B>>get(A key)Get the set associated with the key if there is one.java.util.Map<A,java.util.Set<B>>getEntries()Java API: All entries of a multimap where keys are strings and values are sets.scala.collection.immutable.Set<B>getOrElse(A key, scala.Function0<scala.collection.immutable.Set<B>> default_)Scala API: Get the set associated with the key if there is one, else return the given default.inthashCode()booleanisEmpty()ORMultiMap<A,B>merge(ORMultiMap<A,B> that)ORMultiMap<A,B>mergeDelta(ORMap.DeltaOp thatDelta)scala.collection.immutable.Set<UniqueAddress>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.booleanneedPruningFrom(UniqueAddress removedNode)Does it have any state changes from a specific node, which has been removed from the cluster.ORMultiMap<A,B>prune(UniqueAddress removedNode, UniqueAddress collapseInto)When theremovednode has been removed from the cluster the state changes from that node will be pruned by collapsing the data entries to another node.ORMultiMap<A,B>pruningCleanup(UniqueAddress removedNode)Remove data entries from a node that has been removed from the cluster and already been pruned.ORMultiMap<A,B>put(SelfUniqueAddress node, A key, java.util.Set<B> value)Java API: Associate an entire set with the key while retaining the history of the previous replicated data set.ORMultiMap<A,B>put(SelfUniqueAddress node, A key, scala.collection.immutable.Set<B> value)Scala API: Associate an entire set with the key while retaining the history of the previous replicated data set.ORMultiMap<A,B>remove(SelfUniqueAddress node, A key)Java API Remove an entire set associated with the key.ORMultiMap<A,B>remove(A key, SelfUniqueAddress node)Scala API Remove an entire set associated with the key.ORMultiMap<A,B>removeBinding(SelfUniqueAddress node, A key, B element)Remove an element of a set associated with a key.ORMultiMap<A,B>removeBindingBy(A key, B element, SelfUniqueAddress node)ORMultiMap<A,B>replaceBinding(SelfUniqueAddress node, A key, B oldElement, B newElement)Replace an element of a set associated with a key with a new one if it is different.ORMultiMap<A,B>replaceBindingBy(A key, B oldElement, B newElement, SelfUniqueAddress node)ORMultiMap<A,B>resetDelta()Reset collection of deltas from mutator operations.intsize()java.lang.StringtoString()static <A,B>
 scala.Option<scala.collection.immutable.Map<A,scala.collection.immutable.Set<B>>>unapply(ORMultiMap<A,B> m)Extract theentries().static <A,B extends ReplicatedData>
 scala.Option<scala.collection.immutable.Map<A,scala.collection.immutable.Set<B>>>unapply(java.lang.Object value)Extract theentries()of anORMultiMap.- 
Methods inherited from class java.lang.Objectclone, finalize, getClass, notify, notifyAll, wait, wait, wait
 - 
Methods inherited from interface akka.cluster.ddata.DeltaReplicatedDatamergeDelta
 - 
Methods inherited from interface akka.cluster.ddata.ReplicatedDatamerge
 
- 
 
- 
- 
- 
Method Detail- 
_emptypublic static ORMultiMap<java.lang.Object,java.lang.Object> _empty() 
 - 
_emptyWithValueDeltaspublic static ORMultiMap<java.lang.Object,java.lang.Object> _emptyWithValueDeltas() 
 - 
emptypublic static <A,B> ORMultiMap<A,B> empty() Provides an empty multimap.
 - 
emptyWithValueDeltaspublic static <A,B> ORMultiMap<A,B> emptyWithValueDeltas() 
 - 
applypublic static ORMultiMap<java.lang.Object,java.lang.Object> apply() 
 - 
createpublic static <A,B> ORMultiMap<A,B> create() Java API
 - 
unapplypublic static <A,B> scala.Option<scala.collection.immutable.Map<A,scala.collection.immutable.Set<B>>> unapply(ORMultiMap<A,B> m) Extract theentries().
 - 
unapplypublic static <A,B extends ReplicatedData> scala.Option<scala.collection.immutable.Map<A,scala.collection.immutable.Set<B>>> unapply(java.lang.Object value) Extract theentries()of anORMultiMap.
 - 
mergepublic ORMultiMap<A,B> merge(ORMultiMap<A,B> that) 
 - 
entriespublic scala.collection.immutable.Map<A,scala.collection.immutable.Set<B>> entries() Scala API: All entries of a multimap where keys are strings and values are sets.
 - 
getEntriespublic java.util.Map<A,java.util.Set<B>> getEntries() Java API: All entries of a multimap where keys are strings and values are sets.
 - 
getpublic scala.Option<scala.collection.immutable.Set<B>> get(A key) Get the set associated with the key if there is one.
 - 
getOrElsepublic scala.collection.immutable.Set<B> getOrElse(A key, scala.Function0<scala.collection.immutable.Set<B>> default_) Scala API: Get the set associated with the key if there is one, else return the given default.
 - 
containspublic boolean contains(A key) 
 - 
isEmptypublic boolean isEmpty() 
 - 
sizepublic int size() 
 - 
$colon$pluspublic ORMultiMap<A,B> $colon$plus(scala.Tuple2<A,scala.collection.immutable.Set<B>> entry, SelfUniqueAddress node) Convenience for put. Requires an implicit SelfUniqueAddress.
 - 
putpublic ORMultiMap<A,B> put(SelfUniqueAddress node, A key, scala.collection.immutable.Set<B> value) Scala API: Associate an entire set with the key while retaining the history of the previous replicated data set.
 - 
putpublic ORMultiMap<A,B> put(SelfUniqueAddress node, A key, java.util.Set<B> value) Java API: Associate an entire set with the key while retaining the history of the previous replicated data set.
 - 
removepublic ORMultiMap<A,B> remove(A key, SelfUniqueAddress node) Scala API Remove an entire set associated with the key.
 - 
removepublic ORMultiMap<A,B> remove(SelfUniqueAddress node, A key) Java API Remove an entire set associated with the key.
 - 
addBindingpublic ORMultiMap<A,B> addBinding(SelfUniqueAddress node, A key, B element) Add an element to a set associated with a key. If there is no existing set then one will be initialised. TODO add implicit after deprecated is EOL.
 - 
addBindingBypublic ORMultiMap<A,B> addBindingBy(A key, B element, SelfUniqueAddress node) 
 - 
removeBindingpublic ORMultiMap<A,B> removeBinding(SelfUniqueAddress node, A key, B element) Remove an element of a set associated with a key. If there are no more elements in the set then the entire set will be removed. TODO add implicit after deprecated is EOL.
 - 
removeBindingBypublic ORMultiMap<A,B> removeBindingBy(A key, B element, SelfUniqueAddress node) 
 - 
replaceBindingpublic ORMultiMap<A,B> replaceBinding(SelfUniqueAddress node, A key, B oldElement, B newElement) Replace an element of a set associated with a key with a new one if it is different. This is useful when an element is removed and another one is added within the same Update. The order of addition and removal is important in order to retain history for replicated data.
 - 
replaceBindingBypublic ORMultiMap<A,B> replaceBindingBy(A key, B oldElement, B newElement, SelfUniqueAddress node) 
 - 
resetDeltapublic ORMultiMap<A,B> resetDelta() Description copied from interface:DeltaReplicatedDataReset collection of deltas from mutator operations. When theReplicatorinvokes themodifyfunction of theUpdatemessage 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 theReplicatorwith theDeltaReplicatedData.delta()accessor. When theReplicatorhas grabbed thedeltait will invoke this method to get a clean data instance without the delta.- Specified by:
- resetDeltain interface- DeltaReplicatedData
 
 - 
deltapublic scala.Option<ORMap.DeltaOp> delta() Description copied from interface:DeltaReplicatedDataThe accumulated delta of mutator operations since previousDeltaReplicatedData.resetDelta(). When theReplicatorinvokes themodifyfunction of theUpdatemessage 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 theReplicatorwith theDeltaReplicatedData.delta()accessor. Themodifyfunction shall still return the full state in the same way asReplicatedDatawithout support for deltas.- Specified by:
- deltain interface- DeltaReplicatedData
 
 - 
mergeDeltapublic ORMultiMap<A,B> mergeDelta(ORMap.DeltaOp thatDelta) 
 - 
modifiedByNodespublic scala.collection.immutable.Set<UniqueAddress> modifiedByNodes() Description copied from interface:RemovedNodePruningThe nodes that have changed the state for this data and would need pruning when such node is no longer part of the cluster.- Specified by:
- modifiedByNodesin interface- RemovedNodePruning
 
 - 
needPruningFrompublic boolean needPruningFrom(UniqueAddress removedNode) Description copied from interface:RemovedNodePruningDoes it have any state changes from a specific node, which has been removed from the cluster.- Specified by:
- needPruningFromin interface- RemovedNodePruning
 
 - 
pruningCleanuppublic ORMultiMap<A,B> pruningCleanup(UniqueAddress removedNode) Description copied from interface:RemovedNodePruningRemove data entries from a node that has been removed from the cluster and already been pruned.- Specified by:
- pruningCleanupin interface- RemovedNodePruning
 
 - 
prunepublic ORMultiMap<A,B> prune(UniqueAddress removedNode, UniqueAddress collapseInto) Description copied from interface:RemovedNodePruningWhen theremovednode 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:
- prunein interface- RemovedNodePruning
 
 - 
toStringpublic java.lang.String toString() - Overrides:
- toStringin class- java.lang.Object
 
 - 
equalspublic boolean equals(java.lang.Object o) - Overrides:
- equalsin class- java.lang.Object
 
 - 
hashCodepublic int hashCode() - Overrides:
- hashCodein class- java.lang.Object
 
 
- 
 
-