use of org.apache.zeppelin.user.Credentials in project zeppelin by apache.
the class Paragraph method getInterpreterContextWithoutRunner.
private InterpreterContext getInterpreterContextWithoutRunner(InterpreterOutput output) {
AngularObjectRegistry registry = null;
ResourcePool resourcePool = null;
if (!interpreterSettingManager.getInterpreterSettings(note.getId()).isEmpty()) {
InterpreterSetting intpGroup = interpreterSettingManager.getInterpreterSettings(note.getId()).get(0);
registry = intpGroup.getInterpreterGroup(getUser(), note.getId()).getAngularObjectRegistry();
resourcePool = intpGroup.getInterpreterGroup(getUser(), note.getId()).getResourcePool();
}
List<InterpreterContextRunner> runners = new LinkedList<>();
final Paragraph self = this;
Credentials credentials = note.getCredentials();
if (authenticationInfo != null) {
UserCredentials userCredentials = credentials.getUserCredentials(authenticationInfo.getUser());
authenticationInfo.setUserCredentials(userCredentials);
}
InterpreterContext interpreterContext = new InterpreterContext(note.getId(), getId(), getRequiredReplName(), this.getTitle(), this.getText(), this.getAuthenticationInfo(), this.getConfig(), this.settings, registry, resourcePool, runners, output);
return interpreterContext;
}
use of org.apache.zeppelin.user.Credentials in project zeppelin by apache.
the class Paragraph method getInterpreterContext.
private InterpreterContext getInterpreterContext(InterpreterOutput output) {
AngularObjectRegistry registry = null;
ResourcePool resourcePool = null;
if (!interpreterSettingManager.getInterpreterSettings(note.getId()).isEmpty()) {
InterpreterSetting intpGroup = interpreterSettingManager.getInterpreterSettings(note.getId()).get(0);
registry = intpGroup.getInterpreterGroup(getUser(), note.getId()).getAngularObjectRegistry();
resourcePool = intpGroup.getInterpreterGroup(getUser(), note.getId()).getResourcePool();
}
List<InterpreterContextRunner> runners = new LinkedList<>();
for (Paragraph p : note.getParagraphs()) {
runners.add(new ParagraphRunner(note, note.getId(), p.getId()));
}
final Paragraph self = this;
Credentials credentials = note.getCredentials();
if (authenticationInfo != null) {
UserCredentials userCredentials = credentials.getUserCredentials(authenticationInfo.getUser());
authenticationInfo.setUserCredentials(userCredentials);
}
InterpreterContext interpreterContext = new InterpreterContext(note.getId(), getId(), getRequiredReplName(), this.getTitle(), this.getText(), this.getAuthenticationInfo(), this.getConfig(), this.settings, registry, resourcePool, runners, output);
return interpreterContext;
}
use of org.apache.zeppelin.user.Credentials in project SSM by Intel-bigdata.
the class SmartZeppelinServer method init.
private void init() throws Exception {
this.depResolver = new DependencyResolver(zconf.getString(ConfVars.ZEPPELIN_INTERPRETER_LOCALREPO));
InterpreterOutput.limit = zconf.getInt(ConfVars.ZEPPELIN_INTERPRETER_OUTPUT_LIMIT);
HeliumApplicationFactory heliumApplicationFactory = new HeliumApplicationFactory();
HeliumVisualizationFactory heliumVisualizationFactory;
if (isBinaryPackage(zconf)) {
/* In binary package, zeppelin-web/src/app/visualization and zeppelin-web/src/app/tabledata
* are copied to lib/node_modules/zeppelin-vis, lib/node_modules/zeppelin-tabledata directory.
* Check zeppelin/zeppelin-distribution/src/assemble/distribution.xml to see how they're
* packaged into binary package.
*/
heliumVisualizationFactory = new HeliumVisualizationFactory(zconf, new File(zconf.getRelativeDir(ConfVars.ZEPPELIN_DEP_LOCALREPO)), new File(zconf.getRelativeDir("lib/node_modules/zeppelin-tabledata")), new File(zconf.getRelativeDir("lib/node_modules/zeppelin-vis")));
} else {
heliumVisualizationFactory = new HeliumVisualizationFactory(zconf, new File(zconf.getRelativeDir(ConfVars.ZEPPELIN_DEP_LOCALREPO)), // new File(zconf.getRelativeDir("zeppelin-web/src/app/visualization")));
new File(zconf.getRelativeDir("smart-zeppelin/zeppelin-web/src/app/tabledata")), new File(zconf.getRelativeDir("smart-zeppelin/zeppelin-web/src/app/visualization")));
}
this.helium = new Helium(zconf.getHeliumConfPath(), zconf.getHeliumDefaultLocalRegistryPath(), heliumVisualizationFactory, heliumApplicationFactory);
// create visualization bundle
try {
heliumVisualizationFactory.bundle(helium.getVisualizationPackagesToBundle());
} catch (Exception e) {
LOG.error(e.getMessage(), e);
}
this.schedulerFactory = new SchedulerFactory();
this.interpreterSettingManager = new InterpreterSettingManager(zconf, depResolver, new InterpreterOption(true));
this.noteSearchService = new LuceneSearch();
this.notebookAuthorization = NotebookAuthorization.init(zconf);
this.credentials = new Credentials(zconf.credentialsPersist(), zconf.getCredentialsPath());
}
use of org.apache.zeppelin.user.Credentials in project SSM by Intel-bigdata.
the class Paragraph method getInterpreterContext.
private InterpreterContext getInterpreterContext(InterpreterOutput output) {
AngularObjectRegistry registry = null;
ResourcePool resourcePool = null;
if (!interpreterSettingManager.getInterpreterSettings(note.getId()).isEmpty()) {
InterpreterSetting intpGroup = interpreterSettingManager.getInterpreterSettings(note.getId()).get(0);
registry = intpGroup.getInterpreterGroup(getUser(), note.getId()).getAngularObjectRegistry();
resourcePool = intpGroup.getInterpreterGroup(getUser(), note.getId()).getResourcePool();
}
List<InterpreterContextRunner> runners = new LinkedList<>();
for (Paragraph p : note.getParagraphs()) {
runners.add(new ParagraphRunner(note, note.getId(), p.getId()));
}
final Paragraph self = this;
Credentials credentials = note.getCredentials();
if (authenticationInfo != null) {
UserCredentials userCredentials = credentials.getUserCredentials(authenticationInfo.getUser());
authenticationInfo.setUserCredentials(userCredentials);
}
InterpreterContext interpreterContext = new InterpreterContext(note.getId(), getId(), getRequiredReplName(), this.getTitle(), this.getText(), this.getAuthenticationInfo(), this.getConfig(), this.settings, registry, resourcePool, runners, output);
return interpreterContext;
}
use of org.apache.zeppelin.user.Credentials in project SSM by Intel-bigdata.
the class Paragraph method getInterpreterContextWithoutRunner.
private InterpreterContext getInterpreterContextWithoutRunner(InterpreterOutput output) {
AngularObjectRegistry registry = null;
ResourcePool resourcePool = null;
if (!interpreterSettingManager.getInterpreterSettings(note.getId()).isEmpty()) {
InterpreterSetting intpGroup = interpreterSettingManager.getInterpreterSettings(note.getId()).get(0);
registry = intpGroup.getInterpreterGroup(getUser(), note.getId()).getAngularObjectRegistry();
resourcePool = intpGroup.getInterpreterGroup(getUser(), note.getId()).getResourcePool();
}
List<InterpreterContextRunner> runners = new LinkedList<>();
final Paragraph self = this;
Credentials credentials = note.getCredentials();
if (authenticationInfo != null) {
UserCredentials userCredentials = credentials.getUserCredentials(authenticationInfo.getUser());
authenticationInfo.setUserCredentials(userCredentials);
}
InterpreterContext interpreterContext = new InterpreterContext(note.getId(), getId(), getRequiredReplName(), this.getTitle(), this.getText(), this.getAuthenticationInfo(), this.getConfig(), this.settings, registry, resourcePool, runners, output);
return interpreterContext;
}
Aggregations