Class Gossip
- java.lang.Object
-
- akka.cluster.Gossip
-
- All Implemented Interfaces:
java.io.Serializable
,scala.Equals
,scala.Product
,scala.Serializable
public final class Gossip extends java.lang.Object implements scala.Product, scala.Serializable
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description Gossip(scala.collection.immutable.SortedSet<Member> members, GossipOverview overview, VectorClock version, scala.collection.immutable.Map<UniqueAddress,java.lang.Object> tombstones)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Gossip
$colon$plus(Member member)
Adds a member to the member node ring.Gossip
$colon$plus(java.lang.String node)
Increments the version for this 'Node'.static GossipOverview
$lessinit$greater$default$2()
INTERNAL APIstatic VectorClock
$lessinit$greater$default$3()
static scala.collection.immutable.Map<UniqueAddress,java.lang.Object>
$lessinit$greater$default$4()
scala.collection.immutable.Set<java.lang.String>
allDataCenters()
scala.collection.immutable.Set<java.lang.String>
allRoles()
static Gossip
apply(scala.collection.immutable.SortedSet<Member> members)
static Gossip
apply(scala.collection.immutable.SortedSet<Member> members, GossipOverview overview, VectorClock version, scala.collection.immutable.Map<UniqueAddress,java.lang.Object> tombstones)
INTERNAL APIstatic GossipOverview
apply$default$2()
INTERNAL APIstatic VectorClock
apply$default$3()
static scala.collection.immutable.Map<UniqueAddress,java.lang.Object>
apply$default$4()
boolean
canEqual(java.lang.Object x$1)
Gossip
clearSeen()
Remove all seen entriesGossip
copy(scala.collection.immutable.SortedSet<Member> members, GossipOverview overview, VectorClock version, scala.collection.immutable.Map<UniqueAddress,java.lang.Object> tombstones)
scala.collection.immutable.SortedSet<Member>
copy$default$1()
GossipOverview
copy$default$2()
VectorClock
copy$default$3()
scala.collection.immutable.Map<UniqueAddress,java.lang.Object>
copy$default$4()
static Gossip
empty()
static scala.collection.immutable.SortedSet<Member>
emptyMembers()
boolean
equals(java.lang.Object x$1)
int
hashCode()
boolean
hasMember(UniqueAddress node)
boolean
isMultiDc()
boolean
isReachable(UniqueAddress fromAddress, UniqueAddress toAddress)
boolean
isSingletonCluster()
Gossip
markAsDown(Member member)
Member
member(UniqueAddress node)
scala.collection.immutable.SortedSet<Member>
members()
Gossip
merge(Gossip that)
Merges two Gossip instances including membership tables, tombstones, and the VectorClock histories.Gossip
mergeSeen(Gossip that)
Merges the seen table of two Gossip instances.Gossip
onlySeen(UniqueAddress node)
Marks the gossip as seen by only this node (address) by replacing the 'gossip.overview.seen'GossipOverview
overview()
int
productArity()
java.lang.Object
productElement(int x$1)
scala.collection.Iterator<java.lang.Object>
productIterator()
java.lang.String
productPrefix()
Gossip
prune(java.lang.String removedNode)
Gossip
pruneTombstones(long removeEarlierThan)
Reachability
reachabilityExcludingDownedObservers()
Gossip
remove(UniqueAddress node, long removalTimestamp)
Remove the given member from the set of members and mark it's removal with a tombstone to avoid having it reintroduced when merging with another gossip that has not seen the removal.Gossip
removeAll(scala.collection.Iterable<UniqueAddress> nodes, long removalTimestamp)
Gossip
seen(UniqueAddress node)
Marks the gossip as seen by this node (address) by updating the address entry in the 'gossip.overview.seen'scala.collection.immutable.Set<UniqueAddress>
seenBy()
The nodes that have seen the current version of the Gossip.boolean
seenByNode(UniqueAddress node)
Has this Gossip been seen by this node.scala.collection.immutable.Map<UniqueAddress,java.lang.Object>
tombstones()
java.lang.String
toString()
static scala.Option<scala.Tuple4<scala.collection.immutable.SortedSet<Member>,GossipOverview,VectorClock,scala.collection.immutable.Map<UniqueAddress,java.lang.Object>>>
unapply(Gossip x$0)
Gossip
update(scala.collection.immutable.SortedSet<Member> updatedMembers)
static java.lang.String
vclockName(UniqueAddress node)
VectorClock
version()
-
-
-
Constructor Detail
-
Gossip
public Gossip(scala.collection.immutable.SortedSet<Member> members, GossipOverview overview, VectorClock version, scala.collection.immutable.Map<UniqueAddress,java.lang.Object> tombstones)
-
-
Method Detail
-
$lessinit$greater$default$2
public static GossipOverview $lessinit$greater$default$2()
INTERNAL APIRepresents the state of the cluster; cluster ring membership, ring convergence - all versioned by a vector clock.
When a node is joining the
Member
, with statusJoining
, is added tomembers
. If the joining node was downed it is moved fromoverview.unreachable
(statusDown
) tomembers
(statusJoining
). It cannot rejoin if not first downed.When convergence is reached the leader change status of
members
fromJoining
toUp
.When failure detector consider a node as unavailable it will be moved from
members
tooverview.unreachable
.When a node is downed, either manually or automatically, its status is changed to
Down
. It is also removed fromoverview.seen
table. The node will reside asDown
in theoverview.unreachable
set until joining again and it will then go through the normal joining procedure.When a
Gossip
is received the version (vector clock) is used to determine if the receivedGossip
is newer or older than the current localGossip
. The receivedGossip
and localGossip
is merged in case of conflicting version, i.e. vector clocks without same history.When a node is told by the user to leave the cluster the leader will move it to
Leaving
and then rebalance and repartition the cluster and start hand-off by migrating the actors from the leaving node to the new partitions. Once this process is complete the leader will move the node to theExiting
state and once a convergence is complete move the node toRemoved
by removing it from themembers
set and sending aRemoved
command to the removed node telling it to shut itself down.- Returns:
- (undocumented)
-
$lessinit$greater$default$3
public static VectorClock $lessinit$greater$default$3()
-
$lessinit$greater$default$4
public static scala.collection.immutable.Map<UniqueAddress,java.lang.Object> $lessinit$greater$default$4()
-
emptyMembers
public static scala.collection.immutable.SortedSet<Member> emptyMembers()
-
empty
public static Gossip empty()
-
apply$default$2
public static GossipOverview apply$default$2()
INTERNAL APIRepresents the state of the cluster; cluster ring membership, ring convergence - all versioned by a vector clock.
When a node is joining the
Member
, with statusJoining
, is added tomembers
. If the joining node was downed it is moved fromoverview.unreachable
(statusDown
) tomembers
(statusJoining
). It cannot rejoin if not first downed.When convergence is reached the leader change status of
members
fromJoining
toUp
.When failure detector consider a node as unavailable it will be moved from
members
tooverview.unreachable
.When a node is downed, either manually or automatically, its status is changed to
Down
. It is also removed fromoverview.seen
table. The node will reside asDown
in theoverview.unreachable
set until joining again and it will then go through the normal joining procedure.When a
Gossip
is received the version (vector clock) is used to determine if the receivedGossip
is newer or older than the current localGossip
. The receivedGossip
and localGossip
is merged in case of conflicting version, i.e. vector clocks without same history.When a node is told by the user to leave the cluster the leader will move it to
Leaving
and then rebalance and repartition the cluster and start hand-off by migrating the actors from the leaving node to the new partitions. Once this process is complete the leader will move the node to theExiting
state and once a convergence is complete move the node toRemoved
by removing it from themembers
set and sending aRemoved
command to the removed node telling it to shut itself down.- Returns:
- (undocumented)
-
apply$default$3
public static VectorClock apply$default$3()
-
apply$default$4
public static scala.collection.immutable.Map<UniqueAddress,java.lang.Object> apply$default$4()
-
vclockName
public static java.lang.String vclockName(UniqueAddress node)
-
apply
public static Gossip apply(scala.collection.immutable.SortedSet<Member> members, GossipOverview overview, VectorClock version, scala.collection.immutable.Map<UniqueAddress,java.lang.Object> tombstones)
INTERNAL APIRepresents the state of the cluster; cluster ring membership, ring convergence - all versioned by a vector clock.
When a node is joining the
Member
, with statusJoining
, is added tomembers
. If the joining node was downed it is moved fromoverview.unreachable
(statusDown
) tomembers
(statusJoining
). It cannot rejoin if not first downed.When convergence is reached the leader change status of
members
fromJoining
toUp
.When failure detector consider a node as unavailable it will be moved from
members
tooverview.unreachable
.When a node is downed, either manually or automatically, its status is changed to
Down
. It is also removed fromoverview.seen
table. The node will reside asDown
in theoverview.unreachable
set until joining again and it will then go through the normal joining procedure.When a
Gossip
is received the version (vector clock) is used to determine if the receivedGossip
is newer or older than the current localGossip
. The receivedGossip
and localGossip
is merged in case of conflicting version, i.e. vector clocks without same history.When a node is told by the user to leave the cluster the leader will move it to
Leaving
and then rebalance and repartition the cluster and start hand-off by migrating the actors from the leaving node to the new partitions. Once this process is complete the leader will move the node to theExiting
state and once a convergence is complete move the node toRemoved
by removing it from themembers
set and sending aRemoved
command to the removed node telling it to shut itself down.- Parameters:
members
- (undocumented)overview
- (undocumented)version
- (undocumented)tombstones
- (undocumented)- Returns:
- (undocumented)
-
unapply
public static scala.Option<scala.Tuple4<scala.collection.immutable.SortedSet<Member>,GossipOverview,VectorClock,scala.collection.immutable.Map<UniqueAddress,java.lang.Object>>> unapply(Gossip x$0)
-
members
public scala.collection.immutable.SortedSet<Member> members()
-
overview
public GossipOverview overview()
-
version
public VectorClock version()
-
tombstones
public scala.collection.immutable.Map<UniqueAddress,java.lang.Object> tombstones()
-
isMultiDc
public boolean isMultiDc()
-
$colon$plus
public Gossip $colon$plus(java.lang.String node)
Increments the version for this 'Node'.- Parameters:
node
- (undocumented)- Returns:
- (undocumented)
-
$colon$plus
public Gossip $colon$plus(Member member)
Adds a member to the member node ring.- Parameters:
member
- (undocumented)- Returns:
- (undocumented)
-
seen
public Gossip seen(UniqueAddress node)
Marks the gossip as seen by this node (address) by updating the address entry in the 'gossip.overview.seen'- Parameters:
node
- (undocumented)- Returns:
- (undocumented)
-
onlySeen
public Gossip onlySeen(UniqueAddress node)
Marks the gossip as seen by only this node (address) by replacing the 'gossip.overview.seen'- Parameters:
node
- (undocumented)- Returns:
- (undocumented)
-
clearSeen
public Gossip clearSeen()
Remove all seen entries- Returns:
- (undocumented)
-
seenBy
public scala.collection.immutable.Set<UniqueAddress> seenBy()
The nodes that have seen the current version of the Gossip.- Returns:
- (undocumented)
-
seenByNode
public boolean seenByNode(UniqueAddress node)
Has this Gossip been seen by this node.- Parameters:
node
- (undocumented)- Returns:
- (undocumented)
-
mergeSeen
public Gossip mergeSeen(Gossip that)
Merges the seen table of two Gossip instances.- Parameters:
that
- (undocumented)- Returns:
- (undocumented)
-
merge
public Gossip merge(Gossip that)
Merges two Gossip instances including membership tables, tombstones, and the VectorClock histories.- Parameters:
that
- (undocumented)- Returns:
- (undocumented)
-
reachabilityExcludingDownedObservers
public Reachability reachabilityExcludingDownedObservers()
-
allDataCenters
public scala.collection.immutable.Set<java.lang.String> allDataCenters()
-
allRoles
public scala.collection.immutable.Set<java.lang.String> allRoles()
-
isSingletonCluster
public boolean isSingletonCluster()
-
isReachable
public boolean isReachable(UniqueAddress fromAddress, UniqueAddress toAddress)
- Parameters:
fromAddress
- (undocumented)toAddress
- (undocumented)- Returns:
- true if fromAddress should be able to reach toAddress based on the unreachability data and their respective data centers
-
member
public Member member(UniqueAddress node)
-
hasMember
public boolean hasMember(UniqueAddress node)
-
removeAll
public Gossip removeAll(scala.collection.Iterable<UniqueAddress> nodes, long removalTimestamp)
-
remove
public Gossip remove(UniqueAddress node, long removalTimestamp)
Remove the given member from the set of members and mark it's removal with a tombstone to avoid having it reintroduced when merging with another gossip that has not seen the removal.- Parameters:
node
- (undocumented)removalTimestamp
- (undocumented)- Returns:
- (undocumented)
-
prune
public Gossip prune(java.lang.String removedNode)
-
pruneTombstones
public Gossip pruneTombstones(long removeEarlierThan)
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
copy
public Gossip copy(scala.collection.immutable.SortedSet<Member> members, GossipOverview overview, VectorClock version, scala.collection.immutable.Map<UniqueAddress,java.lang.Object> tombstones)
-
copy$default$1
public scala.collection.immutable.SortedSet<Member> copy$default$1()
-
copy$default$2
public GossipOverview copy$default$2()
-
copy$default$3
public VectorClock copy$default$3()
-
copy$default$4
public scala.collection.immutable.Map<UniqueAddress,java.lang.Object> copy$default$4()
-
productPrefix
public java.lang.String productPrefix()
- Specified by:
productPrefix
in interfacescala.Product
-
productArity
public int productArity()
- Specified by:
productArity
in interfacescala.Product
-
productElement
public java.lang.Object productElement(int x$1)
- Specified by:
productElement
in interfacescala.Product
-
productIterator
public scala.collection.Iterator<java.lang.Object> productIterator()
- Specified by:
productIterator
in interfacescala.Product
-
canEqual
public boolean canEqual(java.lang.Object x$1)
- Specified by:
canEqual
in interfacescala.Equals
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object x$1)
- Specified by:
equals
in interfacescala.Equals
- Overrides:
equals
in classjava.lang.Object
-
-