-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTaskMsg.proto
More file actions
53 lines (46 loc) · 1.48 KB
/
TaskMsg.proto
File metadata and controls
53 lines (46 loc) · 1.48 KB
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
syntax = "proto2";
option optimize_for = LITE_RUNTIME;
package dwork;
message TaskMsg {
enum State {
Pending = 0;
Stolen = 1;
Waiting = 2;
Copying = 3;
Ready = 4;
Started = 5;
Done = 6;
Recorded = 7;
}
message Dep {
required string name = 1; // globally unique task name
optional string location = 2; // url
}
message LogMsg { // written on entry to ea. state
required State state = 1;
required int64 time = 2; // microseconds
}
required string name = 1; // globally unique task name
required string origin = 2; // hostname
repeated Dep pred = 4; // ignored on Transfer
repeated Dep succ = 5; // ignored on Create
repeated LogMsg log = 6;
}
message QueryMsg {
enum Type {
Create = 0; // Create new tasks (requires TaskMsg)
Steal = 1; // request a ready task (requires name == hostname)
Complete = 2; // notify on completion of a task (requires TaskMsg and location)
Transfer = 3; // transfer responsibility for a job (requires TaskMsg and location)
Lookup = 4; // lookup a location
NotFound = 5; // reply to steal / transfer
OK = 6;
Exit = 7; // signal exit of server
Error = 8; // message format/parse error
}
required Type type = 1;
repeated TaskMsg task = 2; // required when type == Notify
optional string name = 3; // task to lookup
optional int32 n = 4;
optional string location = 6; // hostname lookup response OR hostname doing stealing
}