Package com.opengamma.engine.view.execution

Examples of com.opengamma.engine.view.execution.ArbitraryViewCycleExecutionSequence$Cycle


          }
          previousWorkingDate = currentDate;
        }
        currentDate = currentDate.plusDays(1);
      }
      return new ArbitraryViewCycleExecutionSequence(executionSequence);
    }
View Full Code Here


              .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

    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

    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

      s_logger.info("No more cycles to execute");
    } else {
      final int firstCycle = _spawnedCycleCount;
      _spawnedCycleCount += partition.size();
      s_logger.info("Spawning worker {} for {} cycles {} - {}", new Object[] {++_spawnedWorkerCount, getWorkerContext(), firstCycle, _spawnedCycleCount });
      ViewProcessWorker delegate = getDelegate().createWorker(this, getExecutionOptions(new ArbitraryViewCycleExecutionSequence(partition)), getViewDefinition());
      _workers.add(delegate);
      _spawnedWorkers++;
    }
  }
View Full Code Here

  @SuppressWarnings("unchecked")
  @Override
  public ArbitraryViewCycleExecutionSequence buildObject(FudgeDeserializer deserializer, FudgeMsg msg) {
    List<ViewCycleExecutionOptions> sequence = deserializer.fieldValueToObject(List.class, msg.getByName(SEQUENCE_FIELD));
    return new ArbitraryViewCycleExecutionSequence(sequence);
  }
View Full Code Here

    simulation.scenario("scenario1").curve().named("foo").apply().parallelShift(0.1);
    simulation.scenario("scenario2").curve().named("bar").apply().parallelShift(0.1);
    MarketDataSelector selector = CompositeMarketDataSelector.of(simulation.allSelectors());
    ViewCycleExecutionOptions options = ViewCycleExecutionOptions.builder().setMarketDataSelector(selector).create();
    List<ViewCycleExecutionOptions> optionsList = simulation.cycleExecutionOptions(options, simulation.allSelectors());
    ArbitraryViewCycleExecutionSequence sequence = new ArbitraryViewCycleExecutionSequence(optionsList);
    FudgeSerializer serializer = new FudgeSerializer(OpenGammaFudgeContext.getInstance());
    ArbitraryViewCycleExecutionSequenceFudgeBuilder fudgeBuilder = new ArbitraryViewCycleExecutionSequenceFudgeBuilder();
    MutableFudgeMsg msg = fudgeBuilder.buildMessage(serializer, sequence);
    FudgeDeserializer deserializer = new FudgeDeserializer(OpenGammaFudgeContext.getInstance());
    fudgeBuilder.buildObject(deserializer, msg);
View Full Code Here

TOP

Related Classes of com.opengamma.engine.view.execution.ArbitraryViewCycleExecutionSequence$Cycle

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.