Package org.apache.pekko.cluster.metrics
Class AdaptiveLoadBalancingRoutingLogic
java.lang.Object
org.apache.pekko.cluster.metrics.AdaptiveLoadBalancingRoutingLogic
- All Implemented Interfaces:
Serializable,NoSerializationVerificationNeeded,RoutingLogic,scala.Equals,scala.Product
public final class AdaptiveLoadBalancingRoutingLogic
extends Object
implements RoutingLogic, NoSerializationVerificationNeeded, scala.Product, Serializable
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.
param: system the actor system hosting this router
param: metricsSelector decides what probability to use for selecting a routee, based on remaining capacity as indicated by the node metrics
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionAdaptiveLoadBalancingRoutingLogic(ActorSystem system, MetricsSelector metricsSelector) -
Method Summary
Modifier and TypeMethodDescriptionstatic MetricsSelectorapply(ActorSystem system, MetricsSelector metricsSelector) static MetricsSelectorbooleancopy(ActorSystem system, MetricsSelector metricsSelector) booleaninthashCode()final voidintproductElement(int x$1) productElementName(int x$1) scala.collection.Iterator<Object>Pick the destination for a given message.system()toString()static scala.Option<scala.Tuple2<ActorSystem,MetricsSelector>> Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface scala.Product
productElementNames
-
Constructor Details
-
AdaptiveLoadBalancingRoutingLogic
-
-
Method Details
-
$lessinit$greater$default$2
-
apply
public static AdaptiveLoadBalancingRoutingLogic apply(ActorSystem system, MetricsSelector metricsSelector) -
apply$default$2
-
unapply
public static scala.Option<scala.Tuple2<ActorSystem,MetricsSelector>> unapply(AdaptiveLoadBalancingRoutingLogic x$0) -
system
-
metricsSelector
-
metricsChanged
-
select
Description copied from interface:RoutingLogicPick the destination for a given message. Normally it picks one of the passedroutees, but in the end it is up to the implementation to return whateverpekko.routing.Routeeto use for sending a specific message.When implemented from Java it can be good to know that
routees.apply(index)can be used to get an element from theIndexedSeq.- Specified by:
selectin interfaceRoutingLogic
-
copy
-
copy$default$1
-
copy$default$2
-
productPrefix
- Specified by:
productPrefixin interfacescala.Product
-
productArity
public int productArity()- Specified by:
productArityin interfacescala.Product
-
productElement
- Specified by:
productElementin interfacescala.Product
-
productIterator
- Specified by:
productIteratorin interfacescala.Product
-
canEqual
- Specified by:
canEqualin interfacescala.Equals
-
productElementName
- Specified by:
productElementNamein interfacescala.Product
-
hashCode
public int hashCode() -
toString
-
equals
-