Package akka.cluster

Class GossipTargetSelector

  • public class GossipTargetSelector
    extends java.lang.Object
    • Constructor Detail

      • GossipTargetSelector

        public GossipTargetSelector​(double reduceGossipDifferentViewProbability,
                                    double crossDcGossipProbability)
    • Method Detail

      • adjustedGossipDifferentViewProbability

        protected double adjustedGossipDifferentViewProbability​(int clusterSize)
        For large clusters we should avoid shooting down individual nodes. Therefore the probability is reduced for large clusters.
      • dcsInRandomOrder

        protected scala.collection.immutable.List<java.lang.String> dcsInRandomOrder​(scala.collection.immutable.List<java.lang.String> dcs)
      • localDcGossipTargets

        protected scala.collection.immutable.Vector<UniqueAddress> localDcGossipTargets​(MembershipState state)
        Chooses a set of possible gossip targets that is in the same dc. If the cluster is not multi dc this means it is a choice among all nodes of the cluster.
      • multiDcGossipTargets

        protected scala.collection.immutable.Vector<UniqueAddress> multiDcGossipTargets​(MembershipState state)
        Choose cross-dc nodes if this one of the N oldest nodes, and if not fall back to gossip locally in the dc
      • preferNodesWithDifferentView

        protected boolean preferNodesWithDifferentView​(MembershipState state)
      • randomNodesForFullGossip

        public scala.collection.immutable.Vector<UniqueAddress> randomNodesForFullGossip​(MembershipState state,
                                                                                         int n)
        Select n random nodes to gossip to (used to quickly inform the rest of the cluster when leaving for example)
      • selectDcLocalNodes

        protected boolean selectDcLocalNodes​(MembershipState state)
        For small DCs prefer cross DC gossip. This speeds up the bootstrapping of new DCs as adding an initial node means it has no local peers. Once the DC is at 5 members use the configured crossDcGossipProbability, before that for a single node cluster use 1.0, two nodes use 0.75 etc
      • selectRandomNode

        protected scala.Option<UniqueAddress> selectRandomNode​(scala.collection.immutable.IndexedSeq<UniqueAddress> nodes)