Search Results for

    Show / Hide Table of Contents

    Class ExternalShardAllocationStrategy

    Inheritance
    object
    ExternalShardAllocationStrategy
    Implements
    IStartableAllocationStrategy
    IShardAllocationStrategy
    INoSerializationVerificationNeeded
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Akka.Cluster.Sharding.External
    Assembly: Akka.Cluster.Sharding.dll
    Syntax
    public class ExternalShardAllocationStrategy : IStartableAllocationStrategy, IShardAllocationStrategy, INoSerializationVerificationNeeded

    Constructors

    | Edit this page View Source

    ExternalShardAllocationStrategy(ActorSystem, string)

    Declaration
    public ExternalShardAllocationStrategy(ActorSystem system, string typeName)
    Parameters
    Type Name Description
    ActorSystem system
    string typeName

    Properties

    | Edit this page View Source

    Timeout

    Declaration
    protected virtual TimeSpan Timeout { get; }
    Property Value
    Type Description
    TimeSpan

    Methods

    | Edit this page View Source

    AllocateShard(IActorRef, string, IImmutableDictionary<IActorRef, IImmutableList<string>>)

    Invoked when the location of a new shard is to be decided.

    Declaration
    public Task<IActorRef> AllocateShard(IActorRef requester, string shardId, IImmutableDictionary<IActorRef, IImmutableList<string>> currentShardAllocations)
    Parameters
    Type Name Description
    IActorRef requester

    Actor reference to the ShardRegion that requested the location of the shard, can be returned if preference should be given to the node where the shard was first accessed.

    string shardId

    The id of the shard to allocate.

    IImmutableDictionary<IActorRef, IImmutableList<string>> currentShardAllocations

    All actor refs to ShardRegion and their current allocated shards, in the order they were allocated

    Returns
    Type Description
    Task<IActorRef>

    Task of the actor ref of the ShardRegion that is to be responsible for the shard, must be one of the references included in the currentShardAllocations parameter.

    | Edit this page View Source

    CreateShardStateActor()

    Declaration
    protected virtual IActorRef CreateShardStateActor()
    Returns
    Type Description
    IActorRef
    | Edit this page View Source

    Rebalance(IImmutableDictionary<IActorRef, IImmutableList<string>>, IImmutableSet<string>)

    Invoked periodically to decide which shards to rebalance to another location.

    Declaration
    public Task<IImmutableSet<string>> Rebalance(IImmutableDictionary<IActorRef, IImmutableList<string>> currentShardAllocations, IImmutableSet<string> rebalanceInProgress)
    Parameters
    Type Name Description
    IImmutableDictionary<IActorRef, IImmutableList<string>> currentShardAllocations

    All actor refs to ShardRegion and their current allocated shards, in the order they were allocated.

    IImmutableSet<string> rebalanceInProgress

    Set of shards that are currently being rebalanced, i.e. you should not include these in the returned set.

    Returns
    Type Description
    Task<IImmutableSet<string>>

    Task of the shards to be migrated, may be empty to skip rebalance in this round.

    | Edit this page View Source

    Start()

    Called before any calls to allocate/rebalance. Do not block. If asynchronous actions are required they can be started here and delay the Futures returned by allocate/rebalance.

    Declaration
    public void Start()

    Implements

    IStartableAllocationStrategy
    IShardAllocationStrategy
    INoSerializationVerificationNeeded

    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