Class ConsistentHashingRoutingLogic$
- All Implemented Interfaces:
Serializable
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ConsistentHashingRoutingLogic$Static reference to the singleton instance of this Scala object. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintUses consistent hashing to select a routee based on the sent message.apply(ActorSystem system, int virtualNodesFactor, scala.PartialFunction<Object, Object> hashMapping) Uses consistent hashing to select a routee based on the sent message.intdefaultAddress(ActorSystem system) scala.Option<scala.Tuple3<ActorSystem,Object, scala.PartialFunction<Object, Object>>>
-
Field Details
-
MODULE$
Static reference to the singleton instance of this Scala object.
-
-
Constructor Details
-
ConsistentHashingRoutingLogic$
public ConsistentHashingRoutingLogic$()
-
-
Method Details
-
$lessinit$greater$default$2
public int $lessinit$greater$default$2()Uses consistent hashing to select a routee based on the sent message.There is 3 ways to define what data to use for the consistent hash key.
1. You can define
hashMapping/withHashMapperof the router to map incoming messages to their consistent hash key. This makes the decision transparent for the sender.2. The messages may implement
pekko.routing.ConsistentHashingRouter.ConsistentHashable. The key is part of the message and it's convenient to define it together with the message definition.3. The messages can be wrapped in a
pekko.routing.ConsistentHashingRouter.ConsistentHashableEnvelopeto define what data to use for the consistent hash key. The sender knows the key to use.These ways to define the consistent hash key can be use together and at the same time for one router. The
hashMappingis tried first.- Parameters:
virtualNodesFactor- number of virtual nodes per node, used inpekko.routing.ConsistentHashhashMapping- partial function from message to the data to use for the consistent hash keysystem- the actor system hosting this router
-
$lessinit$greater$default$3
-
defaultAddress
-
apply
public ConsistentHashingRoutingLogic apply(ActorSystem system, int virtualNodesFactor, scala.PartialFunction<Object, Object> hashMapping) Uses consistent hashing to select a routee based on the sent message.There is 3 ways to define what data to use for the consistent hash key.
1. You can define
hashMapping/withHashMapperof the router to map incoming messages to their consistent hash key. This makes the decision transparent for the sender.2. The messages may implement
pekko.routing.ConsistentHashingRouter.ConsistentHashable. The key is part of the message and it's convenient to define it together with the message definition.3. The messages can be wrapped in a
pekko.routing.ConsistentHashingRouter.ConsistentHashableEnvelopeto define what data to use for the consistent hash key. The sender knows the key to use.These ways to define the consistent hash key can be use together and at the same time for one router. The
hashMappingis tried first.- Parameters:
virtualNodesFactor- number of virtual nodes per node, used inpekko.routing.ConsistentHashhashMapping- partial function from message to the data to use for the consistent hash keysystem- the actor system hosting this router
-
apply$default$2
public int apply$default$2() -
apply$default$3
-
unapply
public scala.Option<scala.Tuple3<ActorSystem,Object, unapplyscala.PartialFunction<Object, Object>>> (ConsistentHashingRoutingLogic x$0)
-