當前位置: 首頁>>代碼示例>>Java>>正文


Java RemoteInterpreterEventType類代碼示例

本文整理匯總了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);
    }
  }
}
 
開發者ID:lorthos,項目名稱:incubator-zeppelin-druid,代碼行數:18,代碼來源:RemoteInterpreterServer.java

示例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;
  }
}
 
開發者ID:apache,項目名稱:zeppelin,代碼行數:22,代碼來源:RemoteInterpreterEventClient.java

示例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;
    }
  }
}
 
開發者ID:apache,項目名稱:zeppelin,代碼行數:23,代碼來源:RemoteInterpreterEventClient.java

示例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)));
}
 
開發者ID:lorthos,項目名稱:incubator-zeppelin-druid,代碼行數:8,代碼來源:RemoteInterpreterServer.java

示例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)));
}
 
開發者ID:lorthos,項目名稱:incubator-zeppelin-druid,代碼行數:10,代碼來源:RemoteInterpreterServer.java

示例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)));
}
 
開發者ID:apache,項目名稱:zeppelin,代碼行數:16,代碼來源:RemoteInterpreterEventClient.java

示例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)));
}
 
開發者ID:apache,項目名稱:zeppelin,代碼行數:13,代碼來源:RemoteInterpreterEventClient.java

示例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)));
}
 
開發者ID:apache,項目名稱:zeppelin,代碼行數:13,代碼來源:RemoteInterpreterEventClient.java

示例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)));
}
 
開發者ID:apache,項目名稱:zeppelin,代碼行數:15,代碼來源:RemoteInterpreterEventClient.java

示例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)));
}
 
開發者ID:apache,項目名稱:zeppelin,代碼行數:12,代碼來源:RemoteInterpreterEventClient.java

示例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)));
}
 
開發者ID:apache,項目名稱:zeppelin,代碼行數:14,代碼來源:RemoteInterpreterEventClient.java

示例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)));
}
 
開發者ID:apache,項目名稱:zeppelin,代碼行數:16,代碼來源:RemoteInterpreterEventClient.java

示例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)));
}
 
開發者ID:apache,項目名稱:zeppelin,代碼行數:12,代碼來源:RemoteInterpreterEventClient.java

示例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)));
}
 
開發者ID:lorthos,項目名稱:incubator-zeppelin-druid,代碼行數:6,代碼來源:RemoteInterpreterServer.java

示例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)));
}
 
開發者ID:lorthos,項目名稱:incubator-zeppelin-druid,代碼行數:6,代碼來源:RemoteInterpreterServer.java


注:本文中的org.apache.zeppelin.interpreter.thrift.RemoteInterpreterEventType類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。