Package com.opengamma.engine.view.execution

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


    env.init();
    final ViewProcessorImpl vp = env.getViewProcessor();
    vp.start();

    final ViewClient client = vp.createViewClient(ViewProcessorTestEnvironment.TEST_USER);
    final ViewExecutionOptions executionOptions = ExecutionOptions.batch(generateExecutionSequence(10), ViewCycleExecutionOptions.builder().setMarketDataSpecification(MarketData.live()).create());
    client.attachToViewProcess(env.getViewDefinition().getUniqueId(), executionOptions);
    waitForCompletionAndShutdown(vp, client, env);
    assertEquals(0, vp.getViewCycleManager().getResourceCount());
  }
View Full Code Here


        return UserPrincipal.getTestUser();
      }

    };
    client.setResultListener(resultListener);
    final ViewExecutionOptions executionOptions = ExecutionOptions.batch(generateExecutionSequence(10), ViewCycleExecutionOptions.builder().setMarketDataSpecification(MarketData.live()).create());
    client.attachToViewProcess(env.getViewDefinition().getUniqueId(), executionOptions);

    final ViewProcessImpl viewProcess = env.getViewProcess(vp, client.getUniqueId());
    final UniqueId viewProcessId = viewProcess.getUniqueId();
View Full Code Here

      final CompiledFunctionService cfs = Mockito.mock(CompiledFunctionService.class);
      Mockito.when(cfs.getFunctionCompilationContext()).thenReturn(ctx);
      final ViewProcessContext vpContext = Mockito.mock(ViewProcessContext.class);
      Mockito.when(vpContext.getFunctionCompilationService()).thenReturn(cfs);
      final MockContext context = new MockContext(vpContext);
      final ViewExecutionOptions options = ExecutionOptions.infinite(MarketData.live(), ExecutionFlags.none().ignoreCompilationValidity().get());
      final ViewDefinition viewDefinition = Mockito.mock(ViewDefinition.class);
      final ParallelRecompilationViewProcessWorker worker = new ParallelRecompilationViewProcessWorker(workerFactory(executor, resolutions), context, options, viewDefinition);
      callback.execute(worker, options);
      s_logger.debug("Waiting for initial compilation");
      assertEquals(context.event(), "view definition compiled"); // From primary worker
View Full Code Here

      valuationInstant = Instant.now();
    }
    final boolean historicalInput = getCommandLine().hasOption(HISTORICAL_OPTION);

    final MarketDataSpecification marketDataSpecification = historicalInput ? new LatestHistoricalMarketDataSpecification() : MarketData.live();
    final ViewExecutionOptions viewExecutionOptions = ExecutionOptions.singleCycle(valuationInstant, marketDataSpecification, EnumSet.of(ViewExecutionFlags.AWAIT_MARKET_DATA));

    final List<RemoteViewProcessor> viewProcessors = getRemoteComponentFactory().getViewProcessors();
    if (viewProcessors.size() == 0) {
      s_logger.warn("No view processors found at {}", getRemoteComponentFactory().getBaseUri());
      return;
View Full Code Here

        marketDataSpec = _namedMarketDataSpecificationRepository.getSpecification(liveMarketDataProvider);
        flags = ExecutionFlags.triggersEnabled().parallelCompilation(ParallelRecompilationMode.PARALLEL_EXECUTION).get();
      } else {
        throw new OpenGammaRuntimeException("Unknown market data type: " + marketDataType);
      }
      ViewExecutionOptions executionOptions = ExecutionOptions.infinite(marketDataSpec, flags, versionCorrection);
      s_logger.info("Initializing view '{}', aggregated by '{}' with execution options '{}' for client '{}'", new Object[] {baseViewDefinitionId, aggregatorName, executionOptions, remote });
      initializeClientView(remote, baseViewDefinitionId, aggregatorName, executionOptions, getUser(remote));
    } catch (Exception e) {
      s_logger.error("Exception propagated to client while changing view", e);
      sendChangeViewError(remote, "Unexpected error with message: " + e.getMessage());
View Full Code Here

  protected ParallelRecompilationViewProcessWorker createWorkerImpl(final ViewProcessWorkerContext context, final ViewExecutionOptions executionOptions, final ViewDefinition viewDefinition) {
    return new ParallelRecompilationViewProcessWorker(getDelegate(), context, getSecondaryExecutionOptions(executionOptions), viewDefinition);
  }

  protected ViewProcessWorker parallelExecution(final ViewProcessWorkerContext context, final ViewExecutionOptions executionOptions, final ViewDefinition viewDefinition) {
    final ViewExecutionOptions primaryOptions = getPrimaryExecutionOptions(executionOptions);
    final ParallelRecompilationViewProcessWorker worker = createWorkerImpl(context, primaryOptions, viewDefinition);
    worker.startParallel(primaryOptions);
    return worker;
  }
View Full Code Here

    worker.startParallel(primaryOptions);
    return worker;
  }

  protected ViewProcessWorker deferredExecution(final ViewProcessWorkerContext context, final ViewExecutionOptions executionOptions, final ViewDefinition viewDefinition) {
    final ViewExecutionOptions primaryOptions = getPrimaryExecutionOptions(executionOptions);
    final ParallelRecompilationViewProcessWorker worker = createWorkerImpl(context, primaryOptions, viewDefinition);
    worker.startDeferred(primaryOptions);
    return worker;
  }
View Full Code Here

    worker.startDeferred(primaryOptions);
    return worker;
  }

  protected ViewProcessWorker immediateExecution(final ViewProcessWorkerContext context, final ViewExecutionOptions executionOptions, final ViewDefinition viewDefinition) {
    final ViewExecutionOptions primaryOptions = getPrimaryExecutionOptions(executionOptions);
    final ParallelRecompilationViewProcessWorker worker = createWorkerImpl(context, primaryOptions, viewDefinition);
    worker.startImmediate(primaryOptions);
    return worker;
  }
View Full Code Here

  private ViewProcessImpl createViewProcess(UniqueId definitionId, ViewExecutionOptions viewExecutionOptions,
      ViewResultMode resultMode, ViewResultMode fragmentResultMode) {

    // TEMPORARY CODE - This method should be removed post credit work and supports Excel (Jim)
    ViewExecutionOptions executionOptions = verifyLiveDataViewExecutionOptions(viewExecutionOptions);
    // END TEMPORARY CODE

    _processLock.lock();
    try {
      final String idValue = generateIdValue(_processIdSource);
      final UniqueId viewProcessId = UniqueId.of(PROCESS_SCHEME, idValue);
      final ViewProcessContext viewProcessContext = createViewProcessContext(viewProcessId, new VersionedUniqueIdSupplier(CYCLE_SCHEME, idValue));
      final ViewProcessImpl viewProcess = new ViewProcessImpl(definitionId, executionOptions, viewProcessContext, this);

      // If executing in batch mode then attach a special listener to write incoming results into the batch db
      if (executionOptions.getFlags().contains(ViewExecutionFlags.BATCH)) {
        if (_viewResultListenerFactory == null) {
          throw new IllegalStateException("Batch mode requires a ViewResultListenerFactory");
        }
        viewProcess.attachListener(_viewResultListenerFactory.createViewResultListener(viewProcess.getLatestViewDefinition().getMarketDataUser()), resultMode, fragmentResultMode);
      }
View Full Code Here

    final ViewClient client = vp.createViewClient(ViewProcessorTestEnvironment.TEST_USER);
    final TestViewResultListener resultListener = new TestViewResultListener();
    client.setResultListener(resultListener);
    final ViewCycleExecutionOptions cycleExecutionOptions = ViewCycleExecutionOptions.builder().setValuationTime(Instant.now()).setMarketDataSpecification(MarketData.live()).create();
    final EnumSet<ViewExecutionFlags> flags = ExecutionFlags.none().awaitMarketData().get();
    final ViewExecutionOptions executionOptions = ExecutionOptions.of(ArbitraryViewCycleExecutionSequence.single(cycleExecutionOptions), flags);
    client.attachToViewProcess(env.getViewDefinition().getUniqueId(), executionOptions);

    resultListener.assertViewDefinitionCompiled(TIMEOUT);

    final ViewProcessImpl viewProcess = env.getViewProcess(vp, client.getUniqueId());
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.