Search in sources :

Example 1 with JupyterSettingsPK

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;
}
Also used : JupyterSettingsPK(io.hops.hopsworks.persistence.entity.jupyter.JupyterSettingsPK) JupyterSettings(io.hops.hopsworks.persistence.entity.jupyter.JupyterSettings) SparkJobConfiguration(io.hops.hopsworks.persistence.entity.jobs.configuration.spark.SparkJobConfiguration)

Aggregations

SparkJobConfiguration (io.hops.hopsworks.persistence.entity.jobs.configuration.spark.SparkJobConfiguration)1 JupyterSettings (io.hops.hopsworks.persistence.entity.jupyter.JupyterSettings)1 JupyterSettingsPK (io.hops.hopsworks.persistence.entity.jupyter.JupyterSettingsPK)1