Represents the overview of the cluster, holds the cluster convergence table and set with unreachable nodes.
예제 #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();
            }
        }
예제 #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();
        }
예제 #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();
            }
        }
예제 #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));
 }
예제 #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())
 {
 }
예제 #6
0
 public Gossip Copy(ImmutableSortedSet<Member> members = null, GossipOverview overview = null,
     VectorClock version = null)
 {
     return new Gossip(members ?? _members, overview ?? _overview, version ?? _version);
 }
예제 #7
0
 public Gossip(ImmutableSortedSet<Member> members, GossipOverview overview) : this(members, overview, VectorClock.Create()) { }