Package akka.cluster.ddata
Class ORMap<A,B extends ReplicatedData>
- java.lang.Object
- 
- akka.cluster.ddata.ORMap<A,B>
 
- 
- All Implemented Interfaces:
- DeltaReplicatedData,- RemovedNodePruning,- ReplicatedData,- ReplicatedDataSerialization,- java.io.Serializable
 
 public final class ORMap<A,B extends ReplicatedData> extends java.lang.Object implements DeltaReplicatedData, ReplicatedDataSerialization, RemovedNodePruning - See Also:
- Serialized Form
 
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description static classORMap.DeltaGroup$static interfaceORMap.DeltaOpstatic classORMap.PutDeltaOp$static classORMap.RemoveDeltaOp$static classORMap.RemoveKeyDeltaOp$static classORMap.UpdateDeltaOp$static classORMap.VanillaORMapTag$static interfaceORMap.ZeroTag
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description ORMap<A,B>$colon$plus(scala.Tuple2<A,B> entry, SelfUniqueAddress node)Adds an entry to the mapstatic ORMap<java.lang.Object,ReplicatedData>apply()booleancontains(A key)static <A,B extends ReplicatedData>
 ORMap<A,B>create()Java APIscala.Option<ORMap.DeltaOp>delta()The accumulated delta of mutator operations since previousDeltaReplicatedData.resetDelta().static <A,B extends ReplicatedData>
 ORMap<A,B>empty()scala.collection.immutable.Map<A,B>entries()Scala API: All entries of the map.booleanequals(java.lang.Object o)scala.Option<B>get(A key)java.util.Map<A,B>getEntries()Java API: All entries of the map.BgetOrElse(A key, scala.Function0<B> default_)Scala API: Get the value associated with the key if there is one, else return the given default.inthashCode()booleanisEmpty()ORMap<A,B>merge(ORMap<A,B> that)ORMap<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.ORMap<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.ORMap<A,B>pruningCleanup(UniqueAddress removedNode)Remove data entries from a node that has been removed from the cluster and already been pruned.ORMap<A,B>put(SelfUniqueAddress node, A key, B value)Adds an entry to the map.ORMap<A,B>remove(SelfUniqueAddress node, A key)Java API Removes an entry from the map.ORMap<A,B>remove(A key, SelfUniqueAddress node)Scala API Removes an entry from the map.ORMap<A,B>resetDelta()Reset collection of deltas from mutator operations.intsize()java.lang.StringtoString()static <A,B extends ReplicatedData>
 scala.Option<scala.collection.immutable.Map<A,B>>unapply(ORMap<A,B> m)Extract theentries().ORMap<A,B>update(SelfUniqueAddress node, A key, B initial, java.util.function.Function<B,B> modify)Java API: Replace a value by applying themodifyfunction on the existing value.ORMap<A,B>updated(Cluster node, A key, B initial, java.util.function.Function<B,B> modify)Deprecated.use update for the Java API as updated is ambiguous with the Scala API.ORMap<A,B>updated(SelfUniqueAddress node, A key, B initial, scala.Function1<B,B> modify)Scala API: Replace a value by applying themodifyfunction on the existing value.- 
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 <A,B extends ReplicatedData> ORMap<A,B> empty() 
 - 
applypublic static ORMap<java.lang.Object,ReplicatedData> apply() 
 - 
createpublic static <A,B extends ReplicatedData> ORMap<A,B> create() Java API
 - 
unapplypublic static <A,B extends ReplicatedData> scala.Option<scala.collection.immutable.Map<A,B>> unapply(ORMap<A,B> m) Extract theentries().
 - 
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
 
 - 
getOrElsepublic B getOrElse(A key, scala.Function0<B> default_) Scala API: Get the value 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 ORMap<A,B> $colon$plus(scala.Tuple2<A,B> entry, SelfUniqueAddress node) Adds an entry to the map
 - 
putpublic ORMap<A,B> put(SelfUniqueAddress node, A key, B value) Adds an entry to the map. Note that the newvaluewill be merged with existing values on other nodes and the outcome depends on whatReplicatedDatatype that is used.Consider using {@link ORMap#updated(node:akka\.cluster\.ddata\.SelfUniqueAddress*} instead of putif you want modify existing entry.IllegalArgumentExceptionis thrown if you try to replace an existingORSetvalue, because important history can be lost when replacing theORSetand undesired effects of merging will occur. UseORMultiMapor {@link ORMap#updated(node:akka\.cluster\.ddata\.SelfUniqueAddress*} instead.
 - 
updatedpublic ORMap<A,B> updated(SelfUniqueAddress node, A key, B initial, scala.Function1<B,B> modify) Scala API: Replace a value by applying themodifyfunction on the existing value.If there is no current value for the keytheinitialvalue will be passed to themodifyfunction.
 - 
updatedpublic ORMap<A,B> updated(Cluster node, A key, B initial, java.util.function.Function<B,B> modify) Deprecated.use update for the Java API as updated is ambiguous with the Scala API. Since 2.5.20.Java API: Replace a value by applying themodifyfunction on the existing value.If there is no current value for the keytheinitialvalue will be passed to themodifyfunction.
 - 
updatepublic ORMap<A,B> update(SelfUniqueAddress node, A key, B initial, java.util.function.Function<B,B> modify) Java API: Replace a value by applying themodifyfunction on the existing value.If there is no current value for the keytheinitialvalue will be passed to themodifyfunction.
 - 
removepublic ORMap<A,B> remove(A key, SelfUniqueAddress node) Scala API Removes an entry from the map. Note that if there is a conflicting update on another node the entry will not be removed after merge.
 - 
removepublic ORMap<A,B> remove(SelfUniqueAddress node, A key) Java API Removes an entry from the map. Note that if there is a conflicting update on another node the entry will not be removed after merge.
 - 
resetDeltapublic ORMap<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
 
 - 
mergeDeltapublic ORMap<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
 
 - 
prunepublic ORMap<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
 
 - 
pruningCleanuppublic ORMap<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
 
 - 
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
 
 
- 
 
-