Package com.opengamma.util

Examples of com.opengamma.util.PoolExecutor$ExecutorThreadFactory


  }

  @Test(groups = TestGroup.UNIT)
  public void testParallelNoSlaveThreads() {
    final Callback cb = new Callback();
    PortfolioNodeTraverser.parallel(cb, new PoolExecutor(0, getClass().getSimpleName())).traverse(createTestPortfolioNode(new AtomicInteger(), 2));
    // With a single thread (the caller) should be depth first
    assertParallelOrder(cb);
  }
View Full Code Here


        } catch (InterruptedException e) {
        }
        super.visit(type, uniqueId);
      }
    };
    PortfolioNodeTraverser.parallel(cb, new PoolExecutor(8, getClass().getSimpleName())).traverse(createTestPortfolioNode(new AtomicInteger(), 2));
    assertParallelOrder(cb);
  }
View Full Code Here

    functionCompilationContext.setRawComputationTargetResolver(new DefaultCachingComputationTargetResolver(new DefaultComputationTargetResolver(securitySource, positionSource),
        _cacheManager));
    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());
View Full Code Here

    cfs.initialize();
    final DefaultFunctionResolver functionResolver = new DefaultFunctionResolver(cfs);
    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);
View Full Code Here

    cfs.initialize();
    final DefaultFunctionResolver functionResolver = new DefaultFunctionResolver(cfs);
    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");
View Full Code Here

    final CompiledFunctionService cfs = new CompiledFunctionService(functionRepo, new CachingFunctionRepositoryCompiler(), compilationContext);
    cfs.initialize();
    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);
View Full Code Here

    final CompiledFunctionService cfs = new CompiledFunctionService(functionRepo, new CachingFunctionRepositoryCompiler(), compilationContext);
    cfs.initialize();
    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.
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

        return Collections.<ExternalIdBundle, Collection<V>>singletonMap(bundle, result);
      } else {
        return Collections.emptyMap();
      }
    }
    final PoolExecutor executor = PoolExecutor.instance();
    if (executor != null) {
      return getAllMultiThread(executor, source, bundles, versionCorrection);
    } else {
      return getAllSingleThread(source, bundles, versionCorrection);
    }
View Full Code Here

        return Collections.<ExternalIdBundle, V>singletonMap(bundle, object);
      } else {
        return Collections.emptyMap();
      }
    }
    final PoolExecutor executor = PoolExecutor.instance();
    if (executor != null) {
      return getSingleMultiThread(executor, source, bundles, versionCorrection);
    } else {
      return getSingleSingleThread(source, bundles, versionCorrection);
    }
View Full Code Here

TOP

Related Classes of com.opengamma.util.PoolExecutor$ExecutorThreadFactory

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.