Esempio n. 1
0
        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);
 }
Esempio n. 3
0
 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>());
 }