Class ConsistentHashingRoutingLogic$
- java.lang.Object
-
- akka.routing.ConsistentHashingRoutingLogic$
-
- All Implemented Interfaces:
java.io.Serializable
public class ConsistentHashingRoutingLogic$ extends java.lang.Object implements java.io.Serializable
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static ConsistentHashingRoutingLogic$
MODULE$
Static reference to the singleton instance of this Scala object.
-
Constructor Summary
Constructors Constructor Description ConsistentHashingRoutingLogic$()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
$lessinit$greater$default$2()
Uses consistent hashing to select a routee based on the sent message.scala.PartialFunction<java.lang.Object,java.lang.Object>
$lessinit$greater$default$3()
ConsistentHashingRoutingLogic
apply(ActorSystem system, int virtualNodesFactor, scala.PartialFunction<java.lang.Object,java.lang.Object> hashMapping)
Uses consistent hashing to select a routee based on the sent message.int
apply$default$2()
scala.PartialFunction<java.lang.Object,java.lang.Object>
apply$default$3()
Address
defaultAddress(ActorSystem system)
scala.Option<scala.Tuple3<ActorSystem,java.lang.Object,scala.PartialFunction<java.lang.Object,java.lang.Object>>>
unapply(ConsistentHashingRoutingLogic x$0)
-
-
-
Field Detail
-
MODULE$
public static final ConsistentHashingRoutingLogic$ MODULE$
Static reference to the singleton instance of this Scala object.
-
-
Method Detail
-
$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
/withHashMapper
of the router to map incoming messages to their consistent hash key. This makes the decision transparent for the sender.2. The messages may implement
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
ConsistentHashingRouter.ConsistentHashableEnvelope
to 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
hashMapping
is tried first.- Parameters:
virtualNodesFactor
- number of virtual nodes per node, used inConsistentHash
hashMapping
- partial function from message to the data to use for the consistent hash keysystem
- the actor system hosting this router
-
$lessinit$greater$default$3
public scala.PartialFunction<java.lang.Object,java.lang.Object> $lessinit$greater$default$3()
-
defaultAddress
public Address defaultAddress(ActorSystem system)
-
apply
public ConsistentHashingRoutingLogic apply(ActorSystem system, int virtualNodesFactor, scala.PartialFunction<java.lang.Object,java.lang.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
/withHashMapper
of the router to map incoming messages to their consistent hash key. This makes the decision transparent for the sender.2. The messages may implement
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
ConsistentHashingRouter.ConsistentHashableEnvelope
to 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
hashMapping
is tried first.- Parameters:
virtualNodesFactor
- number of virtual nodes per node, used inConsistentHash
hashMapping
- 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
public scala.PartialFunction<java.lang.Object,java.lang.Object> apply$default$3()
-
unapply
public scala.Option<scala.Tuple3<ActorSystem,java.lang.Object,scala.PartialFunction<java.lang.Object,java.lang.Object>>> unapply(ConsistentHashingRoutingLogic x$0)
-
-