-
Notifications
You must be signed in to change notification settings - Fork 2.8k
/
Copy pathRemoteInterpreterService.thrift
128 lines (110 loc) · 5.43 KB
/
RemoteInterpreterService.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
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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you 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.
*/
namespace java org.apache.zeppelin.interpreter.thrift
struct RemoteInterpreterContext {
1: string noteId,
2: string noteName,
3: string paragraphId,
4: string replName,
5: string paragraphTitle,
6: string paragraphText,
7: string authenticationInfo,
8: string config, // json serialized config
9: string gui, // json serialized gui
10: string noteGui, // json serialized note gui
11: map<string, string> localProperties
}
struct RemoteInterpreterResultMessage {
1: string type,
2: string data
}
struct RemoteInterpreterResult {
1: string code,
2: list<RemoteInterpreterResultMessage> msg,
3: string config, // json serialized config
4: string gui // json serialized gui
5: string noteGui // json serialized note gui
}
enum RemoteInterpreterEventType {
NO_OP = 1,
ANGULAR_OBJECT_ADD = 2,
ANGULAR_OBJECT_UPDATE = 3,
ANGULAR_OBJECT_REMOVE = 4,
RUN_INTERPRETER_CONTEXT_RUNNER = 5,
RESOURCE_POOL_GET_ALL = 6,
RESOURCE_GET = 7
OUTPUT_APPEND = 8,
OUTPUT_UPDATE = 9,
OUTPUT_UPDATE_ALL = 10,
ANGULAR_REGISTRY_PUSH = 11,
APP_STATUS_UPDATE = 12,
META_INFOS = 13,
REMOTE_ZEPPELIN_SERVER_RESOURCE = 14,
RESOURCE_INVOKE_METHOD = 15,
PARA_INFOS = 16
}
struct RemoteInterpreterEvent {
1: RemoteInterpreterEventType type,
2: string data // json serialized data
}
struct RemoteApplicationResult {
1: bool success,
2: string msg
}
/*
* The below variables(name, value) will be connected to getCompletions in paragraph.controller.js
*
* name: which is shown in the suggestion list
* value: actual return value what you selected
*/
struct InterpreterCompletion {
1: string name,
2: string value,
3: string meta
}
exception InterpreterRPCException {
1: string errorMessage,
}
service RemoteInterpreterService {
void createInterpreter(1: string intpGroupId, 2: string sessionId, 3: string className, 4: map<string, string> properties, 5: string userName) throws (1: InterpreterRPCException ex);
void init(1: map<string, string> properties) throws (1: InterpreterRPCException ex);
void open(1: string sessionId, 2: string className) throws (1: InterpreterRPCException ex);
void close(1: string sessionId, 2: string className) throws (1: InterpreterRPCException ex);
void reconnect(1: string host, 2: i32 port) throws (1: InterpreterRPCException ex);
RemoteInterpreterResult interpret(1: string sessionId, 2: string className, 3: string st, 4: RemoteInterpreterContext interpreterContext) throws (1: InterpreterRPCException ex);
void cancel(1: string sessionId, 2: string className, 3: RemoteInterpreterContext interpreterContext) throws (1: InterpreterRPCException ex);
i32 getProgress(1: string sessionId, 2: string className, 3: RemoteInterpreterContext interpreterContext) throws (1: InterpreterRPCException ex);
string getFormType(1: string sessionId, 2: string className) throws (1: InterpreterRPCException ex);
list<InterpreterCompletion> completion(1: string sessionId, 2: string className, 3: string buf, 4: i32 cursor, 5: RemoteInterpreterContext interpreterContext) throws (1: InterpreterRPCException ex);
void shutdown();
string getStatus(1: string sessionId, 2:string jobId) throws (1: InterpreterRPCException ex);
list<string> resourcePoolGetAll() throws (1: InterpreterRPCException ex);
// get value of resource
binary resourceGet(1: string sessionId, 2: string paragraphId, 3: string resourceName) throws (1: InterpreterRPCException ex);
// remove resource
bool resourceRemove(1: string sessionId, 2: string paragraphId, 3:string resourceName) throws (1: InterpreterRPCException ex);
// invoke method on resource
binary resourceInvokeMethod(1: string sessionId, 2: string paragraphId, 3:string resourceName, 4:string invokeMessage) throws (1: InterpreterRPCException ex);
void angularObjectUpdate(1: string name, 2: string sessionId, 3: string paragraphId, 4: string object) throws (1: InterpreterRPCException ex);
void angularObjectAdd(1: string name, 2: string sessionId, 3: string paragraphId, 4: string object) throws (1: InterpreterRPCException ex);
void angularObjectRemove(1: string name, 2: string sessionId, 3: string paragraphId) throws (1: InterpreterRPCException ex);
void angularRegistryPush(1: string registry) throws (1: InterpreterRPCException ex);
RemoteApplicationResult loadApplication(1: string applicationInstanceId, 2: string packageInfo, 3: string sessionId, 4: string paragraphId) throws (1: InterpreterRPCException ex);
RemoteApplicationResult unloadApplication(1: string applicationInstanceId) throws (1: InterpreterRPCException ex);
RemoteApplicationResult runApplication(1: string applicationInstanceId) throws (1: InterpreterRPCException ex);
}