-
Notifications
You must be signed in to change notification settings - Fork 6
/
rpc.proto
106 lines (85 loc) · 2.09 KB
/
rpc.proto
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
syntax = "proto3";
package lrmrpb;
option go_package = "github.com/ab180/lrmr/lrmrpb";
import "lrdd/row.proto";
import "internal/pbtypes/types.proto";
service Node {
rpc CreateJob (CreateJobRequest) returns (pbtypes.Empty);
rpc StartJobInBackground (StartJobRequest) returns (pbtypes.Empty);
rpc StartJobInForeground (StartJobRequest) returns (stream JobOutput);
rpc PushData (stream PushDataRequest) returns (pbtypes.Empty);
}
message CreateJobRequest {
pbtypes.JSON job = 1;
repeated Stage stages = 2;
map<string, bytes> broadcasts = 3;
}
message Stage {
string name = 1;
repeated Task tasks = 2;
reserved 3;
repeated Input input = 4;
Output output = 5;
int32 rowType = 6;
}
message Task {
string partitionID = 1;
}
message StartJobRequest {
string jobID = 1;
}
message JobOutput {
enum Type {
TASKS_READY = 0;
COLLECT_DATA = 1;
REPORT_TASK_COMPLETION = 2;
}
Type type = 1;
// sender task
string stage = 2;
string partitionID = 3;
// on type == COLLECT_DATA
repeated lrdd.RawRow data = 5;
int32 rowType = 6;
// on type == REPORT_TASK_COMPLETION
enum TaskStatus {
SUCCEED = 0;
FAILED = 1;
}
TaskStatus taskStatus = 7;
string error = 8;
string stacktrace = 9;
map<string, uint64> metrics = 10; // metrics per task
}
message Input {
enum Type {
PUSH = 0;
POLL = 1;
}
Type type = 1;
}
message Output {
enum Type {
PUSH = 0;
POLL = 1;
}
Type type = 1;
// partitionKeyToHost contains an ordered mapping of partition key to output hostname.
map<string, string> partitionToHost = 2;
}
message HostMapping {
string host = 1;
string taskID = 2;
}
message CreateTaskResponse {
string taskID = 1;
}
// PushDataRequest is a request to push data for a worker to process.
// metadata with key "header" and value of DataHeader is required.
message PushDataRequest {
repeated lrdd.RawRow data = 1;
}
message DataHeader {
string taskID = 1;
string fromHost = 2;
}