Search in sources :

Example 1 with KernelTemplate

use of io.hops.hopsworks.common.util.templates.jupyter.KernelTemplate in project hopsworks by logicalclocks.

the class JupyterConfigFilesGenerator method createJupyterKernelConfig.

public void createJupyterKernelConfig(Writer out, Project project, JupyterSettings js, String hdfsUser) throws IOException {
    try {
        KernelTemplate kernelTemplate = KernelTemplateBuilder.newBuilder().setHdfsUser(hdfsUser).setHadoopHome(settings.getHadoopSymbolicLinkDir()).setHadoopVersion(settings.getHadoopVersion()).setAnacondaHome(settings.getAnacondaProjectDir()).setSecretDirectory(settings.getStagingDir() + Settings.PRIVATE_DIRS + js.getSecret()).setProject(project).setHiveEndpoints(hiveController.getHiveServerInternalEndpoint()).setLibHdfsOpts("-Xmx512m").build();
        Map<String, Object> dataModel = new HashMap<>(1);
        dataModel.put("kernel", kernelTemplate);
        templateEngine.template(KernelTemplate.TEMPLATE_NAME, dataModel, out);
    } catch (TemplateException | ServiceDiscoveryException ex) {
        throw new IOException(ex);
    }
}
Also used : HashMap(java.util.HashMap) TemplateException(freemarker.template.TemplateException) ServiceDiscoveryException(com.logicalclocks.servicediscoverclient.exceptions.ServiceDiscoveryException) IOException(java.io.IOException) KernelTemplate(io.hops.hopsworks.common.util.templates.jupyter.KernelTemplate)

Aggregations

ServiceDiscoveryException (com.logicalclocks.servicediscoverclient.exceptions.ServiceDiscoveryException)1 TemplateException (freemarker.template.TemplateException)1 KernelTemplate (io.hops.hopsworks.common.util.templates.jupyter.KernelTemplate)1 IOException (java.io.IOException)1 HashMap (java.util.HashMap)1