Package eu.planets_project.tb.impl.system.batch

Examples of eu.planets_project.tb.impl.system.batch.TestbedBatchJob


              log.debug("BatchExecutionListener: notify STARTED for: "+ticket);
              bInfomredStarted=true;
            }
           
            if(bp.isRunning(ticket)){
              TestbedBatchJob job = bp.getJob(ticket);
              job.setStatus(TestbedBatchJob.RUNNING);
              bp.notifyRunning(ticket, job);
              log.debug("BatchExecutionListener: notify RUNNING for: "+ticket);

            }
           
            if(bp.isUpdated(ticket)){
              bp.notifyUpdate(ticket, bp.getJob(ticket));
              log.debug("BatchExecutionListener: notify UPDATE for: "+ticket);

            }
           
            if(bp.isFailed(ticket)){
              TestbedBatchJob job = bp.getJob(ticket);
              job.setStatus(TestbedBatchJob.FAILED);
              bp.notifyFailed(ticket, job);
              log.debug("BatchExecutionListener: notify FAILED for: "+ticket);

            }
           
            //check if completed
            if(bp.isCompleted(ticket)){
              TestbedBatchJob job = bp.getJob(ticket);
              job.setStatus(TestbedBatchJob.DONE);
              bp.notifyComplete(ticket, job);
              log.debug("BatchExecutionListener: notify COMPLETE for: "+ticket);

              return;
            }
           
          }
         
          //status is: still no completed - sleep and repoll
            try {
              Thread.sleep(sleep);
        } catch (InterruptedException e) {
          log.debug("Error while waiting for ticket: "+ticket, e);
          TestbedBatchJob job = bp.getJob(ticket);
          job.setStatus(TestbedBatchJob.FAILED);
          bp.notifyFailed(ticket, job);
          return;
        }
        t1 = System.currentTimeMillis();
        }
       
        //b) in this case a time-out occurred
        TestbedBatchJob job = bp.getJob(ticket);
    job.setStatus(TestbedBatchJob.FAILED);
    job.setWorkflowFailureReport(new String("BatchExperimentListener with timeout of "+timeOutMillis/1000+" Sec. has timed-out. This normally indicates a failure within the remote workflow execution processor"));
    bp.notifyFailed(ticket, job);
    log.debug("BatchExecutionListener: notify FAILED due to time-out for: "+ticket);
  }
View Full Code Here


    public TestbedBatchProcessDaemon(TestbedBatchProcessor testbedBatchProcessor) {
        this.testbedBatchProcessor = testbedBatchProcessor;
    }

    public void run() {
        TestbedBatchJob job = null;
        while (true) {
            //log.debug("Looking for a job: t="+this.getSecs());
            job = testbedBatchProcessor.pollForNextJob();
            if( job != null ) {
                this.executeWorkflow(job);
View Full Code Here

     * @param workflow
     * @param digitalObjects
     * @return
     */
    public synchronized String submitBatch( long expID, ExperimentWorkflow workflow, Collection<String> digitalObjects) {
        TestbedBatchJob testbedBatchJob = new TestbedBatchJob( expID, workflow, digitalObjects );
        job_id++;
        String job_key ="TBK:"+job_id;
        log.info("Queuing job : "+job_key);
        jobs.put(job_key, testbedBatchJob);
        jobsQueued.add(job_key);
View Full Code Here

   */
  public String sumitBatch(long expID, List<DigitalObject> digObjs, WorkflowConf workflowConfig) {
   
    String retTicket ="";
    //0. create a TestbedBatchJob object that's used to temporarily park the results
     TestbedBatchJob testbedBatchJob = new TestbedBatchJob( expID);

    //1. submit the Workflow to the WEE System and receive a ticket
    try {
      retTicket = "" + TestbedWEEBatchProcessor.weeService.submitWorkflow((ArrayList<DigitalObject>) digObjs, workflowConfig.getTemplate().getClazz(), new WorkflowConfigUtil().marshalWorkflowConfigToXMLTemplate(workflowConfig));
      submitTicketToExecutionQueue(retTicket, testbedBatchJob, expID);
View Full Code Here

  public String sumitBatchByReference(long expID, List<URI> digObjRef,
      WorkflowConf workflowConfig) {
   
    String retTicket ="";
    //0. create a TestbedBatchJob object that's used to temporarily park the results
    TestbedBatchJob testbedBatchJob = new TestbedBatchJob( expID);
   
    //1. submit the Workflow to the WEE System and receive a ticket
    try {
      retTicket = "" + TestbedWEEBatchProcessor.weeService.submitWorkflowByReference((ArrayList<URI>) digObjRef, workflowConfig.getTemplate().getClazz(), new WorkflowConfigUtil().marshalWorkflowConfigToXMLTemplate(workflowConfig));
      submitTicketToExecutionQueue(retTicket, testbedBatchJob, expID);
View Full Code Here

TOP

Related Classes of eu.planets_project.tb.impl.system.batch.TestbedBatchJob

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.