/
op_def.proto
79 lines (65 loc) · 2.25 KB
/
op_def.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
// Copyright 2020 Alibaba Group Holding Limited. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
syntax = "proto3";
package gs.rpc;
import "attr_value.proto";
import "error_codes.proto";
import "graph_def.proto";
import "types.proto";
message OpDef {
// Unique key for every OpDef. Usually generated by analytical engine.
string key = 2;
// The operation name. There may be custom parameters in attrs.
OperationType op = 3;
// Used for store an op's parents, i.e. use which op to produce this op.
repeated string parents = 4;
// Different types of op may create different output.
OutputType output_type = 5;
// Operation-specific configuration.
map<int32, AttrValue> attr = 6;
// Operation-specific configuration for large chunk.
// e.g. dataframe or numpy data
LargeAttrValue large_attr = 7;
// arguments that served as application querying parameters.
// Such as source vertex id for SSSP.
QueryArgs query_args = 8;
};
// Result of Op
message OpResult {
message Meta {
// if success, store the metrics. (e.g. how many seconds used, memory bytes...)
string metrics = 1;
// result represents raw bytes if:
// 1) NDArray or DataFrame
// 2) Gremlin result
// 3) Graph report information of Networkx
bool has_large_result = 2;
// if the op create a graph or modify a graph, return the meta data of the graph.
};
// Status code
Code code = 1;
// unique key for every op
string key = 2;
// Meta
Meta meta = 3;
// result represents app_name or context_key or raw bytes If the op returns a NDArray or DataFrame
bytes result = 4;
string error_msg = 5;
gs.rpc.graph.GraphDefPb graph_def = 7;
};
// Consist by list of ops.
message DagDef {
repeated OpDef op = 1;
};