-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathextent_client.h
48 lines (39 loc) · 1.27 KB
/
extent_client.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
41
42
43
44
45
46
47
// extent client interface.
#ifndef extent_client_h
#define extent_client_h
#include <string>
#include "extent_protocol.h"
#include "lock_client_cache_rsm.h"
#include "rpc.h"
class extent {
public:
extent_protocol::extentid_t id;
std::string data;
extent_protocol::attr attr;
extent();
extent(extent_protocol::extentid_t);
};
class extent_client : public lock_release_user {
private:
std::map<extent_protocol::extentid_t, extent> extentset;
rpcc *cl;
pthread_mutex_t m;
public:
extent_client();
~extent_client();
extent_protocol::status get(extent_protocol::extentid_t eid,
std::string &buf);
extent_protocol::status getattr(extent_protocol::extentid_t eid,
extent_protocol::attr &a);
extent_protocol::status put(extent_protocol::extentid_t eid, std::string buf);
extent_protocol::status remove(extent_protocol::extentid_t eid);
void flush(extent_protocol::extentid_t);
void populate(extent_protocol::extentid_t, std::string);
void fetch(extent_protocol::extentid_t, std::string &);
void evict(extent_protocol::extentid_t);
void dorelease(lock_protocol::lockid_t);
void dopopulate(lock_protocol::lockid_t, std::string);
void dofetch(lock_protocol::lockid_t, std::string &);
void doevict(lock_protocol::lockid_t);
};
#endif