Package akka.cluster

Class Gossip

  • All Implemented Interfaces:
    java.io.Serializable, scala.Equals, scala.Product

    public final class Gossip
    extends java.lang.Object
    implements scala.Product, java.io.Serializable
    See Also:
    Serialized Form
    • Method Detail

      • $lessinit$greater$default$2

        public static GossipOverview $lessinit$greater$default$2()
        INTERNAL API

        Represents the state of the cluster; cluster ring membership, ring convergence - all versioned by a vector clock.

        When a node is joining the Member, with status Joining, is added to members. If the joining node was downed it is moved from overview.unreachable (status Down) to members (status Joining). It cannot rejoin if not first downed.

        When convergence is reached the leader change status of members from Joining to Up.

        When failure detector consider a node as unavailable it will be moved from members to overview.unreachable.

        When a node is downed, either manually or automatically, its status is changed to Down. It is also removed from overview.seen table. The node will reside as Down in the overview.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 received Gossip is newer or older than the current local Gossip. The received Gossip and local Gossip 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 the Exiting state and once a convergence is complete move the node to Removed by removing it from the members set and sending a Removed command to the removed node telling it to shut itself down.

      • $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

        public static Gossip apply​(scala.collection.immutable.SortedSet<Member> members)
      • apply$default$2

        public static GossipOverview apply$default$2()
        INTERNAL API

        Represents the state of the cluster; cluster ring membership, ring convergence - all versioned by a vector clock.

        When a node is joining the Member, with status Joining, is added to members. If the joining node was downed it is moved from overview.unreachable (status Down) to members (status Joining). It cannot rejoin if not first downed.

        When convergence is reached the leader change status of members from Joining to Up.

        When failure detector consider a node as unavailable it will be moved from members to overview.unreachable.

        When a node is downed, either manually or automatically, its status is changed to Down. It is also removed from overview.seen table. The node will reside as Down in the overview.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 received Gossip is newer or older than the current local Gossip. The received Gossip and local Gossip 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 the Exiting state and once a convergence is complete move the node to Removed by removing it from the members set and sending a Removed command to the removed node telling it to shut itself down.

      • 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 API

        Represents the state of the cluster; cluster ring membership, ring convergence - all versioned by a vector clock.

        When a node is joining the Member, with status Joining, is added to members. If the joining node was downed it is moved from overview.unreachable (status Down) to members (status Joining). It cannot rejoin if not first downed.

        When convergence is reached the leader change status of members from Joining to Up.

        When failure detector consider a node as unavailable it will be moved from members to overview.unreachable.

        When a node is downed, either manually or automatically, its status is changed to Down. It is also removed from overview.seen table. The node will reside as Down in the overview.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 received Gossip is newer or older than the current local Gossip. The received Gossip and local Gossip 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 the Exiting state and once a convergence is complete move the node to Removed by removing it from the members set and sending a Removed command to the removed node telling it to shut itself down.

      • members

        public scala.collection.immutable.SortedSet<Member> members()
      • 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'.
      • $colon$plus

        public Gossip $colon$plus​(Member member)
        Adds a member to the member node ring.
      • 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'
      • onlySeen

        public Gossip onlySeen​(UniqueAddress node)
        Marks the gossip as seen by only this node (address) by replacing the 'gossip.overview.seen'
      • clearSeen

        public Gossip clearSeen()
        Remove all seen entries
      • seenBy

        public scala.collection.immutable.Set<UniqueAddress> seenBy()
        The nodes that have seen the current version of the Gossip.
      • seenByNode

        public boolean seenByNode​(UniqueAddress node)
        Has this Gossip been seen by this node.
      • mergeSeen

        public Gossip mergeSeen​(Gossip that)
        Merges the seen table of two Gossip instances.
      • merge

        public Gossip merge​(Gossip that)
        Merges two Gossip instances including membership tables, tombstones, and the VectorClock histories.
      • 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)
        Returns:
        true if fromAddress should be able to reach toAddress based on the unreachability data and their respective data centers
      • removeAll

        public Gossip removeAll​(scala.collection.Iterable<UniqueAddress> nodes,
                                long removalTimestamp)
      • update

        public Gossip update​(scala.collection.immutable.SortedSet<Member> updatedMembers)
      • 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.
      • prune

        public Gossip prune​(java.lang.String removedNode)
      • pruneTombstones

        public Gossip pruneTombstones​(long removeEarlierThan)
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • copy$default$1

        public scala.collection.immutable.SortedSet<Member> copy$default$1()
      • 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 interface scala.Product
      • productArity

        public int productArity()
        Specified by:
        productArity in interface scala.Product
      • productElement

        public java.lang.Object productElement​(int x$1)
        Specified by:
        productElement in interface scala.Product
      • productIterator

        public scala.collection.Iterator<java.lang.Object> productIterator()
        Specified by:
        productIterator in interface scala.Product
      • canEqual

        public boolean canEqual​(java.lang.Object x$1)
        Specified by:
        canEqual in interface scala.Equals
      • productElementName

        public java.lang.String productElementName​(int x$1)
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object x$1)
        Specified by:
        equals in interface scala.Equals
        Overrides:
        equals in class java.lang.Object