Represents the overview of the cluster, holds the cluster convergence table and set with unreachable nodes.
Exemplo n.º 1
0
        public Gossip(ImmutableSortedSet <Member> members, GossipOverview overview, VectorClock version)
        {
            _members  = members;
            _overview = overview;
            _version  = version;

            _membersMap = new Lazy <ImmutableDictionary <UniqueAddress, Member> >(
                () => members.ToImmutableDictionary(m => m.UniqueAddress, m => m));

            if (Cluster.IsAssertInvariantsEnabled)
            {
                AssertInvariants();
            }
        }
Exemplo n.º 2
0
        public Gossip(ImmutableSortedSet<Member> members, GossipOverview overview, VectorClock version)
        {
            _members = members;
            _overview = overview;
            _version = version;

            _membersMap = new Lazy<ImmutableDictionary<UniqueAddress, Member>>(
                () => members.ToImmutableDictionary(m => m.UniqueAddress, m => m));

            ReachabilityExcludingDownedObservers = new Lazy<Reachability>(() =>
            {
                var downed = Members.Where(m => m.Status == MemberStatus.Down).ToList();
                return Overview.Reachability.RemoveObservers(downed.Select(m => m.UniqueAddress).ToImmutableHashSet());
            });

            if (Cluster.IsAssertInvariantsEnabled) AssertInvariants();
        }
Exemplo n.º 3
0
        /// <summary>
        /// TBD
        /// </summary>
        /// <param name="members">TBD</param>
        /// <param name="overview">TBD</param>
        /// <param name="version">TBD</param>
        /// <exception cref="ArgumentException">TBD</exception>
        public Gossip(ImmutableSortedSet <Member> members, GossipOverview overview, VectorClock version)
        {
            _members  = members;
            _overview = overview;
            _version  = version;

            _membersMap = new Lazy <ImmutableDictionary <UniqueAddress, Member> >(
                () => members.ToImmutableDictionary(m => m.UniqueAddress, m => m));

            ReachabilityExcludingDownedObservers = new Lazy <Reachability>(() =>
            {
                var downed = Members.Where(m => m.Status == MemberStatus.Down);
                return(Overview.Reachability.RemoveObservers(downed.Select(m => m.UniqueAddress).ToImmutableHashSet()));
            });

            if (Cluster.IsAssertInvariantsEnabled)
            {
                AssertInvariants();
            }
        }
Exemplo n.º 4
0
 /// <summary>
 /// TBD
 /// </summary>
 /// <param name="members">TBD</param>
 /// <param name="overview">TBD</param>
 /// <param name="version">TBD</param>
 /// <returns>TBD</returns>
 public Gossip Copy(ImmutableSortedSet <Member> members = null, GossipOverview overview = null,
                    VectorClock version = null)
 {
     return(new Gossip(members ?? _members, overview ?? _overview, version ?? _version));
 }
Exemplo n.º 5
0
 /// <summary>
 /// TBD
 /// </summary>
 /// <param name="members">TBD</param>
 /// <param name="overview">TBD</param>
 public Gossip(ImmutableSortedSet <Member> members, GossipOverview overview) : this(members, overview, VectorClock.Create())
 {
 }
Exemplo n.º 6
0
 public Gossip Copy(ImmutableSortedSet<Member> members = null, GossipOverview overview = null,
     VectorClock version = null)
 {
     return new Gossip(members ?? _members, overview ?? _overview, version ?? _version);
 }
Exemplo n.º 7
0
 public Gossip(ImmutableSortedSet<Member> members, GossipOverview overview) : this(members, overview, VectorClock.Create()) { }