Package org.apache.airavata.persistance.registry.jpa.model

Examples of org.apache.airavata.persistance.registry.jpa.model.Computational_Resource_Scheduling


    public void save() throws RegistryException{
        EntityManager em = null;
        try {
            em = ResourceUtils.getEntityManager();
            em.getTransaction().begin();
            Computational_Resource_Scheduling scheduling;
            if (schedulingId != 0) {
                scheduling = em.find(Computational_Resource_Scheduling.class, schedulingId);
                scheduling.setSchedulingId(schedulingId);
            } else {
                scheduling = new Computational_Resource_Scheduling();
            }
            Experiment experiment = em.find(Experiment.class, experimentResource.getExpID());
            if (taskDetailResource != null) {
                TaskDetail taskDetail = em.find(TaskDetail.class, taskDetailResource.getTaskId());
                scheduling.setTask(taskDetail);
                scheduling.setTaskId(taskDetailResource.getTaskId());
            }
            scheduling.setExpId(experimentResource.getExpID());
            scheduling.setExperiment(experiment);
            scheduling.setResourceHostId(resourceHostId);
            scheduling.setCpuCount(cpuCount);
            scheduling.setNodeCount(nodeCount);
            scheduling.setNumberOfThreads(numberOfThreads);
            scheduling.setQueueName(queueName);
            scheduling.setWallTimeLimit(walltimeLimit);
            scheduling.setJobStartTime(jobStartTime);
            scheduling.setTotalPhysicalmemory(physicalMemory);
            scheduling.setProjectName(projectName);
            em.persist(scheduling);
            schedulingId = scheduling.getSchedulingId();
            em.getTransaction().commit();
            em.close();
        } catch (Exception e) {
            logger.error(e.getMessage(), e);
            throw new RegistryException(e);
View Full Code Here

TOP

Related Classes of org.apache.airavata.persistance.registry.jpa.model.Computational_Resource_Scheduling

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.