Package org.apache.oodt.cas.resource.structs

Examples of org.apache.oodt.cas.resource.structs.JobSpec


                .getJobInputFromClassName(inputClassName);
        if (inputConfigProps != null) {
            in.configure(inputConfigProps);
        }

        JobSpec spec = new JobSpec(in, job);

        return spec;
    }
View Full Code Here


  /* (non-Javadoc)
   * @see org.apache.oodt.cas.resource.jobqueue.JobQueue#getNextJob()
   */
  public JobSpec getNextJob() throws JobQueueException {
    JobSpec spec = (JobSpec)queue.remove(0);
    // update its status since getNextJob is
    // called by the scheduler when it is going
    // to execute a job
    spec.getJob().setStatus(JobStatus.SCHEDULED);
    safeUpdateJob(spec);
    return spec;
  }
View Full Code Here

     *
     * @see org.apache.oodt.cas.resource.batchmgr.Batchmgr#killJob(java.lang.String,
     *      org.apache.oodt.cas.resource.structs.ResourceNode)
     */
    public boolean killJob(String jobId, ResourceNode node) {
        JobSpec spec = null;
        try {
            spec = repo.getJobById(jobId);
        } catch (Exception e) {
            LOG.log(Level.WARNING, "Unable to get job by id: [" + jobId
                    + "] to kill it: Message: " + e.getMessage());
View Full Code Here

   * (non-Javadoc)
   *
   * @see org.apache.oodt.cas.resource.jobrepo.JobRepository#getStatus(org.apache.oodt.cas.resource.structs.JobSpec)
   */
  public String getStatus(JobSpec spec) throws JobRepositoryException {
    JobSpec persistedSpec = (JobSpec) jobMap.get(spec.getJob().getId());
    return persistedSpec.getJob().getStatus();
  }
View Full Code Here

   * (non-Javadoc)
   *
   * @see org.apache.oodt.cas.resource.jobrepo.JobRepository#jobFinished(org.apache.oodt.cas.resource.structs.JobSpec)
   */
  public boolean jobFinished(JobSpec spec) throws JobRepositoryException {
    JobSpec persistedSpec = (JobSpec) jobMap.get(spec.getJob().getId());
    return persistedSpec.getJob().getStatus().equals(JobStatus.COMPLETE);
  }
View Full Code Here

        return submitJobFile(jobFile.getAbsolutePath());
    }

    public String submitJobFile(String jobFilePath)
            throws JobExecutionException {
        JobSpec spec = JobBuilder.buildJobSpec(jobFilePath);
        return submitJob(spec);
    }
View Full Code Here

        }

        // ----------------------------------------------------------------
        // create a default JobSpec
        // ----------------------------------------------------------------
        JobSpec spec = JobBuilder.buildJobSpec(jobFile.getAbsolutePath());
        Job job = spec.getJob();
        NameValueJobInput jobInput = (NameValueJobInput) spec.getIn();

        // ----------------------------------------------------------------
        // open the file to read. traverse through the list of directories
        // name given & override the default Job's runDirName value with the
        // directory name. then submit the Job.
View Full Code Here

        throw new JobRepositoryException("Failed to get capacity of JobQueue : " + e.getMessage(), e);
      }
    }

    public boolean isJobComplete(String jobId) throws JobRepositoryException {
        JobSpec spec = scheduler.getJobQueue().getJobRepository().getJobById(
                jobId);
        return scheduler.getJobQueue().getJobRepository().jobFinished(spec);
    }
View Full Code Here

                jobId);
        return scheduler.getJobQueue().getJobRepository().jobFinished(spec);
    }

    public Hashtable getJobInfo(String jobId) throws JobRepositoryException {
        JobSpec spec = null;

        try {
            spec = scheduler.getJobQueue().getJobRepository()
                    .getJobById(jobId);
        } catch (JobRepositoryException e) {
            LOG.log(Level.WARNING,
                    "Exception communicating with job repository for job: ["
                            + jobId + "]: Message: " + e.getMessage());
            throw new JobRepositoryException("Unable to get job: [" + jobId
                    + "] from repository!");
        }

        return XmlRpcStructFactory.getXmlRpcJob(spec.getJob());
    }
View Full Code Here

        Job exec = XmlRpcStructFactory.getJobFromXmlRpc(jobHash);
        JobInput in = GenericResourceManagerObjectFactory
                .getJobInputFromClassName(exec.getJobInputClassName());
        in.read(jobIn);

        JobSpec spec = new JobSpec(in, exec);

        // queue the job up
        String jobId = null;

        try {
View Full Code Here

TOP

Related Classes of org.apache.oodt.cas.resource.structs.JobSpec

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.