本文整理汇总了Java中org.apache.zeppelin.interpreter.thrift.RemoteInterpreterEventType类的典型用法代码示例。如果您正苦于以下问题:Java RemoteInterpreterEventType类的具体用法?Java RemoteInterpreterEventType怎么用?Java RemoteInterpreterEventType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
RemoteInterpreterEventType类属于org.apache.zeppelin.interpreter.thrift包,在下文中一共展示了RemoteInterpreterEventType类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getEvent
import org.apache.zeppelin.interpreter.thrift.RemoteInterpreterEventType; //导入依赖的package包/类
@Override
public RemoteInterpreterEvent getEvent() throws TException {
synchronized (eventQueue) {
if (eventQueue.isEmpty()) {
try {
eventQueue.wait(1000);
} catch (InterruptedException e) {
}
}
if (eventQueue.isEmpty()) {
return new RemoteInterpreterEvent(RemoteInterpreterEventType.NO_OP, "");
} else {
return eventQueue.remove(0);
}
}
}
示例2: getAllResources
import org.apache.zeppelin.interpreter.thrift.RemoteInterpreterEventType; //导入依赖的package包/类
/**
* Get all resources except for specific resourcePool
* @return
*/
@Override
public ResourceSet getAllResources() {
// request
sendEvent(new RemoteInterpreterEvent(RemoteInterpreterEventType.RESOURCE_POOL_GET_ALL, null));
synchronized (getAllResourceResponse) {
while (getAllResourceResponse.isEmpty()) {
try {
getAllResourceResponse.wait();
} catch (InterruptedException e) {
logger.warn(e.getMessage(), e);
}
}
ResourceSet resourceSet = getAllResourceResponse.remove(0);
return resourceSet;
}
}
示例3: pollEvent
import org.apache.zeppelin.interpreter.thrift.RemoteInterpreterEventType; //导入依赖的package包/类
/**
* Supposed to call from RemoteInterpreterEventPoller
* @return next available event
*/
public RemoteInterpreterEvent pollEvent() {
synchronized (eventQueue) {
if (eventQueue.isEmpty()) {
try {
eventQueue.wait(1000);
} catch (InterruptedException e) {
}
}
if (eventQueue.isEmpty()) {
return new RemoteInterpreterEvent(RemoteInterpreterEventType.NO_OP, "");
} else {
RemoteInterpreterEvent event = eventQueue.remove(0);
logger.debug("Send event {}", event.getType());
return event;
}
}
}
示例4: run
import org.apache.zeppelin.interpreter.thrift.RemoteInterpreterEventType; //导入依赖的package包/类
@Override
public void run() {
Gson gson = new Gson();
server.sendEvent(new RemoteInterpreterEvent(
RemoteInterpreterEventType.RUN_INTERPRETER_CONTEXT_RUNNER,
gson.toJson(this)));
}
示例5: onRemove
import org.apache.zeppelin.interpreter.thrift.RemoteInterpreterEventType; //导入依赖的package包/类
@Override
public void onRemove(String interpreterGroupId, String name, String noteId) {
Map<String, String> removeObject = new HashMap<String, String>();
removeObject.put("name", name);
removeObject.put("noteId", noteId);
sendEvent(new RemoteInterpreterEvent(
RemoteInterpreterEventType.ANGULAR_OBJECT_REMOVE, gson.toJson(removeObject)));
}
示例6: getZeppelinServerNoteRunner
import org.apache.zeppelin.interpreter.thrift.RemoteInterpreterEventType; //导入依赖的package包/类
/**
* Run paragraph
* @param runner
*/
public void getZeppelinServerNoteRunner(
String eventOwnerKey, ZeppelinServerResourceParagraphRunner runner) {
RemoteZeppelinServerResource eventBody = new RemoteZeppelinServerResource();
eventBody.setResourceType(RemoteZeppelinServerResource.Type.PARAGRAPH_RUNNERS);
eventBody.setOwnerKey(eventOwnerKey);
eventBody.setData(runner);
sendEvent(new RemoteInterpreterEvent(
RemoteInterpreterEventType.REMOTE_ZEPPELIN_SERVER_RESOURCE,
gson.toJson(eventBody)));
}
示例7: angularObjectRemove
import org.apache.zeppelin.interpreter.thrift.RemoteInterpreterEventType; //导入依赖的package包/类
/**
* notify angularObject removal
*/
public void angularObjectRemove(String name, String noteId, String paragraphId) {
Map<String, String> removeObject = new HashMap<>();
removeObject.put("name", name);
removeObject.put("noteId", noteId);
removeObject.put("paragraphId", paragraphId);
sendEvent(new RemoteInterpreterEvent(
RemoteInterpreterEventType.ANGULAR_OBJECT_REMOVE, gson.toJson(removeObject)));
}
示例8: onInterpreterOutputAppend
import org.apache.zeppelin.interpreter.thrift.RemoteInterpreterEventType; //导入依赖的package包/类
public void onInterpreterOutputAppend(
String noteId, String paragraphId, int outputIndex, String output) {
Map<String, String> appendOutput = new HashMap<>();
appendOutput.put("noteId", noteId);
appendOutput.put("paragraphId", paragraphId);
appendOutput.put("index", Integer.toString(outputIndex));
appendOutput.put("data", output);
sendEvent(new RemoteInterpreterEvent(
RemoteInterpreterEventType.OUTPUT_APPEND,
gson.toJson(appendOutput)));
}
示例9: onInterpreterOutputUpdate
import org.apache.zeppelin.interpreter.thrift.RemoteInterpreterEventType; //导入依赖的package包/类
public void onInterpreterOutputUpdate(
String noteId, String paragraphId, int outputIndex,
InterpreterResult.Type type, String output) {
Map<String, String> appendOutput = new HashMap<>();
appendOutput.put("noteId", noteId);
appendOutput.put("paragraphId", paragraphId);
appendOutput.put("index", Integer.toString(outputIndex));
appendOutput.put("type", type.name());
appendOutput.put("data", output);
sendEvent(new RemoteInterpreterEvent(
RemoteInterpreterEventType.OUTPUT_UPDATE,
gson.toJson(appendOutput)));
}
示例10: onInterpreterOutputUpdateAll
import org.apache.zeppelin.interpreter.thrift.RemoteInterpreterEventType; //导入依赖的package包/类
public void onInterpreterOutputUpdateAll(
String noteId, String paragraphId, List<InterpreterResultMessage> messages) {
Map<String, Object> appendOutput = new HashMap<>();
appendOutput.put("noteId", noteId);
appendOutput.put("paragraphId", paragraphId);
appendOutput.put("messages", messages);
sendEvent(new RemoteInterpreterEvent(
RemoteInterpreterEventType.OUTPUT_UPDATE_ALL,
gson.toJson(appendOutput)));
}
示例11: onAppOutputAppend
import org.apache.zeppelin.interpreter.thrift.RemoteInterpreterEventType; //导入依赖的package包/类
public void onAppOutputAppend(
String noteId, String paragraphId, int index, String appId, String output) {
Map<String, Object> appendOutput = new HashMap<>();
appendOutput.put("noteId", noteId);
appendOutput.put("paragraphId", paragraphId);
appendOutput.put("index", Integer.toString(index));
appendOutput.put("appId", appId);
appendOutput.put("data", output);
sendEvent(new RemoteInterpreterEvent(
RemoteInterpreterEventType.OUTPUT_APPEND,
gson.toJson(appendOutput)));
}
示例12: onAppOutputUpdate
import org.apache.zeppelin.interpreter.thrift.RemoteInterpreterEventType; //导入依赖的package包/类
public void onAppOutputUpdate(
String noteId, String paragraphId, int index, String appId,
InterpreterResult.Type type, String output) {
Map<String, Object> appendOutput = new HashMap<>();
appendOutput.put("noteId", noteId);
appendOutput.put("paragraphId", paragraphId);
appendOutput.put("index", Integer.toString(index));
appendOutput.put("appId", appId);
appendOutput.put("type", type);
appendOutput.put("data", output);
logger.debug("onAppoutputUpdate = {}", output);
sendEvent(new RemoteInterpreterEvent(
RemoteInterpreterEventType.OUTPUT_UPDATE,
gson.toJson(appendOutput)));
}
示例13: onAppStatusUpdate
import org.apache.zeppelin.interpreter.thrift.RemoteInterpreterEventType; //导入依赖的package包/类
public void onAppStatusUpdate(String noteId, String paragraphId, String appId, String status) {
Map<String, String> appendOutput = new HashMap<>();
appendOutput.put("noteId", noteId);
appendOutput.put("paragraphId", paragraphId);
appendOutput.put("appId", appId);
appendOutput.put("status", status);
sendEvent(new RemoteInterpreterEvent(
RemoteInterpreterEventType.APP_STATUS_UPDATE,
gson.toJson(appendOutput)));
}
示例14: onAdd
import org.apache.zeppelin.interpreter.thrift.RemoteInterpreterEventType; //导入依赖的package包/类
@Override
public void onAdd(String interpreterGroupId, AngularObject object) {
sendEvent(new RemoteInterpreterEvent(
RemoteInterpreterEventType.ANGULAR_OBJECT_ADD, gson.toJson(object)));
}
示例15: onUpdate
import org.apache.zeppelin.interpreter.thrift.RemoteInterpreterEventType; //导入依赖的package包/类
@Override
public void onUpdate(String interpreterGroupId, AngularObject object) {
sendEvent(new RemoteInterpreterEvent(
RemoteInterpreterEventType.ANGULAR_OBJECT_UPDATE, gson.toJson(object)));
}