class ShardRegion extends Actor with ActorLogging

This actor creates children entity actors on demand for the shards that it is told to be responsible for. It delegates messages targeted to other shards to the responsible ShardRegion actor on other nodes.

Source
ShardRegion.scala
See also

ClusterSharding extension

Linear Supertypes
Type Hierarchy
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. ShardRegion
  2. ActorLogging
  3. Actor
  4. AnyRef
  5. Any
Implicitly
  1. by any2stringadd
  2. by StringFormat
  3. by Ensuring
  4. by ArrowAssoc
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new ShardRegion(typeName: String, entityProps: Option[Props], settings: ClusterShardingSettings, coordinatorPath: String, extractEntityId: ExtractEntityId, extractShardId: ExtractShardId, handOffStopMessage: Any)

Type Members

  1. type Receive = PartialFunction[Any, Unit]
    Definition Classes
    Actor

Value Members

  1. val ageOrdering: Ordering[Member]
  2. def askAllShards[T](msg: Any)(implicit arg0: ClassTag[T]): Future[Seq[(ShardId, T)]]
  3. def bufferMessage(shardId: ShardId, msg: Any, snd: ActorRef): Unit
  4. def changeMembers(newMembers: SortedSet[Member]): Unit
  5. val cluster: Cluster
  6. implicit val context: ActorContext

    Stores the context for this actor, including self, and sender.

    Stores the context for this actor, including self, and sender. It is implicit to support operations such as forward.

    WARNING: Only valid within the Actor itself, so do not close over it and publish it to other threads!

    akka.actor.ActorContext is the Scala API. getContext returns a akka.actor.UntypedActorContext, which is the Java API of the actor context.

    Definition Classes
    Actor
  7. var coordinator: Option[ActorRef]
  8. def coordinatorSelection: Option[ActorSelection]
  9. def deliverBufferedMessages(shardId: ShardId, receiver: ActorRef): Unit
  10. def deliverMessage(msg: Any, snd: ActorRef): Unit
  11. def getShard(id: ShardId): Option[ActorRef]
  12. var gracefulShutdownInProgress: Boolean
  13. var handingOff: Set[ActorRef]
  14. def initializeShard(id: ShardId, shard: ActorRef): Unit
  15. def log: LoggingAdapter
    Definition Classes
    ActorLogging
  16. var loggedFullBufferWarning: Boolean
  17. def matchingRole(member: Member): Boolean
  18. var membersByAge: SortedSet[Member]
  19. def postRestart(reason: Throwable): Unit

    User overridable callback: By default it calls preStart().

    User overridable callback: By default it calls preStart().

    reason

    the Throwable that caused the restart to happen Is called right AFTER restart on the newly created Actor to allow reinitialization after an Actor crash.

    Definition Classes
    Actor
    Annotations
    @throws( classOf[Exception] )
  20. def postStop(): Unit

    User overridable callback.

    User overridable callback.

    Is called asynchronously after 'actor.stop()' is invoked. Empty default implementation.

    Definition Classes
    ShardRegionActor
  21. def preRestart(reason: Throwable, message: Option[Any]): Unit

    User overridable callback: By default it disposes of all children and then calls postStop().

    User overridable callback: By default it disposes of all children and then calls postStop().

    reason

    the Throwable that caused the restart to happen

    message

    optionally the current message the actor processed when failing, if applicable Is called on a crashed Actor right BEFORE it is restarted to allow clean up of resources before Actor is terminated.

    Definition Classes
    Actor
    Annotations
    @throws( classOf[Exception] )
  22. def preStart(): Unit

    User overridable callback.

    User overridable callback.

    Is called when an Actor is started. Actors are automatically started asynchronously when created. Empty default implementation.

    Definition Classes
    ShardRegionActor
  23. def receive: PartialFunction[Any, Unit]

    This defines the initial actor behavior, it must return a partial function with the actor logic.

    This defines the initial actor behavior, it must return a partial function with the actor logic.

    Definition Classes
    ShardRegionActor
  24. def receiveClusterEvent(evt: ClusterDomainEvent): Unit
  25. def receiveClusterState(state: CurrentClusterState): Unit
  26. def receiveCommand(cmd: ShardRegionCommand): Unit
  27. def receiveCoordinatorMessage(msg: CoordinatorMessage): Unit
  28. def receiveQuery(query: ShardRegionQuery): Unit
  29. def receiveTerminated(ref: ActorRef): Unit
  30. var regionByShard: Map[ShardId, ActorRef]
  31. var regions: Map[ActorRef, Set[ShardId]]
  32. def register(): Unit
  33. def registrationMessage: Any
  34. def replyToRegionStateQuery(ref: ActorRef): Unit
  35. def replyToRegionStatsQuery(ref: ActorRef): Unit
  36. def requestShardBufferHomes(): Unit
  37. var retryCount: Int
  38. val retryTask: Cancellable
  39. implicit final val self: ActorRef

    The 'self' field holds the ActorRef for this actor.

    The 'self' field holds the ActorRef for this actor.

    Can be used to send messages to itself:

    self ! message
    

    Definition Classes
    Actor
  40. def sendGracefulShutdownToCoordinator(): Unit
  41. final def sender(): ActorRef

    The reference sender Actor of the last received message.

    The reference sender Actor of the last received message. Is defined if the message was sent from another Actor, else deadLetters in akka.actor.ActorSystem.

    WARNING: Only valid within the Actor itself, so do not close over it and publish it to other threads!

    Definition Classes
    Actor
  42. var shardBuffers: MessageBufferMap[ShardId]
  43. var shards: Map[ShardId, ActorRef]
  44. var shardsByRef: Map[ActorRef, ShardId]
  45. var startingShards: Set[ShardId]
  46. def supervisorStrategy: SupervisorStrategy

    User overridable definition the strategy to use for supervising child actors.

    User overridable definition the strategy to use for supervising child actors.

    Definition Classes
    Actor
  47. def unhandled(message: Any): Unit

    User overridable callback.

    User overridable callback.

    Is called when a message isn't handled by the current behavior of the actor by default it fails with either a akka.actor.DeathPactException (in case of an unhandled akka.actor.Terminated message) or publishes an akka.actor.UnhandledMessage to the actor's system's akka.event.EventStream

    Definition Classes
    Actor