-
Notifications
You must be signed in to change notification settings - Fork 0
/
extent_server_dist.h
40 lines (32 loc) · 1.05 KB
/
extent_server_dist.h
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
// this is the extent server
#ifndef extent_server_dist_h
#define extent_server_dist_h
#include "extent_protocol.h"
#include <map>
#include <string>
#include <thread>
#include <condition_variable>
#include <future>
#include <iostream>
#include <mutex>
#include "raft.h"
#include "extent_server.h"
#include "raft_test_utils.h"
#include "chfs_state_machine.h"
using chfs_raft = raft<chfs_state_machine, chfs_command_raft>;
using chfs_raft_group = raft_group<chfs_state_machine, chfs_command_raft>;
class extent_server_dist {
public:
chfs_raft_group *raft_group;
extent_server_dist(const int num_raft_nodes = 3) {
raft_group = new chfs_raft_group(num_raft_nodes);
};
chfs_raft *leader() const;
int create(uint32_t type, extent_protocol::extentid_t &id);
int put(extent_protocol::extentid_t id, std::string, int &);
int get(extent_protocol::extentid_t id, std::string &);
int getattr(extent_protocol::extentid_t id, extent_protocol::attr &);
int remove(extent_protocol::extentid_t id, int &);
~extent_server_dist();
};
#endif