Package akka.cluster
Class ClusterCoreDaemon
- java.lang.Object
-
- akka.cluster.ClusterCoreDaemon
-
- All Implemented Interfaces:
Actor
,RequiresMessageQueue<UnboundedMessageQueueSemantics>
public class ClusterCoreDaemon extends java.lang.Object implements Actor, RequiresMessageQueue<UnboundedMessageQueueSemantics>
INTERNAL API.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
ClusterCoreDaemon.Ignored$
class
ClusterCoreDaemon.Merge$
class
ClusterCoreDaemon.Newer$
class
ClusterCoreDaemon.Older$
static interface
ClusterCoreDaemon.ReceiveGossipType
The types of gossip actions that receive gossip has performed.class
ClusterCoreDaemon.Same$
-
Nested classes/interfaces inherited from interface akka.actor.Actor
Actor.emptyBehavior$, Actor.ignoringBehavior$
-
-
Constructor Summary
Constructors Constructor Description ClusterCoreDaemon(ActorRef publisher, JoinConfigCompatChecker joinConfigCompatChecker)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
akka$actor$Actor$_setter_$context_$eq(ActorContext x$1)
Scala API: Stores the context for this actor, including self, and sender.protected void
akka$actor$Actor$_setter_$self_$eq(ActorRef x$1)
The 'self' field holds the ActorRef for this actor.void
assertLatestGossip()
void
becomeInitialized()
void
becomeUninitialized()
void
cleanupExitingConfirmed()
Cluster
cluster()
ActorContext
context()
Scala API: Stores the context for this actor, including self, and sender.CoordinatedShutdown
coordShutdown()
void
downing(Address address)
State transition to DOWN.void
exitingCompleted()
scala.collection.immutable.Set<UniqueAddress>
exitingConfirmed()
void
exitingConfirmed_$eq(scala.collection.immutable.Set<UniqueAddress> x$1)
boolean
exitingTasksInProgress()
void
exitingTasksInProgress_$eq(boolean x$1)
Cancellable
failureDetectorReaperTask()
void
gossip()
Initiates a new round of gossip.void
gossipRandomN(int n)
Sends full gossip ton
other random members.void
gossipSpeedupTick()
GossipStats
gossipStats()
void
gossipStats_$eq(GossipStats x$1)
void
gossipStatusTo(UniqueAddress node)
void
gossipStatusTo(UniqueAddress node, ActorRef destination)
GossipTargetSelector
gossipTargetSelector()
Cancellable
gossipTask()
void
gossipTick()
void
gossipTo(UniqueAddress node)
Gossips latest gossip to a node.void
gossipTo(UniqueAddress node, ActorRef destination)
ClusterCoreDaemon.Ignored$
Ignored()
Accessor for nested Scala objectscala.PartialFunction<java.lang.Object,scala.runtime.BoxedUnit>
initialized()
void
initJoin(com.typesafe.config.Config joiningNodeConfig)
boolean
isCurrentlyLeader()
void
isCurrentlyLeader_$eq(boolean x$1)
boolean
isGossipSpeedupNeeded()
boolean
isMinNrOfMembersFulfilled()
boolean
isSingletonCluster()
void
join(Address address)
Try to join this cluster node with the node specified byaddress
.void
joining(UniqueAddress joiningNode, scala.collection.immutable.Set<java.lang.String> roles)
State transition to JOINING - new node joining.void
joinSeedNodes(scala.collection.immutable.IndexedSeq<Address> newSeedNodes)
scala.Option<scala.concurrent.duration.Deadline>
joinSeedNodesDeadline()
void
joinSeedNodesDeadline_$eq(scala.Option<scala.concurrent.duration.Deadline> x$1)
Gossip
latestGossip()
int
leaderActionCounter()
void
leaderActionCounter_$eq(int x$1)
void
leaderActions()
Runs periodic leader actions, such as member status transitions, assigning partitions etc.void
leaderActionsOnConvergence()
Leader actions are as follows: 1.Cancellable
leaderActionsTask()
void
leaving(Address address)
State transition to LEAVING.static int
MaxGossipsBeforeShuttingDownMyself()
static int
MaxTicksBeforeShuttingDownMyself()
MembershipState
membershipState()
void
membershipState_$eq(MembershipState x$1)
ClusterCoreDaemon.Merge$
Merge()
Accessor for nested Scala objectvoid
moveJoiningToWeaklyUp()
ClusterCoreDaemon.Newer$
Newer()
Accessor for nested Scala objectstatic int
NumberOfGossipsBeforeShutdownWhenLeaderExits()
ClusterCoreDaemon.Older$
Older()
Accessor for nested Scala objectvoid
postStop()
User overridable callback.void
preStart()
User overridable callback.void
publishInternalStats()
void
publishMembershipState()
scala.Option<Cancellable>
publishStatsTask()
void
quarantined(UniqueAddress node)
void
reapUnreachableMembers()
Reaps the unreachable members according to the failure detector's verdict.scala.PartialFunction<java.lang.Object,scala.runtime.BoxedUnit>
receive()
Scala API: This defines the initial actor behavior, it must return a partial function with the actor logic.scala.PartialFunction<java.lang.Object,scala.runtime.BoxedUnit>
receiveExitingCompleted()
void
receiveExitingConfirmed(UniqueAddress node)
ClusterCoreDaemon.ReceiveGossipType
receiveGossip(GossipEnvelope envelope)
Receive new gossip.void
receiveGossipStatus(GossipStatus status)
ClusterCoreDaemon.Same$
Same()
Accessor for nested Scala objectscala.Option<ActorRef>
seedNodeProcess()
void
seedNodeProcess_$eq(scala.Option<ActorRef> x$1)
int
seedNodeProcessCounter()
void
seedNodeProcessCounter_$eq(int x$1)
scala.collection.immutable.IndexedSeq<Address>
seedNodes()
void
seedNodes_$eq(scala.collection.immutable.IndexedSeq<Address> x$1)
ActorRef
self()
The 'self' field holds the ActorRef for this actor.java.lang.String
selfDc()
int
selfDownCounter()
void
selfDownCounter_$eq(int x$1)
scala.concurrent.Promise<Done>
selfExiting()
protected UniqueAddress
selfUniqueAddress()
void
sendGossipTo(Address address)
void
shutdown()
This method is called when a member sees itself as Exiting or Down.void
shutdownSelfWhenDown()
boolean
statsEnabled()
void
stopSeedNodeProcess()
scala.PartialFunction<java.lang.Object,scala.runtime.BoxedUnit>
tryingToJoin(Address joinWith, scala.Option<scala.concurrent.duration.Deadline> deadline)
void
unhandled(java.lang.Object message)
User overridable callback.scala.PartialFunction<java.lang.Object,scala.runtime.BoxedUnit>
uninitialized()
void
updateLatestGossip(Gossip gossip)
java.lang.String
vclockNode()
void
welcome(Address joinWith, UniqueAddress from, Gossip gossip)
Accept reply from Join request.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface akka.actor.Actor
aroundPostRestart, aroundPostStop, aroundPreRestart, aroundPreStart, aroundReceive, postRestart, preRestart, sender, supervisorStrategy
-
-
-
-
Constructor Detail
-
ClusterCoreDaemon
public ClusterCoreDaemon(ActorRef publisher, JoinConfigCompatChecker joinConfigCompatChecker)
-
-
Method Detail
-
NumberOfGossipsBeforeShutdownWhenLeaderExits
public static int NumberOfGossipsBeforeShutdownWhenLeaderExits()
-
MaxGossipsBeforeShuttingDownMyself
public static int MaxGossipsBeforeShuttingDownMyself()
-
MaxTicksBeforeShuttingDownMyself
public static int MaxTicksBeforeShuttingDownMyself()
-
Ignored
public ClusterCoreDaemon.Ignored$ Ignored()
Accessor for nested Scala object- Returns:
- (undocumented)
-
Older
public ClusterCoreDaemon.Older$ Older()
Accessor for nested Scala object- Returns:
- (undocumented)
-
Newer
public ClusterCoreDaemon.Newer$ Newer()
Accessor for nested Scala object- Returns:
- (undocumented)
-
Same
public ClusterCoreDaemon.Same$ Same()
Accessor for nested Scala object- Returns:
- (undocumented)
-
Merge
public ClusterCoreDaemon.Merge$ Merge()
Accessor for nested Scala object- Returns:
- (undocumented)
-
context
public ActorContext context()
Description copied from interface:Actor
Scala API: Stores the context for this actor, including self, and sender. It is implicit to support operations such asforward
.WARNING: Only valid within the Actor itself, so do not close over it and publish it to other threads!
ActorContext
is the Scala API.getContext
returns aAbstractActor.ActorContext
, which is the Java API of the actor context.
-
self
public final ActorRef self()
Description copied from interface:Actor
The 'self' field holds the ActorRef for this actor. Can be used to send messages to itself:self ! message
-
akka$actor$Actor$_setter_$context_$eq
protected void akka$actor$Actor$_setter_$context_$eq(ActorContext x$1)
Description copied from interface:Actor
Scala API: Stores the context for this actor, including self, and sender. It is implicit to support operations such asforward
.WARNING: Only valid within the Actor itself, so do not close over it and publish it to other threads!
ActorContext
is the Scala API.getContext
returns aAbstractActor.ActorContext
, which is the Java API of the actor context.- Specified by:
akka$actor$Actor$_setter_$context_$eq
in interfaceActor
-
akka$actor$Actor$_setter_$self_$eq
protected final void akka$actor$Actor$_setter_$self_$eq(ActorRef x$1)
Description copied from interface:Actor
The 'self' field holds the ActorRef for this actor. Can be used to send messages to itself:self ! message
- Specified by:
akka$actor$Actor$_setter_$self_$eq
in interfaceActor
-
cluster
public Cluster cluster()
-
selfDc
public java.lang.String selfDc()
-
selfUniqueAddress
protected UniqueAddress selfUniqueAddress()
-
vclockNode
public java.lang.String vclockNode()
-
gossipTargetSelector
public GossipTargetSelector gossipTargetSelector()
-
membershipState
public MembershipState membershipState()
-
membershipState_$eq
public void membershipState_$eq(MembershipState x$1)
-
isCurrentlyLeader
public boolean isCurrentlyLeader()
-
isCurrentlyLeader_$eq
public void isCurrentlyLeader_$eq(boolean x$1)
-
latestGossip
public Gossip latestGossip()
-
statsEnabled
public boolean statsEnabled()
-
gossipStats
public GossipStats gossipStats()
-
gossipStats_$eq
public void gossipStats_$eq(GossipStats x$1)
-
seedNodes
public scala.collection.immutable.IndexedSeq<Address> seedNodes()
-
seedNodes_$eq
public void seedNodes_$eq(scala.collection.immutable.IndexedSeq<Address> x$1)
-
seedNodeProcess
public scala.Option<ActorRef> seedNodeProcess()
-
seedNodeProcess_$eq
public void seedNodeProcess_$eq(scala.Option<ActorRef> x$1)
-
seedNodeProcessCounter
public int seedNodeProcessCounter()
-
seedNodeProcessCounter_$eq
public void seedNodeProcessCounter_$eq(int x$1)
-
joinSeedNodesDeadline
public scala.Option<scala.concurrent.duration.Deadline> joinSeedNodesDeadline()
-
joinSeedNodesDeadline_$eq
public void joinSeedNodesDeadline_$eq(scala.Option<scala.concurrent.duration.Deadline> x$1)
-
leaderActionCounter
public int leaderActionCounter()
-
leaderActionCounter_$eq
public void leaderActionCounter_$eq(int x$1)
-
selfDownCounter
public int selfDownCounter()
-
selfDownCounter_$eq
public void selfDownCounter_$eq(int x$1)
-
exitingTasksInProgress
public boolean exitingTasksInProgress()
-
exitingTasksInProgress_$eq
public void exitingTasksInProgress_$eq(boolean x$1)
-
selfExiting
public scala.concurrent.Promise<Done> selfExiting()
-
coordShutdown
public CoordinatedShutdown coordShutdown()
-
exitingConfirmed
public scala.collection.immutable.Set<UniqueAddress> exitingConfirmed()
-
exitingConfirmed_$eq
public void exitingConfirmed_$eq(scala.collection.immutable.Set<UniqueAddress> x$1)
-
gossipTask
public Cancellable gossipTask()
-
failureDetectorReaperTask
public Cancellable failureDetectorReaperTask()
-
leaderActionsTask
public Cancellable leaderActionsTask()
-
publishStatsTask
public scala.Option<Cancellable> publishStatsTask()
-
preStart
public void preStart()
Description copied from interface:Actor
User overridable callback. Is called when an Actor is started. Actors are automatically started asynchronously when created. Empty default implementation.
-
postStop
public void postStop()
Description copied from interface:Actor
User overridable callback. Is called asynchronously after 'actor.stop()' is invoked. Empty default implementation.
-
uninitialized
public scala.PartialFunction<java.lang.Object,scala.runtime.BoxedUnit> uninitialized()
-
tryingToJoin
public scala.PartialFunction<java.lang.Object,scala.runtime.BoxedUnit> tryingToJoin(Address joinWith, scala.Option<scala.concurrent.duration.Deadline> deadline)
-
becomeUninitialized
public void becomeUninitialized()
-
becomeInitialized
public void becomeInitialized()
-
initialized
public scala.PartialFunction<java.lang.Object,scala.runtime.BoxedUnit> initialized()
-
receiveExitingCompleted
public scala.PartialFunction<java.lang.Object,scala.runtime.BoxedUnit> receiveExitingCompleted()
-
receive
public scala.PartialFunction<java.lang.Object,scala.runtime.BoxedUnit> receive()
Description copied from interface:Actor
Scala API: This defines the initial actor behavior, it must return a partial function with the actor logic.
-
unhandled
public void unhandled(java.lang.Object message)
Description copied from interface:Actor
User overridable callback. Is called when a message isn't handled by the current behavior of the actor by default it fails with either aDeathPactException
(in case of an unhandledTerminated
message) or publishes anUnhandledMessage
to the actor's system'sEventStream
-
initJoin
public void initJoin(com.typesafe.config.Config joiningNodeConfig)
-
joinSeedNodes
public void joinSeedNodes(scala.collection.immutable.IndexedSeq<Address> newSeedNodes)
-
join
public void join(Address address)
Try to join this cluster node with the node specified byaddress
. It's only allowed to join from an empty state, i.e. when not already a member. AJoin(selfUniqueAddress)
command is sent to the node to join, which will reply with aWelcome
message.
-
stopSeedNodeProcess
public void stopSeedNodeProcess()
-
joining
public void joining(UniqueAddress joiningNode, scala.collection.immutable.Set<java.lang.String> roles)
State transition to JOINING - new node joining. ReceivedJoin
message and replies withWelcome
message, containing current gossip state, including the new joining member.
-
welcome
public void welcome(Address joinWith, UniqueAddress from, Gossip gossip)
Accept reply from Join request.
-
leaving
public void leaving(Address address)
State transition to LEAVING. The node will eventually be removed by the leader, after hand-off in EXITING, and only after removal a new node with same address can join the cluster through the normal joining procedure.
-
exitingCompleted
public void exitingCompleted()
-
receiveExitingConfirmed
public void receiveExitingConfirmed(UniqueAddress node)
-
cleanupExitingConfirmed
public void cleanupExitingConfirmed()
-
shutdown
public void shutdown()
This method is called when a member sees itself as Exiting or Down.
-
downing
public void downing(Address address)
State transition to DOWN. Its status is set to DOWN. The node is also removed from theseen
table.The node will eventually be removed by the leader, and only after removal a new node with same address can join the cluster through the normal joining procedure.
-
quarantined
public void quarantined(UniqueAddress node)
-
receiveGossipStatus
public void receiveGossipStatus(GossipStatus status)
-
receiveGossip
public ClusterCoreDaemon.ReceiveGossipType receiveGossip(GossipEnvelope envelope)
Receive new gossip.
-
gossipTick
public void gossipTick()
-
gossipSpeedupTick
public void gossipSpeedupTick()
-
isGossipSpeedupNeeded
public boolean isGossipSpeedupNeeded()
-
gossipRandomN
public void gossipRandomN(int n)
Sends full gossip ton
other random members.
-
gossip
public void gossip()
Initiates a new round of gossip.
-
leaderActions
public void leaderActions()
Runs periodic leader actions, such as member status transitions, assigning partitions etc.
-
shutdownSelfWhenDown
public void shutdownSelfWhenDown()
-
isMinNrOfMembersFulfilled
public boolean isMinNrOfMembersFulfilled()
-
leaderActionsOnConvergence
public void leaderActionsOnConvergence()
Leader actions are as follows: 1. Move JOINING => UP -- When a node joins the cluster 2. Move LEAVING => EXITING -- 3. Non-exiting remain -- 4. Move unreachable EXITING => REMOVED -- When all nodes have seen the EXITING node as unreachable (convergence) - remove the node from the node ring and seen table 5. Move unreachable DOWN/EXITING => REMOVED -- When all nodes have seen that the node is DOWN/EXITING (convergence) - remove the node from the node ring and seen table 7. Updating the vclock version for the changes 8. Updating theseen
table 9. Update the state with the new gossip
-
moveJoiningToWeaklyUp
public void moveJoiningToWeaklyUp()
-
reapUnreachableMembers
public void reapUnreachableMembers()
Reaps the unreachable members according to the failure detector's verdict.
-
isSingletonCluster
public boolean isSingletonCluster()
-
sendGossipTo
public void sendGossipTo(Address address)
-
gossipTo
public void gossipTo(UniqueAddress node)
Gossips latest gossip to a node.
-
gossipTo
public void gossipTo(UniqueAddress node, ActorRef destination)
-
gossipStatusTo
public void gossipStatusTo(UniqueAddress node, ActorRef destination)
-
gossipStatusTo
public void gossipStatusTo(UniqueAddress node)
-
updateLatestGossip
public void updateLatestGossip(Gossip gossip)
-
assertLatestGossip
public void assertLatestGossip()
-
publishMembershipState
public void publishMembershipState()
-
publishInternalStats
public void publishInternalStats()
-
-