-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathkvstore.thrift
75 lines (55 loc) · 1.49 KB
/
kvstore.thrift
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
exception SystemException {
1: optional string message
}
/* struct RFileMetadata { */
/* 1: optional string filename; */
/* 2: optional i32 version; */
/* } */
/* struct RFile { */
/* 1: optional RFileMetadata meta; */
/* 2: optional string content; */
/* } */
struct NodeID {
1: string id;
2: string ip;
3: i32 port;
}
struct KVPair {
1: i32 key;
2: string val;
}
struct KVPairHinted {
1: i32 key;
2: string val;
}
struct GetRet {
1: string val;
2: bool ret;
}
struct GetRetTime {
1: string val;
2: bool ret;
3: optional double time;
}
service KVStore {
GetRet get(1: i32 key, 2: i32 clevel)
throws (1: SystemException systemException),
GetRetTime _get(1: i32 key)
throws (1: SystemException systemException),
void put(1: KVPair kvpair, 2: i32 clevel)
throws (1: SystemException systemException),
void _put(1: KVPair kvpair, 2: i32 clevel)
throws (1: SystemException systemException),
list<KVPair> _get_hints(1: i32 id)
/* void writeFile(1: RFile rFile) */
/* throws (1: SystemException systemException), */
/* RFile readFile(1: string filename) */
/* throws (1: SystemException systemException), */
/* void setFingertable(1: list<NodeID> node_list), */
/* NodeID findSucc(1: string key) */
/* throws (1: SystemException systemException), */
/* NodeID findPred(1: string key) */
/* throws (1: SystemException systemException), */
/* NodeID getNodeSucc() */
/* throws (1: SystemException systemException), */
}