-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.hpp
46 lines (40 loc) · 1.18 KB
/
main.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
40
41
42
43
44
45
46
//
// Created by David Chu on 10/4/20.
//
#ifndef C__PAXOS_MAIN_HPP
#define C__PAXOS_MAIN_HPP
#include <string>
#include <vector>
#include <unordered_map>
#include "models/server_component.hpp"
#include "models/client_component.hpp"
#include "models/heartbeat_component.hpp"
#include "utils/config.hpp"
#include "utils/network.hpp"
#include "utils/uuid.hpp"
#include "utils/metrics.hpp"
#include "aws/scaling.hpp"
class paxos {
public:
[[noreturn]]
explicit paxos(int delay, int numClients, int numBatchers = 0, int numProxyLeaders = 0, int numAcceptorGroups = 0,
int numUnbatchers = 0);
private:
const bool shouldStartCluster;
const int numBatchers;
const int numProxyLeaders;
const int numAcceptorGroups;
const int numUnbatchers;
std::vector<string> instanceIdsOfBatchers;
std::vector<string> instanceIdsOfProposers;
std::vector<string> instanceIdsOfProxyLeaders;
std::unordered_map<std::string, std::vector<string>> instanceIdsOfAcceptors;
std::vector<string> instanceIdsOfUnbatchers;
anna* annaClient;
network* zmqNetwork;
heartbeat_component* batcherHeartbeat;
client_component* batchers;
server_component* unbatchers;
void startCluster();
};
#endif //C__PAXOS_MAIN_HPP