Package gri.tasks.managers

Examples of gri.tasks.managers.JobManager


    //jobManager:
    Element jobManagerElem = elem.getChild("jobManager");
    if (jobManagerElem == null)
      throw new MissingElementException("jobManager", elem);
    JobManager jobManager = (JobManager)jobManagerSerializer.read(jobManagerElem);

    JobManagerEntry entry = new JobManagerEntry(id, jobManager);

    //name:
    Element nameElem = elem.getChild("name");
View Full Code Here


    //TaskProvider provider = getSSHProvider(directory);

    //GRIDP:

    TaskManager taskManager1 = getLocalTaskManager(moduleFolder);
    JobManager gridpJobManager = new BasicJobManager(taskManager1);
    //gridpJobManager = createRemoteSystem(provider);
    jobManagers.addJobManager("Local System", gridpJobManager);

    //TaskManager taskManager2 = gridp.getSSHProvider(directory);
    //JobManager gridpJobManager2 = gridp.createLocalSystem(taskManager2);
    //jobManagers.addJobManager("SSH Altix", gridpJobManager2);

    TaskCollection tasks = test_gui.loadTaskEntries();
    JobManager funcManager = new BasicJobManager(new BasicTaskManager(tasks));
    jobManagers.addJobManager("Functions", funcManager);

    return jobManagers;
  }
View Full Code Here

    String directory = "C:\\Users\\rogersda\\Desktop\\Gridp\\Module Collection";

    TaskManager taskManager = getLocalTaskManager(new File(directory));
    //TaskManager taskManager = getSSHTaskManager(new File(directory));

    JobManager jobManager;
    FileViewManager viewManager;
    try {
      jobManager = createLocalSystem(taskManager);
      //jobManager = createRemoteSystem(taskManager);
View Full Code Here

    //TypeMapping: DO NOT FORGET TO CLONE!
    TypeMapping typeMapping = (TypeMapping)Types.getDefaultTypeMapping().clone();
    typeMapping.putContentType("file", TransferableFile.DATA_TYPE);

    //JobManager:
    JobManager localSystem = createLocalSystem(taskManager);

    //Server:
    File baseDir = new File("C:\\GRIDP_EXEC");
    SimpleJobFolderFactory jobFolderFactory = new SimpleJobFolderFactory(baseDir);
View Full Code Here

   * the inputs applied, and then started.  displayJobTab()
   * will then be called to display the tab in which the job runs.
   */
  protected void runTask() {

    JobManager jobManager = taskInfo.getJobManager();
   
    JobEntry job;
   
    try {
      JobSubmission submission = createJobSubmission();
      String jobId = jobManager.submitJob(submission);
      job = new JobEntry(submission.getTaskId(), jobId, jobManager);
    }
    catch(Exception e) {
      messenger.error(e);
      return;
View Full Code Here

    }
   
    public static void test1() {
       
        //JobManager jobManager = createLocalSystem();
        JobManager jobManager = createRemoteSystem();
       
        //System.out.println(jobManager.getTaskDefinition("echo-echo"));
        //if (true)
        //    return;
       
        JobSubmission job = new JobSubmission(null);

        job.setTaskId("echo-echo");
        job.setInput("text", "Hello There");
       
        //job.setTaskId("ping-ping");
        //job.setInput("computer", "file.genome.uc.edu");
       
        //job.setTaskId("type-type");
        //job.setInput("file", new TextMemFile("myFile2.txt", "jfdkjsfkjafk"));
       

        try {
            String jobKey = jobManager.submitJob(job);
            System.out.println("Submitted: " + jobKey);

            AsyncTaskController control = jobManager.getJobController(jobKey);
            while (control.getStatus() != JobManager.COMPLETE) {
                Thread.sleep(500);
                System.out.println("Checking (" + System.currentTimeMillis() + ") ...");
            }
View Full Code Here

     * Creates a GridpServiceProxy that wraps around a local GridpSystem.
     * Messages are sent through a GridpWebService and serialized just as
     * though they were sent to a remote service.
     */
    protected static JobManager createRemoteSystem() {
        JobManager localSystem = createLocalSystem();
       
        BasicSerializerSet serializers = new BasicSerializerSet();
        JobManagerService webService = new JobManagerServiceImpl(localSystem, serializers);
        return new ProxyJobManager(webService, serializers);
    }
View Full Code Here

            Element rootElem = serviceUtil.parseXML(xml).getRootElement();

            Element taskElem = rootElem.getChild("task");
            String taskId = taskElem.getText();
           
            JobManager jobManager = getJobManager();
           
            Map config = new HashMap();
            config.put("JOB_MANAGER", jobManager);
            config.put("JOB_MANAGER_SERVICE", this);
            config.put("TASK_ID", taskId);
            config.put("WORKING_DIRECTORY", workDir);
                       
            JobSubmissionSerializer jobSerializer = serializers
              .getTaskSerializerSet(jobManager, taskId)
              .getJobSubmissionSerializer(config);
           
            JobSubmission job = jobSerializer.readJob(rootElem);
            job.setContextParam("WORKING_DIRECTORY", workDir);

            //submit:
            String jobKey = jobManager.submitJob(job);
            logger.debug("Job submitted: " + jobKey);
           
            RunningJobInfo jobInfo = new RunningJobInfo(jobKey, taskId, workDir);
            jobInfoManager.storeJobInfo(jobInfo);
View Full Code Here

    }
   
    public static void test1() throws Exception {
  TaskProvider provider = loadTaskProvider();
  //JobManager jobManager = createLocalSystem(provider);
  JobManager jobManager = createRemoteJobManager(provider);
 
  /*
  System.out.println("Tasks:");
  String [] taskIds = jobManager.getTaskList();
  for (int i=0; i<taskIds.length; i++)
      System.out.println(taskIds[i]);
  */
 
  //prepare job:
 
  /*
  JobSubmission submission = new JobSubmission("dan.encryption.Digest.md5");
  submission.setInput("message", "dude");
  */ 

 
  JobSubmission submission = new JobSubmission("Workflow");
  List tasks = new ArrayList();
 
  TaskStub task1 = new TaskStub("0", "dan.encryption.Digest.md5");
  task1.setInput("message", "dude");
  tasks.add(task1);

  TaskStub task2 = new TaskStub("1", "dan.encryption.Digest.md5");
  task2.setInput("message", new TaskStubOutputReference(task1, "digest"));
  tasks.add(task2);
 
  submission.setInput("inputTasks", tasks);
 
 
  //submit job:
  String jobId = jobManager.submitJob(submission);
 
  while (jobManager.getJobStatus(jobId) != JobManager.COMPLETE) {
      try {
    Thread.sleep(1000);
      }
      catch(Exception e) {};
  }
 
  System.out.println();
  System.out.println("Job Complete!");
  System.out.println();
 
  System.out.println("Outputs:");
  System.out.println(String.valueOf(jobManager.getJobOutputs(jobId)));
 
  jobManager.freeJob(jobId);
 
    }
View Full Code Here

     
            //get serializer:
            RunningJobInfo info = jobInfoManager.getJobInfo(req.getJobId());
            String taskId = info.getTaskId();
           
            JobManager jobManager = getJobManager();
           
            Map config = new HashMap();
           
            config.putAll(req.getParameters())//do first (so user can't overwrite following params)
           
            config.put("JOB_MANAGER", jobManager);
            config.put("JOB_MANAGER_SERVICE", this);
            config.put("JOB_ID", req.getJobId());
            config.put("TASK_ID", taskId);
            config.put("WORKING_DIRECTORY", info.getWorkingDirectory());
           
           
            JDOMSerializer paramSerializer = serializers
              .getTaskSerializerSet(jobManager, taskId)
              .getOutputParameterSerializer(config);
           
            //get outputs:
            Map outputs = jobManager.getJobOutputs(req.getJobId());
            Element elem = new Element("outputs");
            paramSerializer.write(outputs, elem);
            return serviceUtil.writeXML(elem);
        }
        catch (UnknownJobException e) {
View Full Code Here

TOP

Related Classes of gri.tasks.managers.JobManager

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.