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);
}
}
Aggregations