Package akka.cluster.sbr
Class SplitBrainResolverBase
- java.lang.Object
-
- akka.cluster.sbr.SplitBrainResolverBase
-
- All Implemented Interfaces:
Actor
,Stash
,StashSupport
,Timers
,UnrestrictedStash
,RequiresMessageQueue<DequeBasedMessageQueueSemantics>
- Direct Known Subclasses:
SplitBrainResolver
public abstract class SplitBrainResolverBase extends java.lang.Object implements Actor, Stash, Timers
INTERNAL APIThe implementation is split into two classes SplitBrainResolver and SplitBrainResolverBase to be able to unit test the logic without running cluster.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface akka.actor.Actor
Actor.emptyBehavior$, Actor.ignoringBehavior$
-
-
Constructor Summary
Constructors Constructor Description SplitBrainResolverBase(scala.concurrent.duration.FiniteDuration stableAfter, DowningStrategy _strategy)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description scala.collection.immutable.Set<UniqueAddress>
actOnDecision(DowningStrategy.Decision decision)
void
addJoining(Member m)
void
addUp(Member m)
void
addWeaklyUp(Member m)
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.protected void
akka$actor$StashSupport$_setter_$mailbox_$eq(DequeBasedMessageQueueSemantics x$1)
ActorContext
context()
Scala API: Stores the context for this actor, including self, and sender.abstract void
down(UniqueAddress node, DowningStrategy.Decision decision)
scala.concurrent.duration.FiniteDuration
downAllWhenUnstable()
void
exited(Member m)
boolean
isResponsible()
boolean
leader()
void
leader_$eq(boolean x$1)
void
leaving(Member m)
DiagnosticMarkerBusLoggingAdapter
log()
DequeBasedMessageQueueSemantics
mailbox()
void
mutateMemberInfo(boolean resetStable, scala.Function0<scala.runtime.BoxedUnit> f)
Helper to wrap updates to strategy info with, so that stable-after timer is reset and information is logged about state changevoid
mutateResponsibilityInfo(scala.Function0<scala.runtime.BoxedUnit> f)
Helper to wrap updates to `leader` and `selfMemberAdded` to log changes in responsibility statusprotected scala.concurrent.duration.Deadline
newStableDeadline()
void
observeDecision(DowningStrategy.Decision decision, scala.collection.immutable.Set<UniqueAddress> nodesToDown, scala.collection.immutable.Set<java.lang.String> unreachableDataCenters)
void
postStop()
User overridable callback.void
reachabilityChanged(Reachability r)
void
reachableDataCenter(java.lang.String dc)
void
reachableMember(Member m)
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.void
remove(Member m)
void
resetStableDeadline()
void
seenChanged(scala.collection.immutable.Set<Address> seenBy)
ActorRef
self()
The 'self' field holds the ActorRef for this actor.abstract java.lang.String
selfDc()
boolean
selfMemberAdded()
void
selfMemberAdded_$eq(boolean x$1)
abstract UniqueAddress
selfUniqueAddress()
scala.concurrent.duration.Deadline
stableDeadline()
void
stableDeadline_$eq(scala.concurrent.duration.Deadline x$1)
DowningStrategy
strategy()
scala.concurrent.duration.FiniteDuration
tickInterval()
void
unreachableDataCenter(java.lang.String dc)
void
unreachableMember(Member m)
scala.PartialFunction<java.lang.Object,scala.runtime.BoxedUnit>
waitingForLease(DowningStrategy.Decision decision)
-
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, aroundPreStart, postRestart, preStart, sender, supervisorStrategy, unhandled
-
Methods inherited from interface akka.actor.StashSupport
actorCell, clearStash, enqueueFirst, prepend, stash, theStash_$eq, unstash, unstashAll, unstashAll
-
Methods inherited from interface akka.actor.Timers
actorCell, aroundPostStop, aroundPreRestart, aroundReceive, super$aroundPostStop, super$aroundPreRestart, super$aroundReceive, timers
-
Methods inherited from interface akka.actor.UnrestrictedStash
preRestart, super$postStop, super$preRestart
-
-
-
-
Constructor Detail
-
SplitBrainResolverBase
public SplitBrainResolverBase(scala.concurrent.duration.FiniteDuration stableAfter, DowningStrategy _strategy)
-
-
Method Detail
-
actOnDecision
public scala.collection.immutable.Set<UniqueAddress> actOnDecision(DowningStrategy.Decision decision)
- Returns:
- the nodes that were downed
-
addJoining
public void addJoining(Member m)
-
addUp
public void addUp(Member m)
-
addWeaklyUp
public void addWeaklyUp(Member m)
-
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
-
akka$actor$StashSupport$_setter_$mailbox_$eq
protected void akka$actor$StashSupport$_setter_$mailbox_$eq(DequeBasedMessageQueueSemantics x$1)
- Specified by:
akka$actor$StashSupport$_setter_$mailbox_$eq
in interfaceStashSupport
-
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.- Specified by:
context
in interfaceActor
- Specified by:
context
in interfaceStashSupport
-
down
public abstract void down(UniqueAddress node, DowningStrategy.Decision decision)
-
downAllWhenUnstable
public scala.concurrent.duration.FiniteDuration downAllWhenUnstable()
-
exited
public void exited(Member m)
-
isResponsible
public boolean isResponsible()
-
leader
public boolean leader()
-
leader_$eq
public void leader_$eq(boolean x$1)
-
leaving
public void leaving(Member m)
-
log
public DiagnosticMarkerBusLoggingAdapter log()
-
mailbox
public DequeBasedMessageQueueSemantics mailbox()
- Specified by:
mailbox
in interfaceStashSupport
-
mutateMemberInfo
public void mutateMemberInfo(boolean resetStable, scala.Function0<scala.runtime.BoxedUnit> f)
Helper to wrap updates to strategy info with, so that stable-after timer is reset and information is logged about state change
-
mutateResponsibilityInfo
public void mutateResponsibilityInfo(scala.Function0<scala.runtime.BoxedUnit> f)
Helper to wrap updates to `leader` and `selfMemberAdded` to log changes in responsibility status
-
newStableDeadline
protected scala.concurrent.duration.Deadline newStableDeadline()
-
observeDecision
public void observeDecision(DowningStrategy.Decision decision, scala.collection.immutable.Set<UniqueAddress> nodesToDown, scala.collection.immutable.Set<java.lang.String> unreachableDataCenters)
-
postStop
public void postStop()
Description copied from interface:Actor
User overridable callback. Is called asynchronously after 'actor.stop()' is invoked. Empty default implementation.- Specified by:
postStop
in interfaceActor
- Specified by:
postStop
in interfaceUnrestrictedStash
-
reachabilityChanged
public void reachabilityChanged(Reachability r)
-
reachableDataCenter
public void reachableDataCenter(java.lang.String dc)
-
reachableMember
public void reachableMember(Member m)
-
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.
-
remove
public void remove(Member m)
-
resetStableDeadline
public void resetStableDeadline()
-
seenChanged
public void seenChanged(scala.collection.immutable.Set<Address> seenBy)
-
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
- Specified by:
self
in interfaceActor
- Specified by:
self
in interfaceStashSupport
-
selfDc
public abstract java.lang.String selfDc()
-
selfMemberAdded
public boolean selfMemberAdded()
-
selfMemberAdded_$eq
public void selfMemberAdded_$eq(boolean x$1)
-
selfUniqueAddress
public abstract UniqueAddress selfUniqueAddress()
-
stableDeadline
public scala.concurrent.duration.Deadline stableDeadline()
-
stableDeadline_$eq
public void stableDeadline_$eq(scala.concurrent.duration.Deadline x$1)
-
strategy
public DowningStrategy strategy()
-
tickInterval
public scala.concurrent.duration.FiniteDuration tickInterval()
-
unreachableDataCenter
public void unreachableDataCenter(java.lang.String dc)
-
unreachableMember
public void unreachableMember(Member m)
-
waitingForLease
public scala.PartialFunction<java.lang.Object,scala.runtime.BoxedUnit> waitingForLease(DowningStrategy.Decision decision)
-
-