Package com.opengamma.engine.depgraph

Examples of com.opengamma.engine.depgraph.DependencyGraphBuilderFactory


    final CompiledFunctionService cfs = new CompiledFunctionService(functionRepo, new CachingFunctionRepositoryCompiler(), functionCompilationContext);
    cfs.initialize();
    final DefaultFunctionResolver functionResolver = new DefaultFunctionResolver(cfs);
    final ViewCompilationServices vcs = new ViewCompilationServices(new FixedMarketDataAvailabilityProvider(), functionResolver, functionCompilationContext, new PoolExecutor(1, getClass()
        .getSimpleName()),
        new DependencyGraphBuilderFactory());
    final ViewDefinition viewDefinition = new ViewDefinition("My View", UniqueId.of("FOO", "BAR"), "kirk");
    final CompiledViewDefinitionWithGraphsImpl compiledViewDefinition = ViewDefinitionCompiler.compile(viewDefinition, vcs, Instant.now(), VersionCorrection.LATEST);
    assertTrue(compiledViewDefinition.getMarketDataRequirements().isEmpty());
    assertTrue(compiledViewDefinition.getDependencyGraphExplorers().isEmpty());
    assertEquals(0, compiledViewDefinition.getComputationTargets().size());
View Full Code Here


    final DefaultCachingComputationTargetResolver computationTargetResolver = new DefaultCachingComputationTargetResolver(new DefaultComputationTargetResolver(securitySource, positionSource),
        _cacheManager);
    functionCompilationContext.setRawComputationTargetResolver(computationTargetResolver);
    final ViewCompilationServices vcs = new ViewCompilationServices(new FixedMarketDataAvailabilityProvider(), functionResolver, functionCompilationContext, new PoolExecutor(1, getClass()
        .getSimpleName()),
        new DependencyGraphBuilderFactory());
    final ViewDefinition viewDefinition = new ViewDefinition("My View", UniqueId.of("FOO", "BAR"), "kirk");
    // We've not provided a function that targets the position level, so we can't ask for it.
    viewDefinition.getResultModelDefinition().setPositionOutputMode(ResultOutputMode.NONE);
    final ViewCalculationConfiguration calcConfig = new ViewCalculationConfiguration(viewDefinition, "Fibble");
    calcConfig.addPortfolioRequirementName("My Sec", "OUTPUT");
View Full Code Here

    final DefaultCachingComputationTargetResolver computationTargetResolver = new DefaultCachingComputationTargetResolver(new DefaultComputationTargetResolver(securitySource, positionSource),
        _cacheManager);
    functionCompilationContext.setRawComputationTargetResolver(computationTargetResolver);
    final ViewCompilationServices vcs = new ViewCompilationServices(new FixedMarketDataAvailabilityProvider(), functionResolver, functionCompilationContext, new PoolExecutor(1, getClass()
        .getSimpleName()),
        new DependencyGraphBuilderFactory());
    final ViewDefinition viewDefinition = new ViewDefinition("My View", UniqueId.of("FOO", "BAR"), "kirk");
    viewDefinition.getResultModelDefinition().setPositionOutputMode(ResultOutputMode.NONE);
    final ViewCalculationConfiguration calcConfig = new ViewCalculationConfiguration(viewDefinition, "Fibble");
    calcConfig.addPortfolioRequirementName("My Sec", "OUTPUT");
    viewDefinition.addViewCalculationConfiguration(calcConfig);
View Full Code Here

    final DefaultFunctionResolver functionResolver = new DefaultFunctionResolver(cfs);
    final DefaultCachingComputationTargetResolver computationTargetResolver = new DefaultCachingComputationTargetResolver(new DefaultComputationTargetResolver(), _cacheManager);
    compilationContext.setRawComputationTargetResolver(computationTargetResolver);
    final ViewCompilationServices compilationServices = new ViewCompilationServices(new FixedMarketDataAvailabilityProvider(), functionResolver, compilationContext, new PoolExecutor(1, getClass()
        .getSimpleName()),
        new DependencyGraphBuilderFactory());
    // We'll require r1 which can be satisfied by f1
    calcConfig.addSpecificRequirement(f1.getResultSpec().toRequirementSpecification());
    final CompiledViewDefinitionWithGraphsImpl compiledViewDefinition = ViewDefinitionCompiler.compile(viewDefinition, compilationServices, Instant.now(), VersionCorrection.LATEST);
    assertTrue(compiledViewDefinition.getMarketDataRequirements().isEmpty());
    assertEquals(1, compiledViewDefinition.getDependencyGraphExplorers().size());
View Full Code Here

    final DefaultFunctionResolver functionResolver = new DefaultFunctionResolver(cfs);
    final DefaultCachingComputationTargetResolver computationTargetResolver = new DefaultCachingComputationTargetResolver(new DefaultComputationTargetResolver(securitySource), _cacheManager);
    compilationContext.setRawComputationTargetResolver(computationTargetResolver);
    final ViewCompilationServices compilationServices = new ViewCompilationServices(new FixedMarketDataAvailabilityProvider(), functionResolver, compilationContext, new PoolExecutor(1, getClass()
        .getSimpleName()),
        new DependencyGraphBuilderFactory());
    // We'll require r2 which can be satisfied by f2, which in turn requires the output of f1
    // Additionally, the security should be resolved through the ComputationTargetResolver, which only has a security
    // source.
    calcConfig.addSpecificRequirement(f2.getResultSpec().toRequirementSpecification());
    CompiledViewDefinitionWithGraphsImpl compiledViewDefinition = ViewDefinitionCompiler.compile(viewDefinition, compilationServices, Instant.now(), VersionCorrection.LATEST);
View Full Code Here

    final SecuritySource securitySource = new InMemorySecuritySource();
    final DefaultCachingComputationTargetResolver computationTargetResolver = new DefaultCachingComputationTargetResolver(new DefaultComputationTargetResolver(securitySource),
        _cacheManager);
    compilationContext.setRawComputationTargetResolver(computationTargetResolver);
    final Future<CompiledViewDefinitionWithGraphsImpl> future = ViewDefinitionCompiler.fullCompileTask(viewDefinition, new ViewCompilationServices(new FixedMarketDataAvailabilityProvider(),
        functionResolver, compilationContext, new PoolExecutor(1, getClass().getSimpleName()), new DependencyGraphBuilderFactory()), Instant.now(), VersionCorrection.LATEST);
    assertFalse(future.isDone());
    assertFalse(future.isCancelled());
    assertTrue(future.cancel(true));
    try {
      future.get();
View Full Code Here

    final MockConfigSource configSource = new MockConfigSource();
    configSource.put(viewDefinition);
    final ViewProcessContext vpc = new ViewProcessContext(UniqueId.of("Process", "Test"), configSource, viewPermissionProvider,
                                                          new DefaultViewPortfolioPermissionProvider(),
                                                          marketDataProviderResolver, compilationService, functionResolver,
        computationCacheSource, jobDispatcher, new SingleThreadViewProcessWorkerFactory(), new DependencyGraphBuilderFactory(), factory, graphExecutorStatisticsProvider,
        new DummyOverrideOperationCompiler(), new EngineResourceManagerImpl<SingleComputationCycle>(), new VersionedUniqueIdSupplier("Test", "1"), new InMemoryViewExecutionCache());
    final DependencyGraph graph = new DependencyGraph("Default");
    DependencyNode previous = null;
    for (int i = 0; i < JOB_SIZE; i++) {
      final DependencyNode node = new DependencyNode(ComputationTarget.NULL);
View Full Code Here

    final FunctionResolver resolver = new DefaultFunctionResolver(cfs, createPrioritizer());
    return resolver.compile(Instant.now());
  }

  private DependencyGraphBuilder createBuilder() {
    final DependencyGraphBuilderFactory factory = new DependencyGraphBuilderFactory();
    final DependencyGraphBuilder builder = factory.newInstance();
    final FunctionCompilationContext ctx = createFunctionCompilationContext();
    builder.setCalculationConfigurationName("Default");
    ctx.setViewCalculationConfiguration(new ViewCalculationConfiguration(new ViewDefinition("Name", "User"), "Default"));
    builder.setCompilationContext(ctx);
    final CompiledFunctionResolver cfr = createFunctionResolver(ctx);
View Full Code Here

  public void setDependencyGraphBuilderFactory(final DependencyGraphBuilderFactory dependencyGraphBuilderFactory) {
    _dependencyGraphBuilderFactory = dependencyGraphBuilderFactory;
  }

  private DependencyGraphBuilderFactory generateDependencyGraphBuilderFactory() {
    final DependencyGraphBuilderFactory factory = new DependencyGraphBuilderFactory();
    setDependencyGraphBuilderFactory(factory);
    return factory;
  }
View Full Code Here

TOP

Related Classes of com.opengamma.engine.depgraph.DependencyGraphBuilderFactory

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.