Examples of registerJobInvoker()


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

    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);
    assertEquals(job.getSpecification(), jobResult.getSpecification());
    assertNull(jobInvoker._callback);
  }
View Full Code Here

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

  @Test
  public void registerInvokerWithEmptyQueue() {
    s_logger.info("registerInvokerWithEmptyQueue");
    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);
View Full Code Here

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

    s_logger.info("invokeInRoundRobinOrder");
    final JobDispatcher jobDispatcher = new JobDispatcher();
    final TestJobInvoker node1 = new TestJobInvoker("1");
    final TestJobInvoker node2 = new TestJobInvoker("2");
    final TestJobInvoker node3 = new TestJobInvoker("3");
    jobDispatcher.registerJobInvoker(node1);
    jobDispatcher.registerJobInvoker(node2);
    jobDispatcher.registerJobInvoker(node3);
    nodeTest("1", jobDispatcher);
    assertNull(node1._callback);
    nodeTest("2", jobDispatcher);
View Full Code Here

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

    final JobDispatcher jobDispatcher = new JobDispatcher();
    final TestJobInvoker node1 = new TestJobInvoker("1");
    final TestJobInvoker node2 = new TestJobInvoker("2");
    final TestJobInvoker node3 = new TestJobInvoker("3");
    jobDispatcher.registerJobInvoker(node1);
    jobDispatcher.registerJobInvoker(node2);
    jobDispatcher.registerJobInvoker(node3);
    nodeTest("1", jobDispatcher);
    assertNull(node1._callback);
    nodeTest("2", jobDispatcher);
    assertNull(node2._callback);
View Full Code Here

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

    final TestJobInvoker node1 = new TestJobInvoker("1");
    final TestJobInvoker node2 = new TestJobInvoker("2");
    final TestJobInvoker node3 = new TestJobInvoker("3");
    jobDispatcher.registerJobInvoker(node1);
    jobDispatcher.registerJobInvoker(node2);
    jobDispatcher.registerJobInvoker(node3);
    nodeTest("1", jobDispatcher);
    assertNull(node1._callback);
    nodeTest("2", jobDispatcher);
    assertNull(node2._callback);
    nodeTest("3", jobDispatcher);
View Full Code Here

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

  public void saturateInvokers() {
    s_logger.info("saturateInvokers");
    final JobDispatcher jobDispatcher = new JobDispatcher();
    final JobInvoker[] jobInvokers = new JobInvoker[3];
    for (int i = 0; i < jobInvokers.length; i++) {
      jobDispatcher.registerJobInvoker(new AbstractJobInvoker("" + (i + 1)) {

        private final Random rnd = new Random();
        private boolean _busy;
        private JobInvokerRegister _callback;
View Full Code Here

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

  public void testJobRetry_failure() {
    s_logger.info("testJobRetry_failure");
    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
View Full Code Here

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

    s_logger.info("testJobRetry_sucess");
    final JobDispatcher jobDispatcher = new JobDispatcher();
    final TestJobResultReceiver result = new TestJobResultReceiver();
    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);
View Full Code Here

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

    final JobDispatcher jobDispatcher = new JobDispatcher();
    final TestJobResultReceiver result = new TestJobResultReceiver();
    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
View Full Code Here

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

    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);
    assertEquals(jobDispatcher.getJobFailureNodeId(), jobResult.getComputeNodeId());
  }
 
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.