use of io.hops.hopsworks.persistence.entity.jupyter.JupyterSettingsPK in project hopsworks by logicalclocks.
the class JupyterSettingsFacade method findByProjectUser.
public JupyterSettings findByProjectUser(Project project, String email) {
JupyterSettingsPK pk = new JupyterSettingsPK(project.getId(), email);
JupyterSettings js;
js = em.find(JupyterSettings.class, pk);
if (js == null) {
String secret = DigestUtils.sha256Hex(Integer.toString(ThreadLocalRandom.current().nextInt()));
js = new JupyterSettings(pk);
js.setSecret(secret);
js.setJobConfig(new SparkJobConfiguration(ExperimentType.EXPERIMENT));
js.setBaseDir(Utils.getProjectPath(project.getName()) + Settings.ServiceDataset.JUPYTER.getName());
persist(js);
}
if (js.getJobConfig() == null) {
js.setJobConfig(new SparkJobConfiguration(ExperimentType.EXPERIMENT));
}
return js;
}
Aggregations