use of org.apache.zeppelin.display.AngularObject in project zeppelin by apache.
the class ZeppelinContext method getAngularObject.
private AngularObject getAngularObject(String name, InterpreterContext interpreterContext) {
AngularObjectRegistry registry = interpreterContext.getAngularObjectRegistry();
String noteId = interpreterContext.getNoteId();
// try get local object
AngularObject paragraphAo = registry.get(name, noteId, interpreterContext.getParagraphId());
AngularObject noteAo = registry.get(name, noteId, null);
AngularObject ao = paragraphAo != null ? paragraphAo : noteAo;
if (ao == null) {
// then global object
ao = registry.get(name, null, null);
}
return ao;
}
use of org.apache.zeppelin.display.AngularObject in project zeppelin by apache.
the class GObject method getAngularObject.
private AngularObject getAngularObject(String name) {
AngularObjectRegistry registry = interpreterContext.getAngularObjectRegistry();
String noteId = interpreterContext.getNoteId();
// try get local object
AngularObject paragraphAo = registry.get(name, noteId, interpreterContext.getParagraphId());
AngularObject noteAo = registry.get(name, noteId, null);
AngularObject ao = paragraphAo != null ? paragraphAo : noteAo;
if (ao == null) {
// then global object
ao = registry.get(name, null, null);
}
return ao;
}
use of org.apache.zeppelin.display.AngularObject in project zeppelin by apache.
the class SubmarineUtils method getAgulObjValue.
public static String getAgulObjValue(InterpreterContext context, String name) {
String value = "";
AngularObject angularObject = context.getAngularObjectRegistry().get(name, context.getNoteId(), context.getParagraphId());
if (null != angularObject && null != angularObject.get()) {
value = angularObject.get().toString();
}
return value;
}
use of org.apache.zeppelin.display.AngularObject in project zeppelin by apache.
the class NotebookServer method pushAngularObjectToRemoteRegistry.
private AngularObject pushAngularObjectToRemoteRegistry(String noteId, String paragraphId, String varName, Object varValue, RemoteAngularObjectRegistry remoteRegistry, String interpreterGroupId, NotebookSocket conn) {
final AngularObject ao = remoteRegistry.addAndNotifyRemoteProcess(varName, varValue, noteId, paragraphId);
connectionManager.broadcastExcept(noteId, new Message(OP.ANGULAR_OBJECT_UPDATE).put("angularObject", ao).put("interpreterGroupId", interpreterGroupId).put("noteId", noteId).put("paragraphId", paragraphId), conn);
return ao;
}
use of org.apache.zeppelin.display.AngularObject in project zeppelin by apache.
the class NotebookServer method sendAllAngularObjects.
private void sendAllAngularObjects(Note note, String user, NotebookSocket conn) throws IOException {
List<InterpreterSetting> settings = getNotebook().getBindedInterpreterSettings(note.getId());
if (settings == null || settings.isEmpty()) {
return;
}
for (InterpreterSetting intpSetting : settings) {
if (intpSetting.getInterpreterGroup(user, note.getId()) == null) {
continue;
}
AngularObjectRegistry registry = intpSetting.getInterpreterGroup(user, note.getId()).getAngularObjectRegistry();
List<AngularObject> objects = registry.getAllWithGlobal(note.getId());
for (AngularObject object : objects) {
conn.send(serializeMessage(new Message(OP.ANGULAR_OBJECT_UPDATE).put("angularObject", object).put("interpreterGroupId", intpSetting.getInterpreterGroup(user, note.getId()).getId()).put("noteId", note.getId()).put("paragraphId", object.getParagraphId())));
}
}
}
Aggregations