Class/Object

akka.cluster

Cluster

Related Docs: object Cluster | package cluster

Permalink

class Cluster extends Extension

This module is responsible cluster membership information. Changes to the cluster information is retrieved through #subscribe. Commands to operate the cluster is available through methods in this class, such as #join, #down and #leave.

Each cluster Member is identified by its akka.actor.Address, and the cluster address of this actor system is #selfAddress. A member also has a status; initially MemberStatus Joining followed by MemberStatus Up.

Source
Cluster.scala
Linear Supertypes
Type Hierarchy
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Cluster
  2. Extension
  3. AnyRef
  4. 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 Cluster(system: ExtendedActorSystem)

    Permalink

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. def +(other: String): String

    Permalink
    Implicit information
    This member is added by an implicit conversion from Cluster to any2stringadd[Cluster] performed by method any2stringadd in scala.Predef.
    Definition Classes
    any2stringadd
  4. def ->[B](y: B): (Cluster, B)

    Permalink
    Implicit information
    This member is added by an implicit conversion from Cluster to ArrowAssoc[Cluster] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc
    Annotations
    @inline()
  5. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  6. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  7. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  8. val crossDcFailureDetector: FailureDetectorRegistry[Address]

    Permalink
  9. def down(address: Address): Unit

    Permalink

    Send command to DOWN the node specified by 'address'.

    Send command to DOWN the node specified by 'address'.

    When a member is considered by the failure detector to be unreachable the leader is not allowed to perform its duties, such as changing status of new joining members to 'Up'. The status of the unreachable member must be changed to 'Down', which can be done with this method.

  10. lazy val downingProvider: DowningProvider

    Permalink
  11. def ensuring(cond: (Cluster) ⇒ Boolean, msg: ⇒ Any): Cluster

    Permalink
    Implicit information
    This member is added by an implicit conversion from Cluster to Ensuring[Cluster] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  12. def ensuring(cond: (Cluster) ⇒ Boolean): Cluster

    Permalink
    Implicit information
    This member is added by an implicit conversion from Cluster to Ensuring[Cluster] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  13. def ensuring(cond: Boolean, msg: ⇒ Any): Cluster

    Permalink
    Implicit information
    This member is added by an implicit conversion from Cluster to Ensuring[Cluster] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  14. def ensuring(cond: Boolean): Cluster

    Permalink
    Implicit information
    This member is added by an implicit conversion from Cluster to Ensuring[Cluster] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  15. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  16. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  17. val failureDetector: FailureDetectorRegistry[Address]

    Permalink
  18. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  19. def formatted(fmtstr: String): String

    Permalink
    Implicit information
    This member is added by an implicit conversion from Cluster to StringFormat[Cluster] performed by method StringFormat in scala.Predef.
    Definition Classes
    StringFormat
    Annotations
    @inline()
  20. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  21. def getSelfRoles: Set[String]

    Permalink

    Java API: roles that this member has

    Java API: roles that this member has

    Annotations
    @silent()
  22. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  23. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  24. def isTerminated: Boolean

    Permalink

    Returns true if this cluster instance has be shutdown.

  25. def join(address: Address): Unit

    Permalink

    Try to join this cluster node with the node specified by 'address'.

    Try to join this cluster node with the node specified by 'address'. A 'Join(selfAddress)' command is sent to the node to join.

    An actor system can only join a cluster once. Additional attempts will be ignored. When it has successfully joined it must be restarted to be able to join another cluster or to join the same cluster again.

    The name of the akka.actor.ActorSystem must be the same for all members of a cluster.

  26. def joinSeedNodes(seedNodes: List[Address]): Unit

    Permalink

    Java API

    Java API

    Join the specified seed nodes without defining them in config. Especially useful from tests when Addresses are unknown before startup time.

    An actor system can only join a cluster once. Additional attempts will be ignored. When it has successfully joined it must be restarted to be able to join another cluster or to join the same cluster again.

  27. def joinSeedNodes(seedNodes: Seq[Address]): Unit

    Permalink

    Join the specified seed nodes without defining them in config.

    Join the specified seed nodes without defining them in config. Especially useful from tests when Addresses are unknown before startup time.

    An actor system can only join a cluster once. Additional attempts will be ignored. When it has successfully joined it must be restarted to be able to join another cluster or to join the same cluster again.

  28. def leave(address: Address): Unit

    Permalink

    Send command to issue state transition to LEAVING for the node specified by 'address'.

    Send command to issue state transition to LEAVING for the node specified by 'address'. The member will go through the status changes MemberStatus Leaving (not published to subscribers) followed by MemberStatus Exiting and finally MemberStatus Removed.

    Note that this command can be issued to any member in the cluster, not necessarily the one that is leaving. The cluster extension, but not the actor system or JVM, of the leaving member will be shutdown after the leader has changed status of the member to Exiting. Thereafter the member will be removed from the cluster. Normally this is handled automatically, but in case of network failures during this process it might still be necessary to set the node’s status to Down in order to complete the removal.

  29. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  30. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  31. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  32. def registerOnMemberRemoved(callback: Runnable): Unit

    Permalink

    Java API: The supplied thunk will be run, once, when current cluster member is Removed.

    Java API: The supplied thunk will be run, once, when current cluster member is Removed. If the cluster has already been shutdown the thunk will run on the caller thread immediately. Typically used together cluster.leave(cluster.selfAddress) and then system.terminate().

  33. def registerOnMemberRemoved[T](code: ⇒ T): Unit

    Permalink

    The supplied thunk will be run, once, when current cluster member is Removed.

    The supplied thunk will be run, once, when current cluster member is Removed. If the cluster has already been shutdown the thunk will run on the caller thread immediately. Typically used together cluster.leave(cluster.selfAddress) and then system.terminate().

  34. def registerOnMemberUp(callback: Runnable): Unit

    Permalink

    Java API: The supplied callback will be run, once, when current cluster member is Up.

    Java API: The supplied callback will be run, once, when current cluster member is Up. Typically used together with configuration option akka.cluster.min-nr-of-members to defer some action, such as starting actors, until the cluster has reached a certain size.

  35. def registerOnMemberUp[T](code: ⇒ T): Unit

    Permalink

    The supplied thunk will be run, once, when current cluster member is Up.

    The supplied thunk will be run, once, when current cluster member is Up. Typically used together with configuration option akka.cluster.min-nr-of-members to defer some action, such as starting actors, until the cluster has reached a certain size.

  36. def remotePathOf(actorRef: ActorRef): ActorPath

    Permalink

    Generate the remote actor path by replacing the Address in the RootActor Path for the given ActorRef with the cluster's selfAddress, unless address' host is already defined

  37. def selfAddress: Address

    Permalink

    The address of this cluster member.

  38. def selfDataCenter: DataCenter

    Permalink

    Data center to which this node belongs to (defaults to "default" if not configured explicitly)

  39. def selfMember: Member

    Permalink

    Current snapshot of the member itself

  40. def selfRoles: Set[String]

    Permalink

    roles that this member has

  41. val selfUniqueAddress: UniqueAddress

    Permalink

    The address including a uid of this cluster member.

    The address including a uid of this cluster member. The uid is needed to be able to distinguish different incarnations of a member with same hostname and port.

  42. def sendCurrentClusterState(receiver: ActorRef): Unit

    Permalink

    Send current (full) state of the cluster to the specified receiver.

    Send current (full) state of the cluster to the specified receiver. If you want this to happen periodically you need to schedule a call to this method yourself. Note that you can also retrieve the current state with #state.

  43. val settings: ClusterSettings

    Permalink
  44. def state: CurrentClusterState

    Permalink

    Current snapshot state of the cluster.

  45. def subscribe(subscriber: ActorRef, initialStateMode: SubscriptionInitialStateMode, to: Class[_]*): Unit

    Permalink

    Subscribe to one or more cluster domain events.

    Subscribe to one or more cluster domain events. The to classes can be akka.cluster.ClusterEvent.ClusterDomainEvent or subclasses.

    If initialStateMode is ClusterEvent.InitialStateAsEvents the events corresponding to the current state will be sent to the subscriber to mimic what you would have seen if you were listening to the events when they occurred in the past.

    If initialStateMode is ClusterEvent.InitialStateAsSnapshot a snapshot of akka.cluster.ClusterEvent.CurrentClusterState will be sent to the subscriber as the first message.

    Note that for large clusters it is more efficient to use InitialStateAsSnapshot.

    Annotations
    @varargs()
  46. def subscribe(subscriber: ActorRef, to: Class[_]*): Unit

    Permalink

    Subscribe to one or more cluster domain events.

    Subscribe to one or more cluster domain events. The to classes can be akka.cluster.ClusterEvent.ClusterDomainEvent or subclasses.

    A snapshot of akka.cluster.ClusterEvent.CurrentClusterState will be sent to the subscriber as the first message.

    Annotations
    @varargs()
  47. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  48. val system: ExtendedActorSystem

    Permalink
  49. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  50. def unsubscribe(subscriber: ActorRef, to: Class[_]): Unit

    Permalink

    Unsubscribe to a specific type of cluster domain events, matching previous subscribe registration.

  51. def unsubscribe(subscriber: ActorRef): Unit

    Permalink

    Unsubscribe to all cluster domain events.

  52. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  53. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  54. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  55. def [B](y: B): (Cluster, B)

    Permalink
    Implicit information
    This member is added by an implicit conversion from Cluster to ArrowAssoc[Cluster] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc

Inherited from Extension

Inherited from AnyRef

Inherited from Any

Inherited by implicit conversion any2stringadd from Cluster to any2stringadd[Cluster]

Inherited by implicit conversion StringFormat from Cluster to StringFormat[Cluster]

Inherited by implicit conversion Ensuring from Cluster to Ensuring[Cluster]

Inherited by implicit conversion ArrowAssoc from Cluster to ArrowAssoc[Cluster]

Ungrouped