Examples of JobManager


Examples of gri.tasks.managers.JobManager

    }
   
    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

Examples of gri.tasks.managers.JobManager

     * 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

Examples of gri.tasks.managers.JobManager

            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

Examples of gri.tasks.managers.JobManager

    }
   
    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

Examples of gri.tasks.managers.JobManager

     
            //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

Examples of gri.tasks.managers.JobManager

     * 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 createRemoteJobManager(TaskProvider taskProvider) throws Exception {
        JobManager localSystem = createLocalJobManager(taskProvider);
 
        File baseDir = new File("C:\\GRIDP_EXEC");
  SimpleJobFolderFactory jobFolderFactory = new SimpleJobFolderFactory(baseDir);
 
        JobManagerServiceImpl webService = new JobManagerServiceImpl(localSystem, new BasicSerializerSet(), jobFolderFactory);
View Full Code Here

Examples of org.activiti.engine.impl.persistence.entity.JobManager

 
  private void createJobWithoutExceptionMsg() {
    CommandExecutor commandExecutor = processEngineConfiguration.getCommandExecutorTxRequired();
    commandExecutor.execute(new Command<Void>() {
      public Void execute(CommandContext commandContext) {
        JobManager jobManager = commandContext.getJobManager();
       
        timerEntity = new TimerEntity();
        timerEntity.setLockOwner(UUID.randomUUID().toString());
        timerEntity.setDuedate(new Date());
        timerEntity.setRetries(0);

        StringWriter stringWriter = new StringWriter();
        NullPointerException exception = new NullPointerException();
        exception.printStackTrace(new PrintWriter(stringWriter));
        timerEntity.setExceptionStacktrace(stringWriter.toString());

        jobManager.insert(timerEntity);
       
        assertNotNull(timerEntity.getId());
       
        return null;
       
View Full Code Here

Examples of org.apache.flink.runtime.jobmanager.JobManager

public class TaskManagerTest {
 
  @Test
  public void testSetupTaskManager() {
    JobManager jobManager = null;
    TaskManager tm = null;
    try {
      jobManager = getJobManagerMockBase();
      tm = createTaskManager(jobManager);

      JobID jid = new JobID();
      JobVertexID vid = new JobVertexID();
      ExecutionAttemptID eid = new ExecutionAttemptID();
     
      TaskDeploymentDescriptor tdd = new TaskDeploymentDescriptor(jid, vid, eid, "TestTask", 2, 7,
          new Configuration(), new Configuration(), TestInvokableCorrect.class.getName(),
          Collections.<GateDeploymentDescriptor>emptyList(),
          Collections.<GateDeploymentDescriptor>emptyList(),
          new ArrayList<BlobKey>(), 0);
     
      TaskOperationResult result = tm.submitTask(tdd);
      assertTrue(result.getDescription(), result.isSuccess());
      assertEquals(eid, result.getExecutionId());

      jobManager.shutdown();
      tm.shutdown();
    }
    catch (Exception e) {
      e.printStackTrace();
      fail(e.getMessage());
    }finally{
      if(jobManager != null){
        jobManager.shutdown();
      }

      if(tm != null){
        tm.shutdown();
      }
View Full Code Here

Examples of org.apache.sling.event.jobs.JobManager

        }
    }

    @Test(timeout=DURATION * 4000)
    public void testDoChaos() throws Exception {
        final JobManager jobManager = this.getJobManager();

        // setup added, created and finished map
        // added and finished are filled by notifications
        // created is filled by the threads starting jobs
        final Map<String, AtomicLong> added = new HashMap<String, AtomicLong>();
View Full Code Here

Examples of org.apache.sling.event.jobs.JobManager

                        cb.block();
                        return JobResult.OK;
                    }
                });
        try {
            final JobManager jobManager = this.getJobManager();
            jobManager.addJob(TOPIC, "myid1", null);
            assertTrue("No event received in the given time.", cb.block(5));
            cb.reset();
            assertFalse("Unexpected event received in the given time.", cb.block(5));
        } finally {
            jcReg.unregister();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.