Package com.opengamma.engine.view.execution

Examples of com.opengamma.engine.view.execution.ViewExecutionOptions


        }
        return worker;
      }
    };
    final ViewProcessWorkerContext context = Mockito.mock(ViewProcessWorkerContext.class);
    final ViewExecutionOptions options = ExecutionOptions.infinite(MarketData.live(), ExecutionFlags.none().ignoreCompilationValidity().get());
    final ViewDefinition viewDefinition = Mockito.mock(ViewDefinition.class);
    final ParallelRecompilationViewProcessWorker worker = new ParallelRecompilationViewProcessWorker(workerFactory, context, options, viewDefinition);
    // Start workers
    worker.startParallel(options);
    worker.startSecondaryWorker(worker.getPrimary(), options.getExecutionSequence());
    // Join on the first worker will see the secondary worker promoted, that will join and this will complete
    worker.join();
    assertNull(worker.getPrimary());
    assertNull(worker.getSecondary());
  }
View Full Code Here


      public ViewProcessWorker createWorker(final ViewProcessWorkerContext context, final ViewExecutionOptions executionOptions, final ViewDefinition viewDefinition) {
        return Mockito.mock(ViewProcessWorker.class);
      }
    };
    final ViewProcessWorkerContext context = Mockito.mock(ViewProcessWorkerContext.class);
    final ViewExecutionOptions options = ExecutionOptions.infinite(MarketData.live(), ExecutionFlags.none().ignoreCompilationValidity().get());
    final ViewDefinition viewDefinition = Mockito.mock(ViewDefinition.class);
    final ParallelRecompilationViewProcessWorker worker = new ParallelRecompilationViewProcessWorker(workerFactory, context, options, viewDefinition);
    // Start workers
    worker.startParallel(options);
    worker.startSecondaryWorker(worker.getPrimary(), options.getExecutionSequence());
    // Join on the first worker will see the secondary worker promoted, that will join and this will complete
    worker.join();
    assertNull(worker.getPrimary());
    assertNull(worker.getSecondary());
  }
View Full Code Here

        }
        return worker;
      }
    };
    final ViewProcessWorkerContext context = Mockito.mock(ViewProcessWorkerContext.class);
    final ViewExecutionOptions options = ExecutionOptions.infinite(MarketData.live(), ExecutionFlags.none().ignoreCompilationValidity().get());
    final ViewDefinition viewDefinition = Mockito.mock(ViewDefinition.class);
    final ParallelRecompilationViewProcessWorker worker = new ParallelRecompilationViewProcessWorker(workerFactory, context, options, viewDefinition);
    // No-op
    assertTrue(worker.join(20000));
  }
View Full Code Here

        }
        return worker;
      }
    };
    final ViewProcessWorkerContext context = Mockito.mock(ViewProcessWorkerContext.class);
    final ViewExecutionOptions options = ExecutionOptions.infinite(MarketData.live(), ExecutionFlags.none().ignoreCompilationValidity().get());
    final ViewDefinition viewDefinition = Mockito.mock(ViewDefinition.class);
    final ParallelRecompilationViewProcessWorker worker = new ParallelRecompilationViewProcessWorker(workerFactory, context, options, viewDefinition);
    // Start workers
    worker.startParallel(options);
    worker.startSecondaryWorker(worker.getPrimary(), options.getExecutionSequence());
    // Join on the first worker will see the secondary worker promoted, that will join and this will complete
    assertTrue(worker.join(20000));
    assertNull(worker.getPrimary());
    assertNull(worker.getSecondary());
  }
View Full Code Here

        }
        return worker;
      }
    };
    final ViewProcessWorkerContext context = Mockito.mock(ViewProcessWorkerContext.class);
    final ViewExecutionOptions options = ExecutionOptions.infinite(MarketData.live(), ExecutionFlags.none().ignoreCompilationValidity().get());
    final ViewDefinition viewDefinition = Mockito.mock(ViewDefinition.class);
    final ParallelRecompilationViewProcessWorker worker = new ParallelRecompilationViewProcessWorker(workerFactory, context, options, viewDefinition);
    // Start workers
    worker.startParallel(options);
    worker.startSecondaryWorker(worker.getPrimary(), options.getExecutionSequence());
    // Join on the first worker will see the secondary worker promoted, that will join and this will complete
    assertTrue(worker.join(20000));
    assertNull(worker.getPrimary());
    assertNull(worker.getSecondary());
  }
View Full Code Here

        }
        return worker;
      }
    };
    final ViewProcessWorkerContext context = Mockito.mock(ViewProcessWorkerContext.class);
    final ViewExecutionOptions options = ExecutionOptions.infinite(MarketData.live(), ExecutionFlags.none().ignoreCompilationValidity().get());
    final ViewDefinition viewDefinition = Mockito.mock(ViewDefinition.class);
    final ParallelRecompilationViewProcessWorker worker = new ParallelRecompilationViewProcessWorker(workerFactory, context, options, viewDefinition);
    // Start workers
    worker.startParallel(options);
    worker.startSecondaryWorker(worker.getPrimary(), options.getExecutionSequence());
    // Join on the first worker will see the secondary worker promoted, that will join and this will complete
    assertFalse(worker.join(20000));
    assertNotNull(worker.getPrimary());
    assertNotNull(worker.getSecondary());
    assertFalse(worker.join(0));
View Full Code Here

  }

  public void testPassthrough() {
    final ViewProcessWorkerFactoryMock underlying = new ViewProcessWorkerFactoryMock();
    final SequencePartitioningViewProcessWorkerFactory test = createFactory(underlying);
    final ViewExecutionOptions options = ExecutionOptions.infinite(MarketData.live());
    test.createWorker(Mockito.mock(ViewProcessWorkerContext.class), options, Mockito.mock(ViewDefinition.class));
    assertEquals(underlying._executionOptions.size(), 1);
    assertEquals(underlying._executionOptions.get(0), options);
  }
View Full Code Here

  public void testShortSequence() {
    final ViewProcessWorkerFactoryMock underlying = new ViewProcessWorkerFactoryMock();
    final SequencePartitioningViewProcessWorkerFactory test = createFactory(underlying);
    final Instant t = Instant.now();
    final ViewCycleExecutionSequence sequence = ArbitraryViewCycleExecutionSequence.of(t, t.plusSeconds(1), t.plusSeconds(2));
    final ViewExecutionOptions options = ExecutionOptions.of(sequence, EnumSet.of(ViewExecutionFlags.RUN_AS_FAST_AS_POSSIBLE));
    test.createWorker(Mockito.mock(ViewProcessWorkerContext.class), options, Mockito.mock(ViewDefinition.class));
    assertEquals(underlying._executionOptions.size(), 1);
    assertEquals(underlying._executionOptions.get(0), options);
  }
View Full Code Here

    final List<ViewCycleExecutionOptions> cycles = new ArrayList<ViewCycleExecutionOptions>(20);
    for (int i = 0; i < 20; i++) {
      cycles.add(ViewCycleExecutionOptions.builder().setValuationTime(t.plusSeconds(i)).create());
    }
    final ViewCycleExecutionSequence sequence = new ArbitraryViewCycleExecutionSequence(cycles);
    final ViewExecutionOptions options = ExecutionOptions.of(sequence, EnumSet.of(ViewExecutionFlags.RUN_AS_FAST_AS_POSSIBLE));
    test.createWorker(Mockito.mock(ViewProcessWorkerContext.class), options, Mockito.mock(ViewDefinition.class));
    assertEquals(underlying._executionOptions.size(), 3);
    for (ViewExecutionOptions spawned : underlying._executionOptions) {
      assertEquals(spawned.getDefaultExecutionOptions(), options.getDefaultExecutionOptions());
      assertEquals(spawned.getFlags(), options.getFlags());
      assertEquals(spawned.getMaxSuccessiveDeltaCycles(), options.getMaxSuccessiveDeltaCycles());
    }
    assertEquals(underlying._executionOptions.get(0).getExecutionSequence().estimateRemaining(), 8);
    assertEquals(underlying._executionOptions.get(1).getExecutionSequence().estimateRemaining(), 8);
    assertEquals(underlying._executionOptions.get(2).getExecutionSequence().estimateRemaining(), 4);
  }
View Full Code Here

  public void testInfiniteSequence() {
    final ViewProcessWorkerFactoryMock underlying = new ViewProcessWorkerFactoryMock();
    final SequencePartitioningViewProcessWorkerFactory test = createFactory(underlying);
    final ViewCycleExecutionSequence sequence = new InfiniteViewCycleExecutionSequence();
    final ViewExecutionOptions options = ExecutionOptions.of(sequence, EnumSet.of(ViewExecutionFlags.RUN_AS_FAST_AS_POSSIBLE));
    test.createWorker(Mockito.mock(ViewProcessWorkerContext.class), options, Mockito.mock(ViewDefinition.class));
    assertEquals(underlying._executionOptions.size(), 4);
    for (ViewExecutionOptions spawned : underlying._executionOptions) {
      assertEquals(spawned.getDefaultExecutionOptions(), options.getDefaultExecutionOptions());
      assertEquals(spawned.getFlags(), options.getFlags());
      assertEquals(spawned.getMaxSuccessiveDeltaCycles(), options.getMaxSuccessiveDeltaCycles());
      assertEquals(spawned.getExecutionSequence().estimateRemaining(), 32);
    }
  }
View Full Code Here

TOP

Related Classes of com.opengamma.engine.view.execution.ViewExecutionOptions

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.