akka.cluster

Cluster

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.

Linear Supertypes
Extension, AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Cluster
  2. Extension
  3. AnyRef
  4. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

  1. new Cluster(system: ExtendedActorSystem)

Value Members

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

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

    Definition Classes
    AnyRef → Any
  4. final def ==(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  5. final def ==(arg0: Any): Boolean

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

    Definition Classes
    Any
  7. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  8. def down(address: Address): Unit

    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.

  9. final def eq(arg0: AnyRef): Boolean

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

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

  12. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  13. final def getClass(): Class[_]

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

    Java API: roles that this member has

  15. def hashCode(): Int

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

    Definition Classes
    Any
  17. def isTerminated: Boolean

    Returns true if this cluster instance has be shutdown.

  18. def join(address: Address): Unit

    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.

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

    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.

    JAVA API: Use akka.japi.Util.immutableSeq to convert a java.lang.Iterable to the type needed for the seedNodes parameter.

  20. def leave(address: Address): Unit

    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.

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

    Definition Classes
    AnyRef
  22. final def notify(): Unit

    Definition Classes
    AnyRef
  23. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  24. def registerOnMemberUp(callback: Runnable): Unit

    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.

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

    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.

  26. def selfAddress: Address

    The address of this cluster member.

  27. def selfRoles: Set[String]

    roles that this member has

  28. def sendCurrentClusterState(receiver: ActorRef): Unit

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

    Publish 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.

  29. val settings: ClusterSettings

  30. def state: CurrentClusterState

    Current snapshot state of the cluster.

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

    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()
  32. def subscribe(subscriber: ActorRef, to: Class[_]*): Unit

    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()
  33. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  34. val system: ExtendedActorSystem

  35. def toString(): String

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

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

  37. def unsubscribe(subscriber: ActorRef): Unit

    Unsubscribe to all cluster domain events.

  38. final def wait(): Unit

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Deprecated Value Members

  1. def publishCurrentClusterState(): Unit

    Publish current (full) state of the cluster to subscribers, that are subscribing to akka.cluster.ClusterEvent.ClusterDomainEvent or akka.cluster.ClusterEvent.CurrentClusterState.

    Publish current (full) state of the cluster to subscribers, that are subscribing to akka.cluster.ClusterEvent.ClusterDomainEvent or akka.cluster.ClusterEvent.CurrentClusterState. If you want this to happen periodically you need to schedule a call to this method yourself.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.3) Use sendCurrentClusterState instead of publishCurrentClusterState

Inherited from Extension

Inherited from AnyRef

Inherited from Any

Ungrouped