Search Results for

    Show / Hide Table of Contents

    Class DistributedData

    Akka extension for convenient configuration and use of the Akka.DistributedData.Replicator. Configuration settings are defined in the akka.cluster.ddata section, see reference.conf.

    Inheritance
    object
    DistributedData
    Implements
    IExtension
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Akka.DistributedData
    Assembly: Akka.DistributedData.dll
    Syntax
    public class DistributedData : IExtension

    Constructors

    | Edit this page View Source

    DistributedData(ExtendedActorSystem)

    TBD

    Declaration
    public DistributedData(ExtendedActorSystem system)
    Parameters
    Type Name Description
    ExtendedActorSystem system

    TBD

    Properties

    | Edit this page View Source

    IsDurable

    Checks if a durable store for this extension is configured and in use.

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

    IsTerminated

    Returns true if this member is not tagged with the role configured for the replicas.

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

    Replicator

    Actor reference of the Akka.DistributedData.Replicator.

    Declaration
    public IActorRef Replicator { get; }
    Property Value
    Type Description
    IActorRef

    Methods

    | Edit this page View Source

    DefaultConfig()

    TBD

    Declaration
    public static Config DefaultConfig()
    Returns
    Type Description
    Config

    TBD

    | Edit this page View Source

    DeleteAsync<T>(IKey<T>, IWriteConsistency, CancellationToken)

    Asynchronously tries to delete a replicated value stored under provided key within specified consistency boundaries. Once deleted, provided key can no longer be used. As deletion must be remembered, deleted keys will occupy a small portion of memory, producing a garbadge.

    If no consistency will be provided, a WriteLocal will be used. Keep in mind that failure doesn't mean that delete has failed, only that consistency limits were not fulfilled. The deletion will be propagated using gossip protocol.

    Declaration
    public Task DeleteAsync<T>(IKey<T> key, IWriteConsistency consistency = null, CancellationToken cancellation = default) where T : IReplicatedData<T>
    Parameters
    Type Name Description
    IKey<T> key

    Key under which a replicated data is stored.

    IWriteConsistency consistency

    A consistency level requested for this deletion.

    CancellationToken cancellation

    Cancellation token used to cancel request prematurelly if needed.

    Returns
    Type Description
    Task
    Type Parameters
    Name Description
    T

    Replicated data type to update.

    Exceptions
    Type Condition
    TimeoutException

    Thrown if update request consistency was not achieved within possible time limit attached to a provided read consistency.

    | Edit this page View Source

    Get(ActorSystem)

    TBD

    Declaration
    public static DistributedData Get(ActorSystem system)
    Parameters
    Type Name Description
    ActorSystem system

    TBD

    Returns
    Type Description
    DistributedData

    TBD

    | Edit this page View Source

    GetAsync<T>(IKey<T>, IReadConsistency, CancellationToken)

    Asynchronously tries to get a replicated value of type T stored under a given key, while trying to achieve provided read consistency. If no value was found under provided key, a null value will be returned.

    If no consistency will be provided, a ReadLocal will be used.

    Declaration
    public Task<T> GetAsync<T>(IKey<T> key, IReadConsistency consistency = null, CancellationToken cancellation = default) where T : class, IReplicatedData<T>
    Parameters
    Type Name Description
    IKey<T> key

    Key under which a replicated data is stored.

    IReadConsistency consistency

    A read consistency requested for this write.

    CancellationToken cancellation

    Cancellation token used to cancel request prematurelly if needed.

    Returns
    Type Description
    Task<T>

    A task which may return a replicated data value or throw an exception.

    Type Parameters
    Name Description
    T

    Replicated data type to get.

    Exceptions
    Type Condition
    DataDeletedException

    Thrown if value under provided key was permamently deleted. That key can't be used anymore.

    TimeoutException

    Thrown if get request consistency was not achieved within possible time limit attached to a provided read consistency.

    | Edit this page View Source

    GetKeysAsync(CancellationToken)

    Asynchronously returns list of locally known keys.

    Declaration
    public Task<IImmutableSet<string>> GetKeysAsync(CancellationToken cancellation = default)
    Parameters
    Type Name Description
    CancellationToken cancellation
    Returns
    Type Description
    Task<IImmutableSet<string>>
    | Edit this page View Source

    UpdateAsync<T>(IKey<T>, T, IWriteConsistency, CancellationToken)

    Asynchronously tries to update a replicated value stored under provided key with a replica value within write consistency boundaries. In case of possible conflict a Merge(T) operation will be performed.

    If no consistency will be provided, a WriteLocal will be used. Keep in mind that failure doesn't mean that write has failed, only that consistency limits were not fulfilled. The value will be probably further updated as propagated using gossip protocol.

    Declaration
    public Task UpdateAsync<T>(IKey<T> key, T replica, IWriteConsistency consistency = null, CancellationToken cancellation = default) where T : IReplicatedData<T>
    Parameters
    Type Name Description
    IKey<T> key

    Key under which a replicated data is stored.

    T replica

    Value used to perform an update.

    IWriteConsistency consistency

    A write consistency requested for this write.

    CancellationToken cancellation

    Cancellation token used to cancel request prematurelly if needed.

    Returns
    Type Description
    Task

    A task which may complete successfully if update was confirmed within provided consistency or throw an exception.

    Type Parameters
    Name Description
    T

    Replicated data type to update.

    Exceptions
    Type Condition
    DataDeletedException

    Thrown if value under provided key was permamently deleted. That key can't be used anymore.

    TimeoutException

    Thrown if update request consistency was not achieved within possible time limit attached to a provided read consistency.

    Implements

    IExtension

    Extension Methods

    ObjectExtensions.IsDefaultForType<T>(T)
    ObjectExtensions.AsOption<T>(T)
    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