class ClusterSharding extends Extension
- Alphabetic
- By Inheritance
- ClusterSharding
- Extension
- AnyRef
- Any
- by any2stringadd
- by StringFormat
- by Ensuring
- by ArrowAssoc
- Hide All
- Show All
- Public
- Protected
Instance Constructors
- new ClusterSharding(system: ExtendedActorSystem)
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- def +(other: String): String
- Implicit
- This member is added by an implicit conversion from ClusterSharding toany2stringadd[ClusterSharding] performed by method any2stringadd in scala.Predef.
- Definition Classes
- any2stringadd
- def ->[B](y: B): (ClusterSharding, B)
- Implicit
- This member is added by an implicit conversion from ClusterSharding toArrowAssoc[ClusterSharding] performed by method ArrowAssoc in scala.Predef.
- Definition Classes
- ArrowAssoc
- Annotations
- @inline()
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @HotSpotIntrinsicCandidate() @native()
- def defaultShardAllocationStrategy(settings: ClusterShardingSettings): ShardAllocationStrategy
The default
ShardAllocationStrategy
is configured byleast-shard-allocation-strategy
properties. - def ensuring(cond: (ClusterSharding) => Boolean, msg: => Any): ClusterSharding
- Implicit
- This member is added by an implicit conversion from ClusterSharding toEnsuring[ClusterSharding] performed by method Ensuring in scala.Predef.
- Definition Classes
- Ensuring
- def ensuring(cond: (ClusterSharding) => Boolean): ClusterSharding
- Implicit
- This member is added by an implicit conversion from ClusterSharding toEnsuring[ClusterSharding] performed by method Ensuring in scala.Predef.
- Definition Classes
- Ensuring
- def ensuring(cond: Boolean, msg: => Any): ClusterSharding
- Implicit
- This member is added by an implicit conversion from ClusterSharding toEnsuring[ClusterSharding] performed by method Ensuring in scala.Predef.
- Definition Classes
- Ensuring
- def ensuring(cond: Boolean): ClusterSharding
- Implicit
- This member is added by an implicit conversion from ClusterSharding toEnsuring[ClusterSharding] performed by method Ensuring in scala.Predef.
- Definition Classes
- Ensuring
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @HotSpotIntrinsicCandidate() @native()
- def getShardTypeNames: Set[String]
Java API: get all currently defined sharding type names.
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @HotSpotIntrinsicCandidate() @native()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @HotSpotIntrinsicCandidate() @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @HotSpotIntrinsicCandidate() @native()
- def shardRegion(typeName: String): ActorRef
Retrieve the actor reference of the ShardRegion actor responsible for the named entity type.
Retrieve the actor reference of the ShardRegion actor responsible for the named entity type. The entity type must be registered with the #start or #startProxy method before it can be used here. Messages to the entity is always sent via the
ShardRegion
. - def shardRegionProxy(typeName: String, dataCenter: DataCenter): ActorRef
Retrieve the actor reference of the ShardRegion actor that will act as a proxy to the named entity type running in another data center.
Retrieve the actor reference of the ShardRegion actor that will act as a proxy to the named entity type running in another data center. A proxy within the same data center can be accessed with #shardRegion instead of this method. The entity type must be registered with the #startProxy method before it can be used here. Messages to the entity is always sent via the
ShardRegion
. - def shardTypeNames: Set[String]
Scala API: get all currently defined sharding type names.
- def start(typeName: String, entityProps: Props, messageExtractor: MessageExtractor): ActorRef
Java/Scala API: Register a named entity type by defining the pekko.actor.Props of the entity actor and functions to extract entity and shard identifier from messages.
Java/Scala API: Register a named entity type by defining the pekko.actor.Props of the entity actor and functions to extract entity and shard identifier from messages. The ShardRegion actor for this type can later be retrieved with the #shardRegion method.
The default shard allocation strategy ShardCoordinator.LeastShardAllocationStrategy is used. pekko.actor.PoisonPill is used as
handOffStopMessage
.This method will start a ShardRegion in proxy mode when there is no match between the node roles and the role specified in the ClusterShardingSettings passed to this method.
Some settings can be configured as described in the
pekko.cluster.sharding
section of thereference.conf
.- typeName
the name of the entity type
- entityProps
the
Props
of the entity actors that will be created by theShardRegion
- messageExtractor
functions to extract the entity id, shard id, and the message to send to the entity from the incoming message
- returns
the actor ref of the ShardRegion that is to be responsible for the shard
- def start(typeName: String, entityProps: Props, settings: ClusterShardingSettings, messageExtractor: MessageExtractor): ActorRef
Java/Scala API: Register a named entity type by defining the pekko.actor.Props of the entity actor and functions to extract entity and shard identifier from messages.
Java/Scala API: Register a named entity type by defining the pekko.actor.Props of the entity actor and functions to extract entity and shard identifier from messages. The ShardRegion actor for this type can later be retrieved with the #shardRegion method.
The default shard allocation strategy ShardCoordinator.LeastShardAllocationStrategy is used. pekko.actor.PoisonPill is used as
handOffStopMessage
.This method will start a ShardRegion in proxy mode when there is no match between the node roles and the role specified in the ClusterShardingSettings passed to this method.
Some settings can be configured as described in the
pekko.cluster.sharding
section of thereference.conf
.- typeName
the name of the entity type
- entityProps
the
Props
of the entity actors that will be created by theShardRegion
- settings
configuration settings, see ClusterShardingSettings
- messageExtractor
functions to extract the entity id, shard id, and the message to send to the entity from the incoming message
- returns
the actor ref of the ShardRegion that is to be responsible for the shard
- def start(typeName: String, entityProps: Props, settings: ClusterShardingSettings, messageExtractor: MessageExtractor, allocationStrategy: ShardAllocationStrategy, handOffStopMessage: Any): ActorRef
Java/Scala API: Register a named entity type by defining the pekko.actor.Props of the entity actor and functions to extract entity and shard identifier from messages.
Java/Scala API: Register a named entity type by defining the pekko.actor.Props of the entity actor and functions to extract entity and shard identifier from messages. The ShardRegion actor for this type can later be retrieved with the #shardRegion method.
This method will start a ShardRegion in proxy mode when there is no match between the node roles and the role specified in the ClusterShardingSettings passed to this method.
Some settings can be configured as described in the
pekko.cluster.sharding
section of thereference.conf
.- typeName
the name of the entity type
- entityProps
the
Props
of the entity actors that will be created by theShardRegion
- settings
configuration settings, see ClusterShardingSettings
- messageExtractor
functions to extract the entity id, shard id, and the message to send to the entity from the incoming message, see ShardRegion.MessageExtractor
- allocationStrategy
possibility to use a custom shard allocation and rebalancing logic
- handOffStopMessage
the message that will be sent to entities when they are to be stopped for a rebalance or graceful shutdown of a
ShardRegion
, e.g.PoisonPill
.- returns
the actor ref of the ShardRegion that is to be responsible for the shard
- def start(typeName: String, entityProps: Props, extractEntityId: ExtractEntityId, extractShardId: ExtractShardId): ActorRef
Register a named entity type by defining the pekko.actor.Props of the entity actor and functions to extract entity and shard identifier from messages.
Register a named entity type by defining the pekko.actor.Props of the entity actor and functions to extract entity and shard identifier from messages. The ShardRegion actor for this type can later be retrieved with the shardRegion method.
The default shard allocation strategy ShardCoordinator.LeastShardAllocationStrategy is used. pekko.actor.PoisonPill is used as
handOffStopMessage
.This method will start a ShardRegion in proxy mode when there is no match between the node roles and the role specified in the ClusterShardingSettings passed to this method.
Some settings can be configured as described in the
pekko.cluster.sharding
section of thereference.conf
.- typeName
the name of the entity type
- entityProps
the
Props
of the entity actors that will be created by theShardRegion
- extractEntityId
partial function to extract the entity id and the message to send to the entity from the incoming message, if the partial function does not match the message will be
unhandled
, i.e. posted asUnhandled
messages on the event stream- extractShardId
function to determine the shard id for an incoming message, only messages that passed the
extractEntityId
will be used- returns
the actor ref of the ShardRegion that is to be responsible for the shard
- def start(typeName: String, entityProps: Props, settings: ClusterShardingSettings, extractEntityId: ExtractEntityId, extractShardId: ExtractShardId): ActorRef
Register a named entity type by defining the pekko.actor.Props of the entity actor and functions to extract entity and shard identifier from messages.
Register a named entity type by defining the pekko.actor.Props of the entity actor and functions to extract entity and shard identifier from messages. The ShardRegion actor for this type can later be retrieved with the shardRegion method.
The default shard allocation strategy ShardCoordinator.LeastShardAllocationStrategy is used. pekko.actor.PoisonPill is used as
handOffStopMessage
.This method will start a ShardRegion in proxy mode when there is no match between the node roles and the role specified in the ClusterShardingSettings passed to this method.
Some settings can be configured as described in the
pekko.cluster.sharding
section of thereference.conf
.- typeName
the name of the entity type
- entityProps
the
Props
of the entity actors that will be created by theShardRegion
- settings
configuration settings, see ClusterShardingSettings
- extractEntityId
partial function to extract the entity id and the message to send to the entity from the incoming message, if the partial function does not match the message will be
unhandled
, i.e. posted asUnhandled
messages on the event stream- extractShardId
function to determine the shard id for an incoming message, only messages that passed the
extractEntityId
will be used- returns
the actor ref of the ShardRegion that is to be responsible for the shard
- def start(typeName: String, entityProps: Props, extractEntityId: ExtractEntityId, extractShardId: ExtractShardId, allocationStrategy: ShardAllocationStrategy, handOffStopMessage: Any): ActorRef
Scala API: Register a named entity type by defining the pekko.actor.Props of the entity actor and functions to extract entity and shard identifier from messages.
Scala API: Register a named entity type by defining the pekko.actor.Props of the entity actor and functions to extract entity and shard identifier from messages. The ShardRegion actor for this type can later be retrieved with the shardRegion method.
This method will start a ShardRegion in proxy mode when there is no match between the roles of the current cluster node and the role specified in ClusterShardingSettings passed to this method.
Some settings can be configured as described in the
pekko.cluster.sharding
section of thereference.conf
.- typeName
the name of the entity type
- entityProps
the
Props
of the entity actors that will be created by theShardRegion
- extractEntityId
partial function to extract the entity id and the message to send to the entity from the incoming message, if the partial function does not match the message will be
unhandled
, i.e. posted asUnhandled
messages on the event stream- extractShardId
function to determine the shard id for an incoming message, only messages that passed the
extractEntityId
will be used- allocationStrategy
possibility to use a custom shard allocation and rebalancing logic
- handOffStopMessage
the message that will be sent to entities when they are to be stopped for a rebalance or graceful shutdown of a
ShardRegion
, e.g.PoisonPill
.- returns
the actor ref of the ShardRegion that is to be responsible for the shard
- def start(typeName: String, entityProps: Props, settings: ClusterShardingSettings, extractEntityId: ExtractEntityId, extractShardId: ExtractShardId, allocationStrategy: ShardAllocationStrategy, handOffStopMessage: Any): ActorRef
Scala API: Register a named entity type by defining the pekko.actor.Props of the entity actor and functions to extract entity and shard identifier from messages.
Scala API: Register a named entity type by defining the pekko.actor.Props of the entity actor and functions to extract entity and shard identifier from messages. The ShardRegion actor for this type can later be retrieved with the shardRegion method.
This method will start a ShardRegion in proxy mode when there is no match between the roles of the current cluster node and the role specified in ClusterShardingSettings passed to this method.
Some settings can be configured as described in the
pekko.cluster.sharding
section of thereference.conf
.- typeName
the name of the entity type
- entityProps
the
Props
of the entity actors that will be created by theShardRegion
- settings
configuration settings, see ClusterShardingSettings
- extractEntityId
partial function to extract the entity id and the message to send to the entity from the incoming message, if the partial function does not match the message will be
unhandled
, i.e. posted asUnhandled
messages on the event stream- extractShardId
function to determine the shard id for an incoming message, only messages that passed the
extractEntityId
will be used- allocationStrategy
possibility to use a custom shard allocation and rebalancing logic
- handOffStopMessage
the message that will be sent to entities when they are to be stopped for a rebalance or graceful shutdown of a
ShardRegion
, e.g.PoisonPill
.- returns
the actor ref of the ShardRegion that is to be responsible for the shard
- def startProxy(typeName: String, role: Optional[String], dataCenter: Optional[String], messageExtractor: MessageExtractor): ActorRef
Java/Scala API: Register a named entity type
ShardRegion
on this node that will run in proxy only mode, i.e.Java/Scala API: Register a named entity type
ShardRegion
on this node that will run in proxy only mode, i.e. it will delegate messages to otherShardRegion
actors on other nodes, but not host any entity actors itself. The ShardRegion actor for this type can later be retrieved with the #shardRegion method.Some settings can be configured as described in the
pekko.cluster.sharding
section of thereference.conf
.- typeName
the name of the entity type
- role
specifies that this entity type is located on cluster nodes with a specific role. If the role is not specified all nodes in the cluster are used.
- dataCenter
The data center of the cluster nodes where the cluster sharding is running. If None then the same data center as current node.
- messageExtractor
functions to extract the entity id, shard id, and the message to send to the entity from the incoming message
- returns
the actor ref of the ShardRegion that is to be responsible for the shard
- def startProxy(typeName: String, role: Optional[String], messageExtractor: MessageExtractor): ActorRef
Java/Scala API: Register a named entity type
ShardRegion
on this node that will run in proxy only mode, i.e.Java/Scala API: Register a named entity type
ShardRegion
on this node that will run in proxy only mode, i.e. it will delegate messages to otherShardRegion
actors on other nodes, but not host any entity actors itself. The ShardRegion actor for this type can later be retrieved with the #shardRegion method.Some settings can be configured as described in the
pekko.cluster.sharding
section of thereference.conf
.- typeName
the name of the entity type
- role
specifies that this entity type is located on cluster nodes with a specific role. If the role is not specified all nodes in the cluster are used.
- messageExtractor
functions to extract the entity id, shard id, and the message to send to the entity from the incoming message
- returns
the actor ref of the ShardRegion that is to be responsible for the shard
- def startProxy(typeName: String, role: Option[String], dataCenter: Option[DataCenter], extractEntityId: ExtractEntityId, extractShardId: ExtractShardId): ActorRef
Scala API: Register a named entity type
ShardRegion
on this node that will run in proxy only mode, i.e.Scala API: Register a named entity type
ShardRegion
on this node that will run in proxy only mode, i.e. it will delegate messages to otherShardRegion
actors on other nodes, but not host any entity actors itself. The ShardRegion actor for this type can later be retrieved with the #shardRegion method.Some settings can be configured as described in the
pekko.cluster.sharding
section of thereference.conf
.- typeName
the name of the entity type
- role
specifies that this entity type is located on cluster nodes with a specific role. If the role is not specified all nodes in the cluster are used.
- dataCenter
The data center of the cluster nodes where the cluster sharding is running. If None then the same data center as current node.
- extractEntityId
partial function to extract the entity id and the message to send to the entity from the incoming message, if the partial function does not match the message will be
unhandled
, i.e. posted asUnhandled
messages on the event stream- extractShardId
function to determine the shard id for an incoming message, only messages that passed the
extractEntityId
will be used- returns
the actor ref of the ShardRegion that is to be responsible for the shard
- def startProxy(typeName: String, role: Option[String], extractEntityId: ExtractEntityId, extractShardId: ExtractShardId): ActorRef
Scala API: Register a named entity type
ShardRegion
on this node that will run in proxy only mode, i.e.Scala API: Register a named entity type
ShardRegion
on this node that will run in proxy only mode, i.e. it will delegate messages to otherShardRegion
actors on other nodes, but not host any entity actors itself. The ShardRegion actor for this type can later be retrieved with the #shardRegion method.Some settings can be configured as described in the
pekko.cluster.sharding
section of thereference.conf
.- typeName
the name of the entity type
- role
specifies that this entity type is located on cluster nodes with a specific role. If the role is not specified all nodes in the cluster are used.
- extractEntityId
partial function to extract the entity id and the message to send to the entity from the incoming message, if the partial function does not match the message will be
unhandled
, i.e. posted asUnhandled
messages on the event stream- extractShardId
function to determine the shard id for an incoming message, only messages that passed the
extractEntityId
will be used- returns
the actor ref of the ShardRegion that is to be responsible for the shard
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
Deprecated Value Members
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable]) @Deprecated
- Deprecated
(Since version 9)
- def formatted(fmtstr: String): String
- Implicit
- This member is added by an implicit conversion from ClusterSharding toStringFormat[ClusterSharding] performed by method StringFormat in scala.Predef.
- Definition Classes
- StringFormat
- Annotations
- @deprecated @inline()
- Deprecated
(Since version 2.12.16) Use
formatString.format(value)
instead ofvalue.formatted(formatString)
, or use thef""
string interpolator. In Java 15 and later,formatted
resolves to the new method in String which has reversed parameters.
- def →[B](y: B): (ClusterSharding, B)
- Implicit
- This member is added by an implicit conversion from ClusterSharding toArrowAssoc[ClusterSharding] performed by method ArrowAssoc in scala.Predef.
- Definition Classes
- ArrowAssoc
- Annotations
- @deprecated
- Deprecated
(Since version 2.13.0) Use
->
instead. If you still wish to display it as one character, consider using a font with programming ligatures such as Fira Code.