Examples of dispatchJob()


Examples of com.opengamma.engine.calcnode.JobDispatcher.dispatchJob()

  public void registerInvokerWithJobPending() {
    s_logger.info("registerInvokerWithJobPending");
    final JobDispatcher jobDispatcher = new JobDispatcher();
    final TestJobResultReceiver result = new TestJobResultReceiver();
    final CalculationJob job = createTestJob();
    jobDispatcher.dispatchJob(job, result);
    assertNull(result.getResult());
    final TestJobInvoker jobInvoker = new TestJobInvoker("Test");
    jobDispatcher.registerJobInvoker(jobInvoker);
    final CalculationJobResult jobResult = result.waitForResult(TIMEOUT);
    assertNotNull(jobResult);
View Full Code Here

Examples of com.opengamma.engine.calcnode.JobDispatcher.dispatchJob()

    final JobDispatcher jobDispatcher = new JobDispatcher();
    final TestJobInvoker jobInvoker = new TestJobInvoker("Test");
    jobDispatcher.registerJobInvoker(jobInvoker);
    final TestJobResultReceiver result = new TestJobResultReceiver();
    final CalculationJob job = createTestJob();
    jobDispatcher.dispatchJob(job, result);
    final CalculationJobResult jobResult = result.waitForResult(TIMEOUT);
    assertNotNull(jobResult);
    assertEquals(job.getSpecification(), jobResult.getSpecification());
    assertNull(jobInvoker._callback);
  }
View Full Code Here

Examples of com.opengamma.engine.calcnode.JobDispatcher.dispatchJob()

    }
    final CalculationJob[] jobs = new CalculationJob[100];
    final TestJobResultReceiver[] resultReceivers = new TestJobResultReceiver[jobs.length];
    s_logger.debug("Dispatching {} jobs to {} nodes", jobs.length, jobInvokers.length);
    for (int i = 0; i < jobs.length; i++) {
      jobDispatcher.dispatchJob(jobs[i] = createTestJob(), resultReceivers[i] = new TestJobResultReceiver());
    }
    s_logger.debug("Jobs dispatched");
    for (int i = 0; i < jobs.length; i++) {
      s_logger.debug("Waiting for result {}", i);
      final CalculationJobResult result = resultReceivers[i].waitForResult(TIMEOUT * 2);
 
View Full Code Here

Examples of com.opengamma.engine.calcnode.JobDispatcher.dispatchJob()

    final JobDispatcher jobDispatcher = new JobDispatcher();
    final TestJobResultReceiver result = new TestJobResultReceiver();
    final FailingJobInvoker failingInvoker = new FailingJobInvoker();
    jobDispatcher.registerJobInvoker(failingInvoker);
    final CalculationJob job = createTestJob();
    jobDispatcher.dispatchJob(job, result);
    CalculationJobResult jobResult = result.waitForResult(TIMEOUT);
    assertNotNull(jobResult);
    assertEquals(2, failingInvoker._failureCount); // once failed twice at one node, job is aborted
    assertEquals(JobDispatcher.DEFAULT_JOB_FAILURE_NODE_ID, jobResult.getComputeNodeId());
  }
View Full Code Here

Examples of com.opengamma.engine.calcnode.JobDispatcher.dispatchJob()

    final FailingJobInvoker failingInvoker = new FailingJobInvoker();
    final TestJobInvoker workingInvoker = new TestJobInvoker("Test");
    jobDispatcher.registerJobInvoker(failingInvoker);
    jobDispatcher.registerJobInvoker(workingInvoker);
    final CalculationJob job = createTestJob();
    jobDispatcher.dispatchJob(job, result);
    CalculationJobResult jobResult = result.waitForResult(TIMEOUT);
    assertNotNull(jobResult);
    assertEquals(1, failingInvoker._failureCount); // fail once at this node, then retried on another
    assertEquals("Test", jobResult.getComputeNodeId());
    assertEquals(job.getSpecification(), jobResult.getSpecification());
View Full Code Here

Examples of com.opengamma.engine.calcnode.JobDispatcher.dispatchJob()

    s_logger.info("testJobTimeoutFailure");
    final JobDispatcher jobDispatcher = new JobDispatcher();
    jobDispatcher.setMaxJobExecutionTime(TIMEOUT);
    jobDispatcher.setMaxJobAttempts(1);
    final TestJobResultReceiver result = new TestJobResultReceiver();
    jobDispatcher.dispatchJob(createTestJob(), result);
    assertNull(result.getResult());
    final BlockingJobInvoker blockingInvoker = new BlockingJobInvoker(2 * TIMEOUT);
    jobDispatcher.registerJobInvoker(blockingInvoker);
    CalculationJobResult jobResult = result.waitForResult(2 * TIMEOUT);
    assertNotNull(jobResult);
View Full Code Here

Examples of com.opengamma.engine.calcnode.JobDispatcher.dispatchJob()

    s_logger.info("testJobTimeoutSuccess");
    final JobDispatcher jobDispatcher = new JobDispatcher();
    jobDispatcher.setMaxJobExecutionTime(3 * TIMEOUT);
    jobDispatcher.setMaxJobAttempts(1);
    final TestJobResultReceiver result = new TestJobResultReceiver();
    jobDispatcher.dispatchJob(createTestJob(), result);
    assertNull(result.getResult());
    final BlockingJobInvoker blockingInvoker = new BlockingJobInvoker(TIMEOUT);
    jobDispatcher.registerJobInvoker(blockingInvoker);
    CalculationJobResult jobResult = result.waitForResult(2 * TIMEOUT);
    assertNotNull(jobResult);
View Full Code Here

Examples of com.opengamma.engine.calcnode.JobDispatcher.dispatchJob()

    final JobDispatcher jobDispatcher = new JobDispatcher();
    jobDispatcher.setMaxJobExecutionTime(4 * TIMEOUT);
    jobDispatcher.setMaxJobExecutionTimeQuery(TIMEOUT);
    jobDispatcher.setMaxJobAttempts(1);
    final TestJobResultReceiver result = new TestJobResultReceiver();
    jobDispatcher.dispatchJob(createTestJob(), result);
    assertNull(result.getResult());
    final BlockingJobInvoker blockingInvoker = new BlockingJobInvoker(2 * TIMEOUT);
    blockingInvoker._isAlive = new AtomicInteger ();
    jobDispatcher.registerJobInvoker(blockingInvoker);
    CalculationJobResult jobResult = result.waitForResult(3 * TIMEOUT);
 
View Full Code Here

Examples of com.opengamma.engine.calcnode.JobDispatcher.dispatchJob()

    final JobDispatcher jobDispatcher = new JobDispatcher();
    jobDispatcher.setMaxJobExecutionTime(3 * TIMEOUT);
    jobDispatcher.setMaxJobExecutionTimeQuery(TIMEOUT);
    jobDispatcher.setMaxJobAttempts(1);
    final TestJobResultReceiver result = new TestJobResultReceiver();
    jobDispatcher.dispatchJob(createTestJob(), result);
    assertNull(result.getResult());
    final BlockingJobInvoker blockingInvoker = new BlockingJobInvoker(2 * TIMEOUT);
    jobDispatcher.registerJobInvoker(blockingInvoker);
    CalculationJobResult jobResult = result.waitForResult(3 * TIMEOUT);
    assertNotNull(jobResult);
View Full Code Here

Examples of com.opengamma.engine.calcnode.JobDispatcher.dispatchJob()

    s_logger.info("testJobCancel");
    final JobDispatcher jobDispatcher = new JobDispatcher();
    jobDispatcher.setMaxJobExecutionTime(2 * TIMEOUT);
    jobDispatcher.setMaxJobAttempts(1);
    final TestJobResultReceiver result = new TestJobResultReceiver();
    Cancelable job = jobDispatcher.dispatchJob(createTestJob(), result);
    assertNotNull(job);
    assertNull(result.getResult());
    final BlockingJobInvoker blockingInvoker = new BlockingJobInvoker(TIMEOUT);
    jobDispatcher.registerJobInvoker(blockingInvoker);
    assertTrue (job.cancel (false));
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.