Search Results for

    Show / Hide Table of Contents

    Class AdaptiveLoadBalancingPool

    A router pool that performs load balancing of messages to cluster nodes based on cluster metric data.

    It uses random selection of routees based on probabilities derived from the remaining capacity of corresponding node.

    The configuration parameter trumps the constructor arguments. This means that if you provide nrOfInstances during instantiation they will be ignored if the router is defined in the configuration file for the actor being used.

    Supervision Setup

    Any routees that are created by a router will be created as the router's children. The router is therefore also the children's supervisor.

    The supervision strategy of the router actor can be configured with [[#withSupervisorStrategy]]. If no strategy is provided, routers default to a strategy of “always escalate”. This means that errors are passed up to the router's supervisor for handling.

    The router's supervisor will treat the error as an error with the router itself. Therefore a directive to stop or restart will cause the router itself to stop or restart. The router, in turn, will cause its children to stop and restart.

    Inheritance
    object
    RouterConfig
    Pool
    AdaptiveLoadBalancingPool
    Implements
    ISurrogated
    IEquatable<RouterConfig>
    IEquatable<Pool>
    Inherited Members
    Pool.NrOfInstances
    Pool.UsePoolDispatcher
    Pool.SupervisorStrategy
    Pool.Props(Props)
    Pool.StopRouterWhenAllRouteesRemoved
    Pool.CreateRouterActor()
    Pool.DefaultSupervisorStrategy
    Pool.Equals(Pool)
    Pool.Equals(object)
    Pool.GetHashCode()
    RouterConfig.RouterDispatcher
    RouterConfig.IsManagementMessage(object)
    RouterConfig.VerifyConfig(ActorPath)
    RouterConfig.Equals(RouterConfig)
    object.Equals(object, object)
    object.GetType()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Akka.Cluster.Metrics
    Assembly: Akka.Cluster.Metrics.dll
    Syntax
    public sealed class AdaptiveLoadBalancingPool : Pool, ISurrogated, IEquatable<RouterConfig>, IEquatable<Pool>

    Constructors

    | Edit this page View Source

    AdaptiveLoadBalancingPool(IMetricsSelector, int, SupervisorStrategy, string, bool)

    Creates instance of AdaptiveLoadBalancingPool

    Declaration
    public AdaptiveLoadBalancingPool(IMetricsSelector metricsSelector = null, int nrOfInstances = 0, SupervisorStrategy supervisorStrategy = null, string routerDispatcher = null, bool usePoolDispatcher = false)
    Parameters
    Type Name Description
    IMetricsSelector metricsSelector

    Decides what probability to use for selecting a routee, based on remaining capacity as indicated by the node metrics

    int nrOfInstances

    Initial number of routees in the pool

    SupervisorStrategy supervisorStrategy

    strategy for supervising the routees, see 'Supervision Setup' in class summary

    string routerDispatcher

    Dispatcher to use for the router head actor, which handles supervision, death watch and router management messages

    bool usePoolDispatcher
    | Edit this page View Source

    AdaptiveLoadBalancingPool(Config)

    Creates instance of AdaptiveLoadBalancingPool using configuration

    Declaration
    public AdaptiveLoadBalancingPool(Config config)
    Parameters
    Type Name Description
    Config config

    Properties

    | Edit this page View Source

    MetricsSelector

    Metrics selector

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

    Resizer

    Retrieve the resizer to use when dynamically allocating routees to the pool.

    Declaration
    public override Resizer Resizer { get; }
    Property Value
    Type Description
    Resizer
    Overrides
    Pool.Resizer

    Methods

    | Edit this page View Source

    CreateRouter(ActorSystem)

    Creates a router that is responsible for routing messages to routees within the provided system.

    Declaration
    public override Router CreateRouter(ActorSystem system)
    Parameters
    Type Name Description
    ActorSystem system

    The ActorSystem this router belongs to.

    Returns
    Type Description
    Router

    The newly created router tied to the given system.

    Overrides
    RouterConfig.CreateRouter(ActorSystem)
    | Edit this page View Source

    GetNrOfInstances(ActorSystem)

    Used by the Akka.Routing.RoutedActorCell to determine the initial number of routees.

    Declaration
    public override int GetNrOfInstances(ActorSystem system)
    Parameters
    Type Name Description
    ActorSystem system

    The actor system that owns this router.

    Returns
    Type Description
    int

    The number of routees associated with this pool.

    Overrides
    Pool.GetNrOfInstances(ActorSystem)
    | Edit this page View Source

    RoutingLogicController(RoutingLogic)

    Possibility to define an actor for controlling the routing logic from external stimuli(e.g.monitoring metrics). This actor will be a child of the router "head" actor. Management messages not handled by the "head" actor are delegated to this controller actor.

    Declaration
    public override Props RoutingLogicController(RoutingLogic routingLogic)
    Parameters
    Type Name Description
    RoutingLogic routingLogic
    Returns
    Type Description
    Props
    Overrides
    RouterConfig.RoutingLogicController(RoutingLogic)
    | Edit this page View Source

    ToSurrogate(ActorSystem)

    Creates a surrogate representation of the current router.

    Declaration
    public override ISurrogate ToSurrogate(ActorSystem system)
    Parameters
    Type Name Description
    ActorSystem system

    The actor system that owns this router.

    Returns
    Type Description
    ISurrogate

    The surrogate representation of the current router.

    Overrides
    RouterConfig.ToSurrogate(ActorSystem)
    | Edit this page View Source

    WithDispatcher(string)

    Setting the dispatcher to be used for the router head actor, which handles supervision, death watch and router management messages.

    Declaration
    public AdaptiveLoadBalancingPool WithDispatcher(string dispatcherId)
    Parameters
    Type Name Description
    string dispatcherId
    Returns
    Type Description
    AdaptiveLoadBalancingPool
    | Edit this page View Source

    WithFallback(RouterConfig)

    Configure the current router with an auxiliary router for routes that it does not know how to handle.

    Declaration
    public override RouterConfig WithFallback(RouterConfig routerConfig)
    Parameters
    Type Name Description
    RouterConfig routerConfig

    The router to use as an auxiliary source.

    Returns
    Type Description
    RouterConfig

    The router configured with the auxiliary information.

    Overrides
    RouterConfig.WithFallback(RouterConfig)
    | Edit this page View Source

    WithSupervisorStrategy(SupervisorStrategy)

    Setting the supervisor strategy to be used for the “head” Router actor.

    Declaration
    public AdaptiveLoadBalancingPool WithSupervisorStrategy(SupervisorStrategy strategy)
    Parameters
    Type Name Description
    SupervisorStrategy strategy
    Returns
    Type Description
    AdaptiveLoadBalancingPool

    Implements

    ISurrogated
    IEquatable<T>
    IEquatable<T>

    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