Package com.opengamma.engine.view.execution

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


              .builder()
              .setMarketDataSpecifications(marketDataSpecs)
              .setMarketDataSelector(CompositeMarketDataSelector.of(allSelectors))
              .create();
      List<ViewCycleExecutionOptions> cycleOptions = cycleExecutionOptions(baseOptions, allSelectors);
      ViewCycleExecutionSequence sequence = new ArbitraryViewCycleExecutionSequence(cycleOptions);
      EnumSet<ViewExecutionFlags> executionFlags = ExecutionFlags.none().awaitMarketData().runAsFastAsPossible().get();
      ViewExecutionOptions executionOptions;
      if (listener != null) {
        viewClient.setResultListener(listener);
      }
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 Instant t = Instant.now();
    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());
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());
View Full Code Here

    final Instant t = Instant.now();
    final List<ViewCycleExecutionOptions> cycles = new ArrayList<ViewCycleExecutionOptions>(20);
    for (int i = 0; i < 37; 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));
    final ViewProcessWorkerContext context = Mockito.mock(ViewProcessWorkerContext.class);
    final SequencePartitioningViewProcessWorker worker = new SequencePartitioningViewProcessWorker(underlying, context, options, Mockito.mock(ViewDefinition.class), 10, 2);
    assertTrue(worker.join(4 * Timeout.standardTimeoutMillis()));
    assertTrue(worker.isTerminated());
View Full Code Here

    final ViewCycleExecutionOptions.Builder builder = ViewCycleExecutionOptions.builder();
    for (int i = 0; i < VALIDITY_PERIOD_DAYS; i++) {
      final Instant valuationTime = now.plus(i, DAYS);
      executionOptionsList.add(builder.setValuationTime(valuationTime).create());
    }
    final ViewCycleExecutionSequence executionSequence = new ArbitraryViewCycleExecutionSequence(executionOptionsList);
    return ExecutionOptions.of(executionSequence, ExecutionFlags.none().compileOnly().get());
  }
View Full Code Here

      ViewClient viewClient = viewProcessor.createViewClient(UserPrincipal.getLocalUser());
      MarketDataSpecification marketDataSpec = new FixedHistoricalMarketDataSpecification(s_observationDateTime.toLocalDate());
      ViewCycleExecutionOptions cycleOptions = ViewCycleExecutionOptions.builder().setValuationTime(s_valuationInstant).setMarketDataSpecification(marketDataSpec)
          .setResolverVersionCorrection(VersionCorrection.of(s_versionAsOf, s_correctedTo)).create();
      ViewCycleExecutionSequence executionSequence = ArbitraryViewCycleExecutionSequence.of(cycleOptions);

      ExecutionOptions executionOptions = new ExecutionOptions(executionSequence, ExecutionFlags.none().awaitMarketData().get(), null, null);

      viewClient.attachToViewProcess(UniqueId.parse(s_viewDefinitionUid), executionOptions);
    } finally {
View Full Code Here

  private int getPartitionSize() {
    return _partition;
  }

  private synchronized void spawnWorker() {
    ViewCycleExecutionSequence sequence = getSequence();
    final int partitionSize = getPartitionSize();
    final List<ViewCycleExecutionOptions> partition = new ArrayList<ViewCycleExecutionOptions>(partitionSize);
    for (int i = 0; i < partitionSize; i++) {
      final ViewCycleExecutionOptions step = sequence.poll(getDefaultExecutionOptions());
      if (step != null) {
        partition.add(step);
      } else {
        break;
      }
View Full Code Here

    _secondary = null;
  }

  // caller must hold the monitor
  protected void checkForRecompilation(final AbstractViewProcessWorkerContext primary, CompiledViewDefinitionWithGraphs compiled) {
    final ViewCycleExecutionSequence tailSequence = (getSecondary() == null) ? primary.getSequence().copy() : null;
    final ViewCycleExecutionOptions nextCycle = primary.getSequence().poll(getDefaultExecutionOptions());
    if (nextCycle != null) {
      final VersionCorrection vc = nextCycle.getResolverVersionCorrection();
      boolean changes = false;
      if ((vc == null) || VersionCorrection.LATEST.equals(vc)) {
View Full Code Here

    return msg;
  }

  @Override
  public ExecutionOptions buildObject(FudgeDeserializer deserializer, FudgeMsg message) {
    ViewCycleExecutionSequence executionSequence = deserializer.fudgeMsgToObject(ViewCycleExecutionSequence.class, message.getMessage(EXECUTION_SEQUENCE_FIELD));
    EnumSet<ViewExecutionFlags> flags = EnumSet.noneOf(ViewExecutionFlags.class);
    for (Pair<String, ViewExecutionFlags> flagField : s_flags) {
      if (BooleanUtils.isTrue(message.getBoolean(flagField.getFirst()))) {
        flags.add(flagField.getSecond());
      }
View Full Code Here

TOP

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

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.