Package org.apache.airavata.registry.api.workflow

Examples of org.apache.airavata.registry.api.workflow.ApplicationJob


      String hostDescriptionId, String applicationDescriptionId)
      throws RegistryException {
    List<ApplicationJob> jobs=new ArrayList<ApplicationJob>();
    List<GFacJobDataResource> gFacJobs = jpa.getWorker().getGFacJobs(serviceDescriptionId,hostDescriptionId,applicationDescriptionId);
    for (GFacJobDataResource resource : gFacJobs) {
      ApplicationJob job = new ApplicationJob();
      setupValues(resource, job);
      jobs.add(job);
    }
    return jobs;
  }
View Full Code Here


        throw new WorkflowInstanceNodeDoesNotExistsException(workflowExecutionId, nodeId);
      }
      gFacJobs = jpa.getWorker().getExperiment(experimentId).getData().getWorkflowInstance(workflowExecutionId).getNodeData(nodeId).getGFacJobs();
    }
    for (Resource resource : gFacJobs) {
      ApplicationJob job = new ApplicationJob();
      setupValues((GFacJobDataResource)resource, job);
      jobs.add(job);
    }
    return jobs;
  }
View Full Code Here

        }

    }

  private void saveApplicationJob(JobExecutionContext jobExecutionContext) {
    ApplicationJob appJob = GFacUtils.createApplicationJob(jobExecutionContext);
    appJob.setJobId(job.getIDAsString());
    appJob.setJobData(job.getRSL());
    appJob.setSubmittedTime(Calendar.getInstance().getTime());
    appJob.setStatus(ApplicationJobStatus.SUBMITTED);
    appJob.setStatusUpdateTime(appJob.getSubmittedTime());
    GFacUtils.recordApplicationJob(jobExecutionContext, appJob);
  }
View Full Code Here

        initEc2Environment(jobExecutionContext, ec2client);
        checkConnection(instance, ec2client);
    }

  private void saveApplicationJob(JobExecutionContext jobExecutionContext) {
    ApplicationJob job = GFacUtils.createApplicationJob(jobExecutionContext);
        job.setJobId(jobId);
        job.setStatus(ApplicationJobStatus.VALIDATE_INPUT);
        job.setSubmittedTime(Calendar.getInstance().getTime());
        job.setStatusUpdateTime(job.getSubmittedTime());
        GFacUtils.recordApplicationJob(jobExecutionContext, job);
  }
View Full Code Here

    return actualParameter;
  }

  public static ApplicationJob createApplicationJob(
      JobExecutionContext jobExecutionContext) {
    ApplicationJob appJob = new ApplicationJob();
    appJob.setExperimentId((String) jobExecutionContext
        .getProperty(Constants.PROP_TOPIC));
    appJob.setWorkflowExecutionId(appJob.getExperimentId());
    appJob.setNodeId((String) jobExecutionContext
        .getProperty(Constants.PROP_WORKFLOW_NODE_ID));
    appJob.setServiceDescriptionId(jobExecutionContext
        .getApplicationContext().getServiceDescription().getType()
        .getName());
    appJob.setHostDescriptionId(jobExecutionContext.getApplicationContext()
        .getHostDescription().getType().getHostName());
    appJob.setApplicationDescriptionId(jobExecutionContext
        .getApplicationContext().getApplicationDeploymentDescription()
        .getType().getApplicationName().getStringValue());
    return appJob;
  }
View Full Code Here

        return JobState.UNKNOWN;
    }

    private void saveApplicationJob(JobExecutionContext jobExecutionContext, JobDefinitionType jobDefinition,
                                    String metadata) {
        ApplicationJob appJob = GFacUtils.createApplicationJob(jobExecutionContext);
        appJob.setJobId(jobId);
        appJob.setJobData(jobDefinition.toString());
        appJob.setSubmittedTime(Calendar.getInstance().getTime());
        appJob.setStatus(ApplicationJobStatus.SUBMITTED);
        appJob.setStatusUpdateTime(appJob.getSubmittedTime());
        appJob.setMetadata(metadata);
        GFacUtils.recordApplicationJob(jobExecutionContext, appJob);
    }
View Full Code Here

    }


    public static ApplicationJob createApplicationJob(
            JobExecutionContext jobExecutionContext) {
        ApplicationJob appJob = new ApplicationJob();
        appJob.setExperimentId((String) jobExecutionContext.getProperty(Constants.PROP_TOPIC));
        appJob.setWorkflowExecutionId(appJob.getExperimentId());
        appJob.setNodeId((String) jobExecutionContext.getProperty(Constants.PROP_WORKFLOW_NODE_ID));
        appJob.setServiceDescriptionId(jobExecutionContext.getApplicationContext().getServiceDescription().getType().getName());
        appJob.setHostDescriptionId(jobExecutionContext.getApplicationContext().getHostDescription().getType().getHostName());
        appJob.setApplicationDescriptionId(jobExecutionContext.getApplicationContext().getApplicationDeploymentDescription().getType().getApplicationName().getStringValue());
        return appJob;
    }
View Full Code Here

  private void saveApplicationJob(JobExecutionContext jobExecutionContext)
      throws GFacProviderException {
    ApplicationDeploymentDescriptionType app = jobExecutionContext.
                getApplicationContext().getApplicationDeploymentDescription().getType();
    ApplicationJob appJob = GFacUtils.createApplicationJob(jobExecutionContext);
    appJob.setJobId(jobId);
    LocalProviderJobData data = new LocalProviderJobData();
    data.setApplicationName(app.getExecutableLocation());
    data.setInputDir(app.getInputDataDirectory());
    data.setOutputDir(app.getOutputDataDirectory());
    data.setWorkingDir(builder.directory().toString());
    data.setInputParameters(ProviderUtils.getInputParameters(jobExecutionContext));
    ByteArrayOutputStream stream = new ByteArrayOutputStream();
    JAXB.marshal(data, stream);
    appJob.setJobData(stream.toString());
    appJob.setSubmittedTime(Calendar.getInstance().getTime());
    appJob.setStatus(ApplicationJobStatus.SUBMITTED);
    appJob.setStatusUpdateTime(appJob.getSubmittedTime());
    GFacUtils.recordApplicationJob(jobExecutionContext, appJob);
  }
View Full Code Here

        submitJobs(gateKeeper, jobExecutionContext, globusHostType);

    }

  private void saveApplicationJob(JobExecutionContext jobExecutionContext, ApplicationJobStatus jobStatus) {
    ApplicationJob appJob = GFacUtils.createApplicationJob(jobExecutionContext);
    appJob.setJobId(job.getIDAsString());
    appJob.setJobData(job.getRSL());
    appJob.setSubmittedTime(Calendar.getInstance().getTime());
    appJob.setStatus(jobStatus);
    appJob.setStatusUpdateTime(appJob.getSubmittedTime());
    GFacUtils.recordApplicationJob(jobExecutionContext, appJob);
  }
View Full Code Here

  public void updateWorkflowNodeGramData(
      WorkflowNodeGramData workflowNodeGramData) throws RegistryException {
        if (provenanceRegistry != null){
            provenanceRegistry.updateWorkflowNodeGramData(workflowNodeGramData);
        }else {
          ApplicationJob job = new ApplicationJob();
          job.setJobId(workflowNodeGramData.getGramJobID());
          job.setHostDescriptionId(workflowNodeGramData.getInvokedHost());
          job.setExperimentId(workflowNodeGramData.getWorkflowInstanceId());
          job.setWorkflowExecutionId(workflowNodeGramData.getWorkflowInstanceId());
          job.setNodeId(workflowNodeGramData.getNodeID());
          job.setJobData(workflowNodeGramData.getRsl());
          if (isApplicationJobExists(job.getJobId())){
            updateApplicationJob(job);
          }else{
            addApplicationJob(job);
          }
        }
View Full Code Here

TOP

Related Classes of org.apache.airavata.registry.api.workflow.ApplicationJob

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.