Search Results for

    Show / Hide Table of Contents

    Class PNCounterDictionary<TKey>

    Map of named counters. Specialized ORDictionary<TKey, TValue> with PNCounter values. This class is immutable, i.e. "modifying" methods return a new instance.

    Inheritance
    object
    PNCounterDictionary<TKey>
    Implements
    IDeltaReplicatedData<PNCounterDictionary<TKey>, ORDictionary<TKey, PNCounter>.IDeltaOperation>
    IDeltaReplicatedData
    IRemovedNodePruning<PNCounterDictionary<TKey>>
    IRemovedNodePruning
    IReplicatedData<PNCounterDictionary<TKey>>
    IReplicatedData
    IReplicatedDataSerialization
    IEquatable<PNCounterDictionary<TKey>>
    IEnumerable<KeyValuePair<TKey, BigInteger>>
    IEnumerable
    Inherited Members
    object.Equals(object, object)
    object.GetType()
    object.ReferenceEquals(object, object)
    Namespace: Akka.DistributedData
    Assembly: Akka.DistributedData.dll
    Syntax
    public sealed class PNCounterDictionary<TKey> : IDeltaReplicatedData<PNCounterDictionary<TKey>, ORDictionary<TKey, PNCounter>.IDeltaOperation>, IDeltaReplicatedData, IRemovedNodePruning<PNCounterDictionary<TKey>>, IRemovedNodePruning, IReplicatedData<PNCounterDictionary<TKey>>, IReplicatedData, IReplicatedDataSerialization, IEquatable<PNCounterDictionary<TKey>>, IEnumerable<KeyValuePair<TKey, BigInteger>>, IEnumerable
    Type Parameters
    Name Description
    TKey

    Constructors

    | Edit this page View Source

    PNCounterDictionary(ORDictionary<TKey, PNCounter>)

    Declaration
    public PNCounterDictionary(ORDictionary<TKey, PNCounter> underlying)
    Parameters
    Type Name Description
    ORDictionary<TKey, PNCounter> underlying

    Fields

    | Edit this page View Source

    Empty

    Declaration
    public static readonly PNCounterDictionary<TKey> Empty
    Field Value
    Type Description
    PNCounterDictionary<TKey>

    Properties

    | Edit this page View Source

    Count

    Returns number of entries stored within current PNCounterDictionary<TKey>.

    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, PNCounter>.IDeltaOperation Delta { get; }
    Property Value
    Type Description
    ORDictionary<TKey, PNCounter>.IDeltaOperation
    | Edit this page View Source

    Entries

    Returns all entries stored within current PNCounterDictionary<TKey>

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

    IsEmpty

    Determines if current PNCounterDictionary<TKey> is empty.

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

    this[TKey]

    Returns a counter value stored within current PNCounterDictionary<TKey> under provided key

    Declaration
    public BigInteger this[TKey key] { get; }
    Parameters
    Type Name Description
    TKey key
    Property Value
    Type Description
    BigInteger
    | 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 of the current PNCounterDictionary<TKey>.

    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

    Values

    Returns all values stored within current PNCounterDictionary<TKey>.

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

    Methods

    | Edit this page View Source

    ContainsKey(TKey)

    Determines if current PNCounterDictionary<TKey> has a counter registered under provided key.

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

    Decrement(Cluster, TKey, long)

    Decrement the counter with the delta specified. If the delta is negative then it will increment instead of decrement.

    Declaration
    public PNCounterDictionary<TKey> Decrement(Cluster node, TKey key, long delta = 1)
    Parameters
    Type Name Description
    Cluster node
    TKey key
    long delta
    Returns
    Type Description
    PNCounterDictionary<TKey>
    | Edit this page View Source

    Decrement(UniqueAddress, TKey, long)

    Decrement the counter with the delta specified. If the delta is negative then it will increment instead of decrement.

    Declaration
    public PNCounterDictionary<TKey> Decrement(UniqueAddress node, TKey key, long delta = 1)
    Parameters
    Type Name Description
    UniqueAddress node
    TKey key
    long delta
    Returns
    Type Description
    PNCounterDictionary<TKey>
    | Edit this page View Source

    Equals(PNCounterDictionary<TKey>)

    Declaration
    public bool Equals(PNCounterDictionary<TKey> other)
    Parameters
    Type Name Description
    PNCounterDictionary<TKey> 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, BigInteger>> GetEnumerator()
    Returns
    Type Description
    IEnumerator<KeyValuePair<TKey, BigInteger>>
    | Edit this page View Source

    GetHashCode()

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

    Increment(Cluster, TKey, long)

    Increment the counter with the delta specified. If the delta is negative then it will decrement instead of increment.

    Declaration
    public PNCounterDictionary<TKey> Increment(Cluster node, TKey key, long delta = 1)
    Parameters
    Type Name Description
    Cluster node
    TKey key
    long delta
    Returns
    Type Description
    PNCounterDictionary<TKey>
    | Edit this page View Source

    Increment(UniqueAddress, TKey, long)

    Increment the counter with the delta specified. If the delta is negative then it will decrement instead of increment.

    Declaration
    public PNCounterDictionary<TKey> Increment(UniqueAddress node, TKey key, long delta = 1)
    Parameters
    Type Name Description
    UniqueAddress node
    TKey key
    long delta
    Returns
    Type Description
    PNCounterDictionary<TKey>
    | 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(PNCounterDictionary<TKey>)

    Monotonic merge method.

    Declaration
    public PNCounterDictionary<TKey> Merge(PNCounterDictionary<TKey> other)
    Parameters
    Type Name Description
    PNCounterDictionary<TKey> other
    Returns
    Type Description
    PNCounterDictionary<TKey>
    | 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 PNCounterDictionary<TKey> this method can be implemented by delegating to Merge(T).

    Declaration
    public PNCounterDictionary<TKey> MergeDelta(ORDictionary<TKey, PNCounter>.IDeltaOperation delta)
    Parameters
    Type Name Description
    ORDictionary<TKey, PNCounter>.IDeltaOperation delta
    Returns
    Type Description
    PNCounterDictionary<TKey>
    | 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 PNCounterDictionary<TKey> Prune(UniqueAddress removedNode, UniqueAddress collapseInto)
    Parameters
    Type Name Description
    UniqueAddress removedNode
    UniqueAddress collapseInto
    Returns
    Type Description
    PNCounterDictionary<TKey>
    | 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 PNCounterDictionary<TKey> PruningCleanup(UniqueAddress removedNode)
    Parameters
    Type Name Description
    UniqueAddress removedNode
    Returns
    Type Description
    PNCounterDictionary<TKey>
    | Edit this page View Source

    Remove(Cluster, TKey)

    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.

    Declaration
    public PNCounterDictionary<TKey> Remove(Cluster node, TKey key)
    Parameters
    Type Name Description
    Cluster node
    TKey key
    Returns
    Type Description
    PNCounterDictionary<TKey>
    | Edit this page View Source

    Remove(UniqueAddress, TKey)

    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.

    Declaration
    public PNCounterDictionary<TKey> Remove(UniqueAddress node, TKey key)
    Parameters
    Type Name Description
    UniqueAddress node
    TKey key
    Returns
    Type Description
    PNCounterDictionary<TKey>
    | 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 PNCounterDictionary<TKey> ResetDelta()
    Returns
    Type Description
    PNCounterDictionary<TKey>
    | 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 BigInteger)

    Tries to return a value under provided key, if such entry exists.

    Declaration
    public bool TryGetValue(TKey key, out BigInteger value)
    Parameters
    Type Name Description
    TKey key
    BigInteger 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