本文整理匯總了Java中org.apache.zeppelin.interpreter.thrift.RemoteInterpreterEvent類的典型用法代碼示例。如果您正苦於以下問題:Java RemoteInterpreterEvent類的具體用法?Java RemoteInterpreterEvent怎麽用?Java RemoteInterpreterEvent使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
RemoteInterpreterEvent類屬於org.apache.zeppelin.interpreter.thrift包,在下文中一共展示了RemoteInterpreterEvent類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getEvent
import org.apache.zeppelin.interpreter.thrift.RemoteInterpreterEvent; //導入依賴的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.RemoteInterpreterEvent; //導入依賴的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.RemoteInterpreterEvent; //導入依賴的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.RemoteInterpreterEvent; //導入依賴的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.RemoteInterpreterEvent; //導入依賴的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: getMockEventsInterpreterProcess
import org.apache.zeppelin.interpreter.thrift.RemoteInterpreterEvent; //導入依賴的package包/類
private RemoteInterpreterProcess getMockEventsInterpreterProcess() throws Exception {
RemoteInterpreterEvent fakeEvent = new RemoteInterpreterEvent();
RemoteInterpreterEvent noMoreEvents = new RemoteInterpreterEvent(NO_OP, "");
RemoteInterpreterService.Client client = mock(RemoteInterpreterService.Client.class);
RemoteInterpreterProcess intProc = mock(RemoteInterpreterProcess.class);
when(client.getEvent()).thenReturn(fakeEvent, fakeEvent, noMoreEvents);
when(intProc.getClient()).thenReturn(client);
return intProc;
}
示例7: getZeppelinServerNoteRunner
import org.apache.zeppelin.interpreter.thrift.RemoteInterpreterEvent; //導入依賴的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)));
}
示例8: angularObjectRemove
import org.apache.zeppelin.interpreter.thrift.RemoteInterpreterEvent; //導入依賴的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)));
}
示例9: onInterpreterOutputAppend
import org.apache.zeppelin.interpreter.thrift.RemoteInterpreterEvent; //導入依賴的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)));
}
示例10: onInterpreterOutputUpdate
import org.apache.zeppelin.interpreter.thrift.RemoteInterpreterEvent; //導入依賴的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)));
}
示例11: onInterpreterOutputUpdateAll
import org.apache.zeppelin.interpreter.thrift.RemoteInterpreterEvent; //導入依賴的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)));
}
示例12: sendEvent
import org.apache.zeppelin.interpreter.thrift.RemoteInterpreterEvent; //導入依賴的package包/類
private void sendEvent(RemoteInterpreterEvent event) {
logger.debug("Send Event: " + event);
synchronized (eventQueue) {
eventQueue.add(event);
eventQueue.notifyAll();
}
}
示例13: onAppOutputAppend
import org.apache.zeppelin.interpreter.thrift.RemoteInterpreterEvent; //導入依賴的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)));
}
示例14: onAppOutputUpdate
import org.apache.zeppelin.interpreter.thrift.RemoteInterpreterEvent; //導入依賴的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)));
}
示例15: onAppStatusUpdate
import org.apache.zeppelin.interpreter.thrift.RemoteInterpreterEvent; //導入依賴的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)));
}