use of org.apache.zeppelin.annotation.ZeppelinApi in project zeppelin by apache.
the class ZeppelinContext method remove.
/**
* Remove object from resourcePool
* @param name
*/
@ZeppelinApi
public void remove(String name) {
ResourcePool resourcePool = interpreterContext.getResourcePool();
resourcePool.remove(name);
}
use of org.apache.zeppelin.annotation.ZeppelinApi in project zeppelin by apache.
the class ZeppelinContext method put.
/**
* Add object into resource pool
* @param name
* @param value
*/
@ZeppelinApi
public void put(String name, Object value) {
ResourcePool resourcePool = interpreterContext.getResourcePool();
resourcePool.put(name, value);
}
use of org.apache.zeppelin.annotation.ZeppelinApi in project zeppelin by apache.
the class ZeppelinContext method get.
/**
* Get object from resource pool
* Search local process first and then the other processes
* @param name
* @return null if resource not found
*/
@ZeppelinApi
public Object get(String name) {
ResourcePool resourcePool = interpreterContext.getResourcePool();
Resource resource = resourcePool.get(name);
if (resource != null) {
return resource.get();
} else {
return null;
}
}
use of org.apache.zeppelin.annotation.ZeppelinApi in project zeppelin by apache.
the class Interpreter method getProperty.
@ZeppelinApi
public Properties getProperty() {
Properties p = new Properties();
p.putAll(property);
RegisteredInterpreter registeredInterpreter = Interpreter.findRegisteredInterpreterByClassName(getClassName());
if (null != registeredInterpreter) {
Map<String, InterpreterProperty> defaultProperties = registeredInterpreter.getProperties();
for (String k : defaultProperties.keySet()) {
if (!p.containsKey(k)) {
String value = defaultProperties.get(k).getValue();
if (value != null) {
p.put(k, defaultProperties.get(k).getValue());
}
}
}
}
return p;
}
use of org.apache.zeppelin.annotation.ZeppelinApi in project zeppelin by apache.
the class ZeppelinContext method getInterpreterContextRunner.
/**
* get Zeppelin Paragraph Runner from zeppelin server
* @param noteId
* @param paragraphId
*/
@ZeppelinApi
public List<InterpreterContextRunner> getInterpreterContextRunner(String noteId, String paragraphId, InterpreterContext interpreterContext) {
List<InterpreterContextRunner> runners = new LinkedList<>();
RemoteWorksController remoteWorksController = interpreterContext.getRemoteWorksController();
if (remoteWorksController != null) {
runners = remoteWorksController.getRemoteContextRunner(noteId, paragraphId);
}
return runners;
}
Aggregations