public HartbeatTimer(RaftOptions options, ILoggerFactory loggerFactory, ServerIdentifier serverIdentifier) { _options = options; _logger = loggerFactory.CreateLogger(nameof(HartbeatTimer) + " " + serverIdentifier); _serverIdentifier = serverIdentifier; _random = new Random(); }
public RaftClient(ServerIdentifier serverIdentifier, IObserver<ClientMessage> changeMessage, IObservable<ClientResultMessage> clientResult, RaftOptions options, ILoggerFactory loggerFactory) { _serverIdentifier = serverIdentifier; _changeMessage = changeMessage; _clientResult = clientResult; _options = options; _logger = loggerFactory.CreateLogger<RaftClient>(); }
public VoteReceived(IObserver<RequestVoteResultMessage> voteReply, ServerIdentifier serverIdentifier, IObservable<RequestVoteMessage> requestVote, Election election, ILoggerFactory loggerFactory, Nodes nodes, RaftOptions options, ILogReplication logReplication) { _voteReply = voteReply; _election = election; _nodes = nodes; _options = options; _logReplication = logReplication; _serverIdentifier = serverIdentifier; _voteReceivedDisposable = requestVote.Subscribe(VoteRequestReceived); _logger = loggerFactory.CreateLogger(nameof(VoteReceived) + " " + serverIdentifier); }
public AppendEntry(IObserver<AppendEntryResultMessage> entryReply, IObservable<AppendEntryMessage> receivedAppendEntryMessage, IHartbeatTimer hartbeat, ILogReplication logReplication, Election election, ILoggerFactory loggerFactory, RaftOptions options, ServerIdentifier serverIdentifier, IEnumerable<IRaftService> services) { _entryReply = entryReply; _hartbeat = hartbeat; _receivedDisposable = receivedAppendEntryMessage.Subscribe(RaciveHartbeat); _logReplication = logReplication; _election = election; _options = options; _serverIdentifier = serverIdentifier; _services = services; _logger = loggerFactory.CreateLogger(nameof(AppendEntry) + " " + serverIdentifier); }