This repository has been archived by the owner on Nov 22, 2017. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathThrudb.thrift
76 lines (69 loc) · 1.82 KB
/
Thrudb.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
75
76
namespace cpp thrudb
namespace php Thrudb
namespace perl Thrudb
namespace java org.thrudb
namespace ruby Thrudb
/**
* <pre>Represents a single log entry.
*
* This is captured off the wire so is the in the Thrift protocol used
* during transfer
*
* @lsn - the log sequence number of the message
* @message - the message itself.</pre>
*/
struct logEntry {
1:string bucket,
2:string lsn,
3:binary message
}
/**
* Base service calls all thrudb services must implement.
*
* Primarily for KPI and Replication purposes.
*
*/
service Thrudb {
/**
*<pre>
*Lists the names of the servers currently running
*</pre>
list<string> getAvailibleServers();
/**
* <pre>
* Retrieves a map of data about this service.
*
* There are many kinds of data:
*
* Service call counts -
* All keys will start with "mc_", example: "mc_get"
* All values will represent number of times invoked
*
* Service call message sizes -
* All keys will start with "ms_"
* All values will represent total bytes received
*
* Service memory/cpu usage, uptime and health -
* key:"heap", value:heapsize in kb
* key:"cpu", value:0-100 representing %cpu
* key:"uptime",value:seconds since start
*
*
* Note, this data is ephemeral so if the service is restarted the previous
* stats are lost.</pre>
*/
map<string,i64> getServiceStats(1:string server),
/**
* Acts as a noop, for debug and monitoring purposes.
*/
void ping(),
/**
* <pre>Will return a number of binary requests from the redo logs.
*
* @param lsn
* The log sequence number to start from (inclusive)
* @param kbLimit
* The max response size of the messages (not strict)</pre>
*/
list<logEntry> getLogSince(1:string server, 2:string bucket, 3:string lsn, 3:i32 kbLimit);
}