public RaftNode(IClusterMembership clusterMembership) { this.clusterMembership = clusterMembership; CurrentTerm = 0; VotedFor = null; Log = new List <LogEntry>(); Snapshot = null; CommitIndex = 0; LastApplied = 0; LeaderState = null; CandidateState = null; }
public ClusterMonitorProvider(ISocketFactory socketFactory, RouterConfiguration routerConfiguration, IClusterMembership clusterMembership, ClusterMembershipConfiguration membershipConfiguration, IRendezvousCluster rendezvousCluster, ILogger logger) { clusterMonitor = membershipConfiguration.RunAsStandalone ? (IClusterMonitor) new LoopbackClusterMonitor() : new ClusterMonitor(socketFactory, routerConfiguration, clusterMembership, membershipConfiguration, rendezvousCluster, logger); }
public ClusterMonitor(ISocketFactory socketFactory, RouterConfiguration routerConfiguration, IClusterMembership clusterMembership, ClusterMembershipConfiguration membershipConfiguration, IRendezvousCluster rendezvousCluster, ILogger logger) { this.logger = logger; this.membershipConfiguration = membershipConfiguration; pingReceived = new ManualResetEventSlim(false); newRendezvousConfiguration = new ManualResetEventSlim(false); this.socketFactory = socketFactory; this.routerConfiguration = routerConfiguration; this.clusterMembership = clusterMembership; this.rendezvousCluster = rendezvousCluster; outgoingMessages = new BlockingCollection<IMessage>(new ConcurrentQueue<IMessage>()); }