コード例 #1
0
 public override void OnCoreTopologyChange(CoreTopology coreTopology)
 {
     lock (this)
     {
         ISet <MemberId> targetMembers = coreTopology.Members().Keys;
         _raftMachine.TargetMembershipSet = targetMembers;
     }
 }
コード例 #2
0
        public static IDictionary <MemberId, AdvertisedSocketAddress> ExtractCatchupAddressesMap(CoreTopology coreTopology, ReadReplicaTopology rrTopology)
        {
            IDictionary <MemberId, AdvertisedSocketAddress> catchupAddressMap = new Dictionary <MemberId, AdvertisedSocketAddress>();

            foreach (KeyValuePair <MemberId, CoreServerInfo> entry in coreTopology.Members().SetOfKeyValuePairs())
            {
                catchupAddressMap[entry.Key] = entry.Value.CatchupServer;
            }

            foreach (KeyValuePair <MemberId, ReadReplicaInfo> entry in rrTopology.Members().SetOfKeyValuePairs())
            {
                catchupAddressMap[entry.Key] = entry.Value.CatchupServer;
            }

            return(catchupAddressMap);
        }