Packages

class ClusterSingletonManager extends Actor with FSM[State, Data]

Manages singleton actor instance among all cluster nodes or a group of nodes tagged with a specific role. At most one singleton instance is running at any point in time.

The ClusterSingletonManager is supposed to be started on all nodes, or all nodes with specified role, in the cluster with actorOf. The actual singleton is started on the oldest node by creating a child actor from the supplied singletonProps.

The singleton actor is always running on the oldest member with specified role. The oldest member is determined by pekko.cluster.Member#isOlderThan. This can change when removing members. A graceful hand over can normally be performed when current oldest node is leaving the cluster. Be aware that there is a short time period when there is no active singleton during the hand-over process.

The cluster failure detector will notice when oldest node becomes unreachable due to things like JVM crash, hard shut down, or network failure. When the crashed node has been removed (via down) from the cluster then a new oldest node will take over and a new singleton actor is created. For these failure scenarios there will not be a graceful hand-over, but more than one active singletons is prevented by all reasonable means. Some corner cases are eventually resolved by configurable timeouts.

You access the singleton actor with ClusterSingletonProxy. Alternatively the singleton actor may broadcast its existence when it is started.

Use factory method ClusterSingletonManager#props to create the pekko.actor.Props for the actor.

Not intended for subclassing by user code.

Annotations
@DoNotInherit()
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. ClusterSingletonManager
  2. FSM
  3. ActorLogging
  4. Listeners
  5. Actor
  6. AnyRef
  7. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Instance Constructors

  1. new ClusterSingletonManager(singletonProps: Props, terminationMessage: Any, settings: ClusterSingletonManagerSettings)

    singletonProps

    pekko.actor.Props of the singleton actor instance.

    terminationMessage

    When handing over to a new oldest node this terminationMessage is sent to the singleton actor to tell it to finish its work, close resources, and stop. The hand-over to the new oldest node is completed when the singleton actor is terminated. Note that pekko.actor.PoisonPill is a perfectly fine terminationMessage if you only need to stop the actor.

    settings

    see ClusterSingletonManagerSettings

Type Members

  1. type Event = actor.FSM.Event[Data]
    Definition Classes
    FSM
  2. type Receive = PartialFunction[Any, Unit]
    Definition Classes
    Actor
  3. type State = actor.FSM.State[ClusterSingletonManager.State, Data]
    Definition Classes
    FSM
  4. type StateFunction = PartialFunction[Event, State]
    Definition Classes
    FSM
  5. type StopEvent = actor.FSM.StopEvent[ClusterSingletonManager.State, Data]
    Definition Classes
    FSM
  6. type Timeout = Option[FiniteDuration]
    Definition Classes
    FSM
  7. final class TransformHelper extends AnyRef
    Definition Classes
    FSM
  8. type TransitionHandler = PartialFunction[(ClusterSingletonManager.State, ClusterSingletonManager.State), Unit]
    Definition Classes
    FSM

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. val ->: actor.FSM.->.type
    Definition Classes
    FSM
  4. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  5. val Event: actor.FSM.Event.type
    Definition Classes
    FSM
  6. val StateTimeout: actor.FSM.StateTimeout.type
    Definition Classes
    FSM
  7. val StopEvent: actor.FSM.StopEvent.type
    Definition Classes
    FSM
  8. def addRemoved(node: UniqueAddress): Unit
  9. def aroundPostRestart(reason: Throwable): Unit
    Attributes
    protected[pekko]
    Definition Classes
    Actor
    Annotations
    @InternalApi()
  10. def aroundPostStop(): Unit
    Attributes
    protected[pekko]
    Definition Classes
    Actor
    Annotations
    @InternalApi()
  11. def aroundPreRestart(reason: Throwable, message: Option[Any]): Unit
    Attributes
    protected[pekko]
    Definition Classes
    Actor
    Annotations
    @InternalApi()
  12. def aroundPreStart(): Unit
    Attributes
    protected[pekko]
    Definition Classes
    Actor
    Annotations
    @InternalApi()
  13. def aroundReceive(receive: actor.Actor.Receive, msg: Any): Unit
    Attributes
    protected[pekko]
    Definition Classes
    Actor
    Annotations
    @InternalApi()
  14. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  15. final def cancelTimer(name: String): Unit
    Definition Classes
    FSM
  16. def cleanupOverdueNotMemberAnyMore(): Unit
  17. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native() @HotSpotIntrinsicCandidate()
  18. val cluster: Cluster
  19. implicit val context: ActorContext
    Definition Classes
    Actor
  20. val coordShutdown: CoordinatedShutdown
  21. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  22. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  23. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  24. def getNextOldestChanged(): Unit
  25. def gossip(msg: Any)(implicit sender: ActorRef): Unit
    Attributes
    protected
    Definition Classes
    Listeners
  26. final def goto(nextStateName: ClusterSingletonManager.State): State
    Definition Classes
    FSM
  27. def gotoHandingOver(singleton: Option[ActorRef], handOverTo: Option[ActorRef]): State
  28. def gotoOldest(): State
    Annotations
    @InternalStableApi()
  29. def gotoStopping(singleton: ActorRef): State
  30. def handOverDone(handOverTo: Option[ActorRef]): State
  31. def handleMemberEvent(event: MemberEvent): State
  32. def handleOldestChanged(singleton: Option[ActorRef], oldestOption: Option[UniqueAddress]): State
  33. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  34. final def initialize(): Unit
    Definition Classes
    FSM
  35. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  36. final def isTimerActive(name: String): Boolean
    Definition Classes
    FSM
  37. val lease: Option[Lease]
  38. val leaseRetryInterval: FiniteDuration
  39. def listenerManagement: actor.Actor.Receive
    Attributes
    protected
    Definition Classes
    Listeners
  40. val listeners: Set[ActorRef]
    Attributes
    protected
    Definition Classes
    Listeners
  41. val log: MarkerLoggingAdapter
    Definition Classes
    ClusterSingletonManager → ActorLogging
  42. def logInfo(template: String, arg1: Any, arg2: Any, arg3: Any): Unit
  43. def logInfo(marker: LogMarker, template: String, arg1: Any, arg2: Any): Unit
  44. def logInfo(template: String, arg1: Any, arg2: Any): Unit
  45. def logInfo(marker: LogMarker, template: String, arg1: Any): Unit
  46. def logInfo(template: String, arg1: Any): Unit
  47. def logInfo(marker: LogMarker, message: String): Unit
  48. def logInfo(message: String): Unit
  49. def logTermination(reason: Reason): Unit
    Attributes
    protected
    Definition Classes
    FSM
  50. val maxHandOverRetries: Int
  51. val maxTakeOverRetries: Int
  52. val memberExitingProgress: Promise[Done]
  53. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  54. final def nextStateData: Data
    Definition Classes
    FSM
  55. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  56. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  57. var oldestChangedBuffer: ActorRef
  58. var oldestChangedReceived: Boolean
  59. final def onTermination(terminationHandler: PartialFunction[StopEvent, Unit]): Unit
    Definition Classes
    FSM
  60. final def onTransition(transitionHandler: TransitionHandler): Unit
    Definition Classes
    FSM
  61. def peer(at: Address): ActorSelection
  62. def postRestart(reason: Throwable): Unit
    Definition Classes
    Actor
    Annotations
    @throws(classOf[java.lang.Exception])
  63. def postStop(): Unit
    Definition Classes
    ClusterSingletonManager → FSM → Actor
  64. def preRestart(reason: Throwable, message: Option[Any]): Unit
    Definition Classes
    Actor
    Annotations
    @throws(classOf[java.lang.Exception])
  65. def preStart(): Unit
    Definition Classes
    ClusterSingletonManager → Actor
  66. var preparingForFullShutdown: Boolean
  67. def receive: Receive
    Definition Classes
    FSM → Actor
  68. val removalMargin: FiniteDuration
  69. var removed: Map[UniqueAddress, Deadline]
  70. def scheduleDelayedMemberRemoved(m: Member): Unit
  71. implicit final val self: ActorRef
    Definition Classes
    Actor
  72. var selfExited: Boolean
  73. def selfMemberExited(): Unit
  74. val selfUniqueAddressOption: Some[UniqueAddress]
  75. final def sender(): ActorRef
    Definition Classes
    Actor
  76. final def setStateTimeout(state: ClusterSingletonManager.State, timeout: Timeout): Unit
    Definition Classes
    FSM
  77. def startSingleTimer(name: String, msg: Any, delay: FiniteDuration): Unit
    Definition Classes
    FSM
  78. def startTimerAtFixedRate(name: String, msg: Any, interval: FiniteDuration): Unit
    Definition Classes
    FSM
  79. def startTimerWithFixedDelay(name: String, msg: Any, delay: FiniteDuration): Unit
    Definition Classes
    FSM
  80. final def startWith(stateName: ClusterSingletonManager.State, stateData: Data, timeout: Timeout): Unit
    Definition Classes
    FSM
  81. final def stateData: Data
    Definition Classes
    FSM
  82. final def stateName: ClusterSingletonManager.State
    Definition Classes
    FSM
  83. final def stay(): State
    Definition Classes
    FSM
  84. final def stop(reason: Reason, stateData: Data): State
    Definition Classes
    FSM
  85. final def stop(reason: Reason): State
    Definition Classes
    FSM
  86. final def stop(): State
    Definition Classes
    FSM
  87. def supervisorStrategy: SupervisorStrategy
    Definition Classes
    Actor
  88. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  89. def toString(): String
    Definition Classes
    AnyRef → Any
  90. implicit final def total2pf(transitionHandler: (ClusterSingletonManager.State, ClusterSingletonManager.State) => Unit): TransitionHandler
    Definition Classes
    FSM
  91. final def transform(func: StateFunction): TransformHelper
    Definition Classes
    FSM
  92. def tryAcquireLease(): actor.FSM.State[ClusterSingletonManager.State, Data]
  93. def tryGotoOldest(): State
  94. def unhandled(message: Any): Unit
    Definition Classes
    Actor
  95. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  96. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  97. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  98. final def when(stateName: ClusterSingletonManager.State, stateTimeout: FiniteDuration)(stateFunction: StateFunction): Unit
    Definition Classes
    FSM
  99. final def whenUnhandled(stateFunction: StateFunction): Unit
    Definition Classes
    FSM

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable]) @Deprecated @Deprecated
    Deprecated
  2. final def setTimer(name: String, msg: Any, timeout: FiniteDuration, repeat: Boolean): Unit
    Definition Classes
    FSM
    Annotations
    @deprecated
    Deprecated

    (Since version Akka 2.6.0) Use startSingleTimer, startTimerWithFixedDelay or startTimerAtFixedRate instead. This has the same semantics as startTimerAtFixedRate, but startTimerWithFixedDelay is often preferred.

Inherited from ActorLogging

Inherited from Listeners

Inherited from Actor

Inherited from AnyRef

Inherited from Any

Ungrouped