-
Notifications
You must be signed in to change notification settings - Fork 1
/
acceptor.hpp
39 lines (33 loc) · 930 Bytes
/
acceptor.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
//
// Created by David Chu on 10/4/20.
//
#ifndef C__PAXOS_ACCEPTOR_HPP
#define C__PAXOS_ACCEPTOR_HPP
#include <string>
#include <vector>
#include "utils/config.hpp"
#include "utils/network.hpp"
#include "utils/metrics.hpp"
#include "models/log.hpp"
#include "models/message.hpp"
#include "models/server_component.hpp"
#include "message.pb.h"
#include "lib/storage/anna.hpp"
class acceptor {
public:
explicit acceptor(std::string&& acceptorGroupId);
private:
std::shared_ptr<metrics::variables> metricsVars;
anna* annaClient;
network *zmqNetwork;
server_component* proxyLeaders;
const std::string acceptorGroupId;
Ballot highestBallot = {};
Log::pValueLog log = {};
/**
* Process p1a and p2a messages from proxy leaders.
* @param socket Socket ID of proxy leader
*/
void listenToProxyLeaders(const network::addressPayloadsMap& addressToPayloads);
};
#endif //C__PAXOS_ACCEPTOR_HPP