Search Results for

    Show / Hide Table of Contents

    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
    object
    ORMultiValueDictionary<TKey, TValue>
    Implements
    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
    Inherited Members
    object.Equals(object, object)
    object.GetType()
    object.ReferenceEquals(object, object)
    Namespace: Akka.DistributedData
    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
    Type Description
    ORMultiValueDictionary<TKey, TValue>
    | Edit this page View Source

    EmptyWithValueDeltas

    Declaration
    public static readonly ORMultiValueDictionary<TKey, TValue> EmptyWithValueDeltas
    Field Value
    Type Description
    ORMultiValueDictionary<TKey, TValue>

    Properties

    | Edit this page View Source

    Count

    Declaration
    public int Count { get; }
    Property Value
    Type Description
    int
    | 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
    Type Description
    ORDictionary<TKey, ORSet<TValue>>.IDeltaOperation
    | Edit this page View Source

    DeltaValues

    Declaration
    public bool DeltaValues { get; }
    Property Value
    Type Description
    bool
    | Edit this page View Source

    Entries

    Declaration
    public IImmutableDictionary<TKey, IImmutableSet<TValue>> Entries { get; }
    Property Value
    Type Description
    IImmutableDictionary<TKey, IImmutableSet<TValue>>
    | Edit this page View Source

    IsEmpty

    Declaration
    public bool IsEmpty { get; }
    Property Value
    Type Description
    bool
    | Edit this page View Source

    this[TKey]

    Declaration
    public IImmutableSet<TValue> this[TKey key] { get; }
    Parameters
    Type Name Description
    TKey key
    Property Value
    Type Description
    IImmutableSet<TValue>
    | Edit this page View Source

    KeyType

    Declaration
    public Type KeyType { get; }
    Property Value
    Type Description
    Type
    | Edit this page View Source

    Keys

    Returns all keys stored within current ORMultiDictionary.

    Declaration
    public IEnumerable<TKey> Keys { get; }
    Property Value
    Type Description
    IEnumerable<TKey>
    | 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
    Type Description
    ImmutableHashSet<UniqueAddress>
    | Edit this page View Source

    ValueType

    Declaration
    public Type ValueType { get; }
    Property Value
    Type Description
    Type
    | Edit this page View Source

    Values

    Returns all values stored in all buckets within current ORMultiDictionary.

    Declaration
    public IEnumerable<TValue> Values { get; }
    Property Value
    Type Description
    IEnumerable<TValue>

    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
    Type Description
    ORMultiValueDictionary<TKey, TValue>
    | 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
    Type Name Description
    UniqueAddress node
    TKey key
    TValue element
    Returns
    Type Description
    ORMultiValueDictionary<TKey, TValue>
    | Edit this page View Source

    ContainsKey(TKey)

    Declaration
    public bool ContainsKey(TKey key)
    Parameters
    Type Name Description
    TKey key
    Returns
    Type Description
    bool
    | Edit this page View Source

    Equals(ORMultiValueDictionary<TKey, TValue>)

    Declaration
    public bool Equals(ORMultiValueDictionary<TKey, TValue> other)
    Parameters
    Type Name Description
    ORMultiValueDictionary<TKey, TValue> other
    Returns
    Type Description
    bool
    | Edit this page View Source

    Equals(object)

    Declaration
    public override bool Equals(object obj)
    Parameters
    Type Name Description
    object obj
    Returns
    Type Description
    bool
    Overrides
    object.Equals(object)
    | Edit this page View Source

    GetEnumerator()

    Declaration
    public IEnumerator<KeyValuePair<TKey, IImmutableSet<TValue>>> GetEnumerator()
    Returns
    Type Description
    IEnumerator<KeyValuePair<TKey, IImmutableSet<TValue>>>
    | Edit this page View Source

    GetHashCode()

    Declaration
    public override int GetHashCode()
    Returns
    Type Description
    int
    Overrides
    object.GetHashCode()
    | Edit this page View Source

    Merge(IReplicatedData)

    Declaration
    public IReplicatedData Merge(IReplicatedData other)
    Parameters
    Type Name Description
    IReplicatedData other
    Returns
    Type Description
    IReplicatedData
    | Edit this page View Source

    Merge(ORMultiValueDictionary<TKey, TValue>)

    Monotonic merge method.

    Declaration
    public ORMultiValueDictionary<TKey, TValue> Merge(ORMultiValueDictionary<TKey, TValue> other)
    Parameters
    Type Name Description
    ORMultiValueDictionary<TKey, TValue> other
    Returns
    Type Description
    ORMultiValueDictionary<TKey, TValue>
    | Edit this page View Source

    MergeDelta(IDeltaOperation)

    When delta is merged into the full state this method is used. When the type ORDictionary of the delta is of the same type as the full state ORMultiValueDictionary<TKey, TValue> this method can be implemented by delegating to Merge(T).

    Declaration
    public ORMultiValueDictionary<TKey, TValue> MergeDelta(ORDictionary<TKey, ORSet<TValue>>.IDeltaOperation delta)
    Parameters
    Type Name Description
    ORDictionary<TKey, ORSet<TValue>>.IDeltaOperation delta
    Returns
    Type Description
    ORMultiValueDictionary<TKey, TValue>
    | 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
    Type Name Description
    UniqueAddress removedNode
    Returns
    Type Description
    bool
    | 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
    Type Name Description
    UniqueAddress removedNode
    UniqueAddress collapseInto
    Returns
    Type Description
    ORMultiValueDictionary<TKey, TValue>
    | 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
    Type Name Description
    UniqueAddress removedNode
    Returns
    Type Description
    ORMultiValueDictionary<TKey, TValue>
    | 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
    Type Description
    ORMultiValueDictionary<TKey, TValue>
    | 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
    Type Name Description
    UniqueAddress node
    TKey key
    Returns
    Type Description
    ORMultiValueDictionary<TKey, TValue>
    | 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
    Type Description
    ORMultiValueDictionary<TKey, TValue>
    | 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
    Type Name Description
    UniqueAddress node
    TKey key
    TValue element
    Returns
    Type Description
    ORMultiValueDictionary<TKey, TValue>
    | 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
    Type Description
    ORMultiValueDictionary<TKey, TValue>
    | 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
    Type Description
    ORMultiValueDictionary<TKey, TValue>
    | 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
    Type Description
    ORMultiValueDictionary<TKey, TValue>
    | 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
    Type Name Description
    Cluster node
    TKey key
    IImmutableSet<TValue> bucket
    Returns
    Type Description
    ORMultiValueDictionary<TKey, TValue>
    | 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
    Type Name Description
    UniqueAddress node
    TKey key
    IImmutableSet<TValue> bucket
    Returns
    Type Description
    ORMultiValueDictionary<TKey, TValue>
    | Edit this page View Source

    ToString()

    Declaration
    public override string ToString()
    Returns
    Type Description
    string
    Overrides
    object.ToString()
    | Edit this page View Source

    TryGetValue(TKey, out IImmutableSet<TValue>)

    Declaration
    public bool TryGetValue(TKey key, out IImmutableSet<TValue> value)
    Parameters
    Type Name Description
    TKey key
    IImmutableSet<TValue> value
    Returns
    Type Description
    bool

    Implements

    IDeltaReplicatedData<T, TDelta>
    IDeltaReplicatedData
    IRemovedNodePruning<T>
    IRemovedNodePruning
    IReplicatedData<T>
    IReplicatedData
    IReplicatedDataSerialization
    IEquatable<T>
    IEnumerable<T>
    IEnumerable

    Extension Methods

    ObjectExtensions.IsDefaultForType<T>(T)
    ObjectExtensions.AsOption<T>(T)
    EnumerableExtensions.Grouped<T>(IEnumerable<T>, int)
    Extensions.Concat<T>(IEnumerable<T>?, T)
    Extensions.Drop<T>(IEnumerable<T>, int)
    Extensions.ForEach<T>(IEnumerable<T>, Action<T>)
    Extensions.Head<T>(IEnumerable<T>)
    Extensions.TakeRight<T>(IEnumerable<T>, int)
    Extensions.AsInstanceOf<T>(object)
    In this article
    • githubEdit this page
    • View Source
    Back to top
    Contribute
    • Project Chat
    • Discussion Forum
    • Source Code
    Support
    • Akka.NET Support Plans
    • Akka.NET Observability Tools
    • Akka.NET Training & Consulting
    Maintained By
    • Petabridge - The Akka.NET Company
    • Learn Akka.NET