|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectakka.contrib.pattern.ClusterSharding
public class ClusterSharding
ClusterSharding companion object
Nested Class Summary | |
---|---|
class |
ClusterSharding.Settings$
INTERNAL API |
Constructor Summary | |
---|---|
ClusterSharding(ExtendedActorSystem system)
|
Method Summary | |
---|---|
static ClusterSharding |
createExtension(ExtendedActorSystem system)
|
static ClusterSharding |
get(ActorSystem system)
|
static ClusterSharding$ |
lookup()
|
ClusterSharding.Settings$ |
Settings()
Accessor for nested Scala object |
ActorRef |
shardRegion(java.lang.String typeName)
Retrieve the actor reference of the ShardRegion actor responsible for the named entry type. |
ActorRef |
start(java.lang.String typeName,
scala.Option<Props> entryProps,
scala.PartialFunction<java.lang.Object,scala.Tuple2<java.lang.String,java.lang.Object>> idExtractor,
scala.Function1<java.lang.Object,java.lang.String> shardResolver)
Register a named entry type by defining the Props of the entry actor and
functions to extract entry and shard identifier from messages. |
ActorRef |
start(java.lang.String typeName,
scala.Option<Props> entryProps,
scala.PartialFunction<java.lang.Object,scala.Tuple2<java.lang.String,java.lang.Object>> idExtractor,
scala.Function1<java.lang.Object,java.lang.String> shardResolver,
ShardCoordinator.ShardAllocationStrategy allocationStrategy)
Scala API: Register a named entry type by defining the Props of the entry actor
and functions to extract entry and shard identifier from messages. |
ActorRef |
start(java.lang.String typeName,
Props entryProps,
ShardRegion.MessageExtractor messageExtractor)
Java API: Register a named entry type by defining the Props of the entry actor
and functions to extract entry and shard identifier from messages. |
ActorRef |
start(java.lang.String typeName,
Props entryProps,
ShardRegion.MessageExtractor messageExtractor,
ShardCoordinator.ShardAllocationStrategy allocationStrategy)
Java API: Register a named entry type by defining the Props of the entry actor
and functions to extract entry and shard identifier from messages. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ClusterSharding(ExtendedActorSystem system)
Method Detail |
---|
public static ClusterSharding get(ActorSystem system)
public static ClusterSharding$ lookup()
public static ClusterSharding createExtension(ExtendedActorSystem system)
public ClusterSharding.Settings$ Settings()
public ActorRef start(java.lang.String typeName, scala.Option<Props> entryProps, scala.PartialFunction<java.lang.Object,scala.Tuple2<java.lang.String,java.lang.Object>> idExtractor, scala.Function1<java.lang.Object,java.lang.String> shardResolver, ShardCoordinator.ShardAllocationStrategy allocationStrategy)
Props
of the entry actor
and functions to extract entry and shard identifier from messages. The ShardRegion
actor
for this type can later be retrieved with the shardRegion(java.lang.String)
method.
Some settings can be configured as described in the akka.contrib.cluster.sharding
section
of the reference.conf
.
typeName
- the name of the entry typeentryProps
- the Props
of the entry actors that will be created by the ShardRegion
,
if not defined (None) the ShardRegion
on this node will run in proxy only mode, i.e.
it will delegate messages to other ShardRegion
actors on other nodes, but not host any
entry actors itselfidExtractor
- partial function to extract the entry id and the message to send to the
entry from the incoming message, if the partial function does not match the message will
be unhandled
, i.e. posted as Unhandled
messages on the event streamshardResolver
- function to determine the shard id for an incoming message, only messages
that passed the idExtractor
will be usedallocationStrategy
- possibility to use a custom shard allocation and
rebalancing logic
ShardRegion
that is to be responsible for the shardpublic ActorRef start(java.lang.String typeName, scala.Option<Props> entryProps, scala.PartialFunction<java.lang.Object,scala.Tuple2<java.lang.String,java.lang.Object>> idExtractor, scala.Function1<java.lang.Object,java.lang.String> shardResolver)
Props
of the entry actor and
functions to extract entry and shard identifier from messages. The ShardRegion
actor
for this type can later be retrieved with the shardRegion(java.lang.String)
method.
The default shard allocation strategy ShardCoordinator.LeastShardAllocationStrategy
is used.
Some settings can be configured as described in the akka.contrib.cluster.sharding
section
of the reference.conf
.
typeName
- the name of the entry typeentryProps
- the Props
of the entry actors that will be created by the ShardRegion
,
if not defined (None) the ShardRegion
on this node will run in proxy only mode, i.e.
it will delegate messages to other ShardRegion
actors on other nodes, but not host any
entry actors itselfidExtractor
- partial function to extract the entry id and the message to send to the
entry from the incoming message, if the partial function does not match the message will
be unhandled
, i.e. posted as Unhandled
messages on the event streamshardResolver
- function to determine the shard id for an incoming message, only messages
that passed the idExtractor
will be used
ShardRegion
that is to be responsible for the shardpublic ActorRef start(java.lang.String typeName, Props entryProps, ShardRegion.MessageExtractor messageExtractor, ShardCoordinator.ShardAllocationStrategy allocationStrategy)
Props
of the entry actor
and functions to extract entry and shard identifier from messages. The ShardRegion
actor
for this type can later be retrieved with the shardRegion(java.lang.String)
method.
Some settings can be configured as described in the akka.contrib.cluster.sharding
section
of the reference.conf
.
typeName
- the name of the entry typeentryProps
- the Props
of the entry actors that will be created by the ShardRegion
,
if not defined (null) the ShardRegion
on this node will run in proxy only mode, i.e.
it will delegate messages to other ShardRegion
actors on other nodes, but not host any
entry actors itselfmessageExtractor
- functions to extract the entry id, shard id, and the message to send to the
entry from the incoming messageallocationStrategy
- possibility to use a custom shard allocation and
rebalancing logic
ShardRegion
that is to be responsible for the shardpublic ActorRef start(java.lang.String typeName, Props entryProps, ShardRegion.MessageExtractor messageExtractor)
Props
of the entry actor
and functions to extract entry and shard identifier from messages. The ShardRegion
actor
for this type can later be retrieved with the shardRegion(java.lang.String)
method.
The default shard allocation strategy ShardCoordinator.LeastShardAllocationStrategy
is used.
Some settings can be configured as described in the akka.contrib.cluster.sharding
section
of the reference.conf
.
typeName
- the name of the entry typeentryProps
- the Props
of the entry actors that will be created by the ShardRegion
,
if not defined (null) the ShardRegion
on this node will run in proxy only mode, i.e.
it will delegate messages to other ShardRegion
actors on other nodes, but not host any
entry actors itselfmessageExtractor
- functions to extract the entry id, shard id, and the message to send to the
entry from the incoming message
ShardRegion
that is to be responsible for the shardpublic ActorRef shardRegion(java.lang.String typeName)
ShardRegion
actor responsible for the named entry type.
The entry type must be registered with the start(java.lang.String, scala.Option, scala.PartialFunction>, scala.Function1, akka.contrib.pattern.ShardCoordinator.ShardAllocationStrategy)
method before it can be used here.
Messages to the entry is always sent via the ShardRegion
.
typeName
- (undocumented)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |