Class ORMultiValueDictionary<TKey, TValue>
An immutable multi-map implementation. This class wraps an
ORDictionary<TKey, TValue> with an ORSet<T> for the map's value.
This class is immutable, i.e. "modifying" methods return a new instance.
Inheritance
ORMultiValueDictionary<TKey, TValue>
Assembly: Akka.DistributedData.dll
Syntax
[Serializable]
public sealed class ORMultiValueDictionary<TKey, TValue> : IDeltaReplicatedData<ORMultiValueDictionary<TKey, TValue>, ORDictionary<TKey, ORSet<TValue>>.IDeltaOperation>, IDeltaReplicatedData, IRemovedNodePruning<ORMultiValueDictionary<TKey, TValue>>, IRemovedNodePruning, IReplicatedData<ORMultiValueDictionary<TKey, TValue>>, IReplicatedData, IReplicatedDataSerialization, IEquatable<ORMultiValueDictionary<TKey, TValue>>, IEnumerable<KeyValuePair<TKey, IImmutableSet<TValue>>>, IEnumerable
Type Parameters
Name |
Description |
TKey |
|
TValue |
|
Fields
|
Edit this page
View Source
Empty
Declaration
public static readonly ORMultiValueDictionary<TKey, TValue> Empty
Field Value
|
Edit this page
View Source
EmptyWithValueDeltas
Declaration
public static readonly ORMultiValueDictionary<TKey, TValue> EmptyWithValueDeltas
Field Value
Properties
|
Edit this page
View Source
Count
Declaration
public int Count { get; }
Property Value
|
Edit this page
View Source
Delta
The accumulated delta of mutator operations since previous
ResetDelta(). When the Akka.DistributedData.Replicator invokes the modify
function
of the Update 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 the Akka.DistributedData.Replicator with the Delta accessor. The
modify
function shall still return the full state in the same way as
IReplicatedData<T> without support for deltas.
Declaration
public ORDictionary<TKey, ORSet<TValue>>.IDeltaOperation Delta { get; }
Property Value
|
Edit this page
View Source
DeltaValues
Declaration
public bool DeltaValues { get; }
Property Value
|
Edit this page
View Source
Entries
Declaration
public IImmutableDictionary<TKey, IImmutableSet<TValue>> Entries { get; }
Property Value
|
Edit this page
View Source
IsEmpty
Declaration
public bool IsEmpty { get; }
Property Value
|
Edit this page
View Source
this[TKey]
Declaration
public IImmutableSet<TValue> this[TKey key] { get; }
Parameters
Type |
Name |
Description |
TKey |
key |
|
Property Value
|
Edit this page
View Source
KeyType
Declaration
public Type KeyType { get; }
Property Value
|
Edit this page
View Source
Keys
Returns all keys stored within current ORMultiDictionary.
Declaration
public IEnumerable<TKey> Keys { get; }
Property Value
|
Edit this page
View Source
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.
Declaration
public ImmutableHashSet<UniqueAddress> ModifiedByNodes { get; }
Property Value
|
Edit this page
View Source
ValueType
Declaration
public Type ValueType { get; }
Property Value
|
Edit this page
View Source
Values
Returns all values stored in all buckets within current ORMultiDictionary.
Declaration
public IEnumerable<TValue> Values { get; }
Property Value
Methods
|
Edit this page
View Source
AddItem(Cluster, TKey, TValue)
Add an element to a set associated with a key. If there is no existing set then one will be initialised.
Declaration
public ORMultiValueDictionary<TKey, TValue> AddItem(Cluster node, TKey key, TValue element)
Parameters
Type |
Name |
Description |
Cluster |
node |
|
TKey |
key |
|
TValue |
element |
|
Returns
|
Edit this page
View Source
AddItem(UniqueAddress, TKey, TValue)
Add an element to a set associated with a key. If there is no existing set then one will be initialised.
Declaration
public ORMultiValueDictionary<TKey, TValue> AddItem(UniqueAddress node, TKey key, TValue element)
Parameters
Returns
|
Edit this page
View Source
ContainsKey(TKey)
Declaration
public bool ContainsKey(TKey key)
Parameters
Type |
Name |
Description |
TKey |
key |
|
Returns
|
Edit this page
View Source
Equals(ORMultiValueDictionary<TKey, TValue>)
Declaration
public bool Equals(ORMultiValueDictionary<TKey, TValue> other)
Parameters
Returns
|
Edit this page
View Source
Equals(object)
Declaration
public override bool Equals(object obj)
Parameters
Type |
Name |
Description |
object |
obj |
|
Returns
Overrides
|
Edit this page
View Source
GetEnumerator()
Declaration
public IEnumerator<KeyValuePair<TKey, IImmutableSet<TValue>>> GetEnumerator()
Returns
|
Edit this page
View Source
GetHashCode()
Declaration
public override int GetHashCode()
Returns
Overrides
|
Edit this page
View Source
Merge(IReplicatedData)
Declaration
public IReplicatedData Merge(IReplicatedData other)
Parameters
Returns
|
Edit this page
View Source
Merge(ORMultiValueDictionary<TKey, TValue>)
Declaration
public ORMultiValueDictionary<TKey, TValue> Merge(ORMultiValueDictionary<TKey, TValue> other)
Parameters
Returns
|
Edit this page
View Source
MergeDelta(IDeltaOperation)
Declaration
public ORMultiValueDictionary<TKey, TValue> MergeDelta(ORDictionary<TKey, ORSet<TValue>>.IDeltaOperation delta)
Parameters
Returns
|
Edit this page
View Source
NeedPruningFrom(UniqueAddress)
Does it have any state changes from a specific node,
which has been removed from the cluster.
Declaration
public bool NeedPruningFrom(UniqueAddress removedNode)
Parameters
Returns
|
Edit this page
View Source
Prune(UniqueAddress, UniqueAddress)
When the removedNode
node has been removed from the cluster the state
changes from that node will be pruned by collapsing the data entries
to another node.
Declaration
public ORMultiValueDictionary<TKey, TValue> Prune(UniqueAddress removedNode, UniqueAddress collapseInto)
Parameters
Returns
|
Edit this page
View Source
PruningCleanup(UniqueAddress)
Remove data entries from a node that has been removed from the cluster
and already been pruned.
Declaration
public ORMultiValueDictionary<TKey, TValue> PruningCleanup(UniqueAddress removedNode)
Parameters
Returns
|
Edit this page
View Source
Remove(Cluster, TKey)
Removes all values inside current dictionary stored under provided key
in the context of the provided cluster node
.
Declaration
public ORMultiValueDictionary<TKey, TValue> Remove(Cluster node, TKey key)
Parameters
Type |
Name |
Description |
Cluster |
node |
|
TKey |
key |
|
Returns
|
Edit this page
View Source
Remove(UniqueAddress, TKey)
Removes all values inside current dictionary stored under provided key
in the context of the provided cluster node
.
Declaration
public ORMultiValueDictionary<TKey, TValue> Remove(UniqueAddress node, TKey key)
Parameters
Returns
|
Edit this page
View Source
RemoveItem(Cluster, TKey, TValue)
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.
Declaration
public ORMultiValueDictionary<TKey, TValue> RemoveItem(Cluster node, TKey key, TValue element)
Parameters
Type |
Name |
Description |
Cluster |
node |
|
TKey |
key |
|
TValue |
element |
|
Returns
|
Edit this page
View Source
RemoveItem(UniqueAddress, TKey, TValue)
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.
Declaration
public ORMultiValueDictionary<TKey, TValue> RemoveItem(UniqueAddress node, TKey key, TValue element)
Parameters
Returns
|
Edit this page
View Source
ReplaceItem(Cluster, TKey, TValue, TValue)
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.
Declaration
public ORMultiValueDictionary<TKey, TValue> ReplaceItem(Cluster node, TKey key, TValue oldElement, TValue newElement)
Parameters
Type |
Name |
Description |
Cluster |
node |
|
TKey |
key |
|
TValue |
oldElement |
|
TValue |
newElement |
|
Returns
|
Edit this page
View Source
ReplaceItem(UniqueAddress, TKey, TValue, TValue)
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.
Declaration
public ORMultiValueDictionary<TKey, TValue> ReplaceItem(UniqueAddress node, TKey key, TValue oldElement, TValue newElement)
Parameters
Type |
Name |
Description |
UniqueAddress |
node |
|
TKey |
key |
|
TValue |
oldElement |
|
TValue |
newElement |
|
Returns
|
Edit this page
View Source
ResetDelta()
Reset collection of deltas from mutator operations. When the Akka.DistributedData.Replicator
invokes the modify
function of the Update 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
the Akka.DistributedData.Replicator with the Delta accessor. When the
Akka.DistributedData.Replicator has grabbed the Delta it will invoke this method
to get a clean data instance without the delta.
Declaration
public ORMultiValueDictionary<TKey, TValue> ResetDelta()
Returns
|
Edit this page
View Source
SetItems(Cluster, TKey, IImmutableSet<TValue>)
Sets a bucket
of values inside current dictionary under provided key
in the context of the provided cluster node
.
Declaration
public ORMultiValueDictionary<TKey, TValue> SetItems(Cluster node, TKey key, IImmutableSet<TValue> bucket)
Parameters
Returns
|
Edit this page
View Source
SetItems(UniqueAddress, TKey, IImmutableSet<TValue>)
Sets a bucket
of values inside current dictionary under provided key
in the context of the provided cluster node
.
Declaration
public ORMultiValueDictionary<TKey, TValue> SetItems(UniqueAddress node, TKey key, IImmutableSet<TValue> bucket)
Parameters
Returns
|
Edit this page
View Source
ToString()
Declaration
public override string ToString()
Returns
Overrides
|
Edit this page
View Source
TryGetValue(TKey, out IImmutableSet<TValue>)
Declaration
public bool TryGetValue(TKey key, out IImmutableSet<TValue> value)
Parameters
Returns
Implements
Extension Methods