Search in sources :

Example 1 with Credentials

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;
}
Also used : ResourcePool(org.apache.zeppelin.resource.ResourcePool) UserCredentials(org.apache.zeppelin.user.UserCredentials) AngularObjectRegistry(org.apache.zeppelin.display.AngularObjectRegistry) UserCredentials(org.apache.zeppelin.user.UserCredentials) Credentials(org.apache.zeppelin.user.Credentials)

Example 2 with Credentials

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;
}
Also used : ResourcePool(org.apache.zeppelin.resource.ResourcePool) UserCredentials(org.apache.zeppelin.user.UserCredentials) AngularObjectRegistry(org.apache.zeppelin.display.AngularObjectRegistry) UserCredentials(org.apache.zeppelin.user.UserCredentials) Credentials(org.apache.zeppelin.user.Credentials)

Example 3 with Credentials

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());
}
Also used : HeliumApplicationFactory(org.apache.zeppelin.helium.HeliumApplicationFactory) InterpreterOption(org.apache.zeppelin.interpreter.InterpreterOption) LuceneSearch(org.apache.zeppelin.search.LuceneSearch) InterpreterSettingManager(org.apache.zeppelin.interpreter.InterpreterSettingManager) Helium(org.apache.zeppelin.helium.Helium) File(java.io.File) Credentials(org.apache.zeppelin.user.Credentials) DependencyResolver(org.apache.zeppelin.dep.DependencyResolver) HeliumVisualizationFactory(org.apache.zeppelin.helium.HeliumVisualizationFactory) SchedulerFactory(org.apache.zeppelin.scheduler.SchedulerFactory)

Example 4 with Credentials

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;
}
Also used : ResourcePool(org.apache.zeppelin.resource.ResourcePool) UserCredentials(org.apache.zeppelin.user.UserCredentials) AngularObjectRegistry(org.apache.zeppelin.display.AngularObjectRegistry) UserCredentials(org.apache.zeppelin.user.UserCredentials) Credentials(org.apache.zeppelin.user.Credentials)

Example 5 with Credentials

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;
}
Also used : ResourcePool(org.apache.zeppelin.resource.ResourcePool) UserCredentials(org.apache.zeppelin.user.UserCredentials) AngularObjectRegistry(org.apache.zeppelin.display.AngularObjectRegistry) UserCredentials(org.apache.zeppelin.user.UserCredentials) Credentials(org.apache.zeppelin.user.Credentials)

Aggregations

Credentials (org.apache.zeppelin.user.Credentials)14 UserCredentials (org.apache.zeppelin.user.UserCredentials)7 AngularObjectRegistry (org.apache.zeppelin.display.AngularObjectRegistry)6 ResourcePool (org.apache.zeppelin.resource.ResourcePool)6 Before (org.junit.Before)6 Notebook (org.apache.zeppelin.notebook.Notebook)5 InterpreterSettingManager (org.apache.zeppelin.interpreter.InterpreterSettingManager)4 AuthorizationService (org.apache.zeppelin.notebook.AuthorizationService)4 NoteManager (org.apache.zeppelin.notebook.NoteManager)4 File (java.io.File)3 InterpreterSetting (org.apache.zeppelin.interpreter.InterpreterSetting)3 ManagedInterpreterGroup (org.apache.zeppelin.interpreter.ManagedInterpreterGroup)3 NotebookRepo (org.apache.zeppelin.notebook.repo.NotebookRepo)3 QuartzSchedulerService (org.apache.zeppelin.notebook.scheduler.QuartzSchedulerService)3 LuceneSearch (org.apache.zeppelin.search.LuceneSearch)3 AuthenticationInfo (org.apache.zeppelin.user.AuthenticationInfo)3 IOException (java.io.IOException)2 ZeppelinConfiguration (org.apache.zeppelin.conf.ZeppelinConfiguration)2 Interpreter (org.apache.zeppelin.interpreter.Interpreter)2 InterpreterFactory (org.apache.zeppelin.interpreter.InterpreterFactory)2