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

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


     *
     * @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


            try {
                Thread.currentThread().sleep((long) waitTime * 1000);
            } catch (Exception ignore) {}

            if (!myJobQueue.isEmpty()) {
                JobSpec exec = null;

                try {
                    exec = myJobQueue.getNextJob();
                    LOG.log(Level.INFO, "Obtained Job: ["
                            + exec.getJob().getId()
                            + "] from Queue: Scheduling for execution");
                } catch (Exception e) {
                    LOG.log(Level.WARNING,
                            "Error getting next job from JobQueue: Message: "
                                    + e.getMessage());
                    continue;
                }

                try {
                    schedule(exec);
                } catch (Exception e) {
                    LOG.log(Level.WARNING, "Error scheduling job: ["
                            + exec.getJob().getId() + "]: Message: "
                            + e.getMessage());
                    // place the job spec back on the queue
                    try {
                        myJobQueue.requeueJob(exec);
                    } catch (Exception ignore) {
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

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

        JobSpec spec = new JobSpec(in, exec);

        URL remoteUrl = safeGetUrlFromString(urlStr);
        ResourceNode remoteNode = null;

        try {
View Full Code Here

                .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

   * (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.SUCCESS)
      ||  persistedSpec.getJob().getStatus().equals(JobStatus.FAILURE);
  }
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.