Examples of InMemoryViewComputationCacheSource


Examples of com.opengamma.engine.cache.InMemoryViewComputationCacheSource

  ViewComputationCache _previousCache;
  LiveDataDeltaCalculator _deltaCalculator;

  @BeforeMethod
  public void setUp() {
    final InMemoryViewComputationCacheSource source = new InMemoryViewComputationCacheSource (FudgeContext.GLOBAL_DEFAULT);
    _cache = source.getCache(UniqueId.of("Test", "ViewCycle", "1"), "Default");
    _previousCache = source.getCache(UniqueId.of("Test", "ViewCycle", "0"), "Default");
    _deltaCalculator = new LiveDataDeltaCalculator(
        _graph,
        _cache,
        _previousCache);
View Full Code Here

Examples of com.opengamma.engine.cache.InMemoryViewComputationCacheSource

    compilationService.initialize();
    final FunctionResolver functionResolver = new DefaultFunctionResolver(compilationService);
    final InMemorySecuritySource securitySource = new InMemorySecuritySource();
    final MockPositionSource positionSource = new MockPositionSource();
    compilationContext.setRawComputationTargetResolver(new DefaultComputationTargetResolver(securitySource, positionSource));
    final ViewComputationCacheSource computationCacheSource = new InMemoryViewComputationCacheSource(FudgeContext.GLOBAL_DEFAULT);
    final FunctionInvocationStatisticsGatherer functionInvocationStatistics = new DiscardingInvocationStatisticsGatherer();
    final FunctionExecutionContext executionContext = new FunctionExecutionContext();
    final JobDispatcher jobDispatcher = new JobDispatcher(new LocalNodeJobInvoker(new SimpleCalculationNode(computationCacheSource, compilationService, executionContext, "node",
        Executors.newCachedThreadPool(), functionInvocationStatistics, new CalculationNodeLogEventListener(new ThreadLocalLogEventListener()))));
    final ViewPermissionProvider viewPermissionProvider = new DefaultViewPermissionProvider();
View Full Code Here

Examples of com.opengamma.engine.cache.InMemoryViewComputationCacheSource

    final SecuritySource securitySource = getSecuritySource() != null ? getSecuritySource() : generateSecuritySource();
    final FunctionCompilationContext functionCompilationContext = getFunctionCompilationContext() != null ? getFunctionCompilationContext() : generateFunctionCompilationContext();

    final ConfigSource configSource = getConfigSource() != null ? getConfigSource() : generateConfigSource();

    final InMemoryViewComputationCacheSource cacheSource = new InMemoryViewComputationCacheSource(fudgeContext);
    vpFactBean.setComputationCacheSource(cacheSource);

    final DependencyGraphExecutorFactory dependencyGraphExecutorFactory = getDependencyGraphExecutorFactory() != null ? getDependencyGraphExecutorFactory()
        : generateDependencyGraphExecutorFactory();
    vpFactBean.setDependencyGraphExecutorFactory(dependencyGraphExecutorFactory);
View Full Code Here

Examples of com.opengamma.engine.cache.InMemoryViewComputationCacheSource

  public TestCalculationNode() {
    this(new ThreadLocalLogEventListener());
  }

  public TestCalculationNode(final ThreadLocalLogEventListener logEventListener) {
    super(new InMemoryViewComputationCacheSource(OpenGammaFudgeContext.getInstance()), initializedCFS(), new FunctionExecutionContext(), InetAddressUtils.getLocalHostName(), Executors
        .newCachedThreadPool(), new DiscardingInvocationStatisticsGatherer(), new CalculationNodeLogEventListener(logEventListener));
  }
View Full Code Here

Examples of com.opengamma.engine.cache.InMemoryViewComputationCacheSource

  private static final Logger s_logger = LoggerFactory.getLogger(RemoteCacheRequestResponseTest.class);
  private static final FudgeContext s_fudgeContext = OpenGammaFudgeContext.getInstance();

  @Test(timeOut = 10000l)
  public void singleThreadSpecLookupDifferentIdentifierValues() {
    InMemoryViewComputationCacheSource cache = new InMemoryViewComputationCacheSource(s_fudgeContext);
    ViewComputationCacheServer server = new ViewComputationCacheServer(cache);
    DirectFudgeConnection conduit = new DirectFudgeConnection(cache.getFudgeContext());
    RemoteCacheClient client = new RemoteCacheClient(conduit.getEnd1());
    conduit.connectEnd2(server);
    IdentifierMap identifierMap = new RemoteIdentifierMap(client);

    final ValueSpecification[] valueSpec = new ValueSpecification[10];
View Full Code Here

Examples of com.opengamma.engine.cache.InMemoryViewComputationCacheSource

    s_logger.debug("End bulk lookup");
  }

  @Test(timeOut = 10000l)
  public void singleThreadLookupDifferentIdentifierValuesRepeated() {
    InMemoryViewComputationCacheSource cache = new InMemoryViewComputationCacheSource(s_fudgeContext);
    ViewComputationCacheServer server = new ViewComputationCacheServer(cache);
    DirectFudgeConnection conduit = new DirectFudgeConnection(cache.getFudgeContext());
    conduit.connectEnd2(server);
    RemoteCacheClient client = new RemoteCacheClient(conduit.getEnd1());
    IdentifierMap identifierMap = new RemoteIdentifierMap(client);

    Map<String, Long> _idsByValueName = new HashMap<String, Long>();
View Full Code Here

Examples of com.opengamma.engine.cache.InMemoryViewComputationCacheSource

    }
  }

  @Test(timeOut = 30000l)
  public void multiThreadLookupDifferentIdentifierValuesRepeatedSharedClient() throws InterruptedException {
    InMemoryViewComputationCacheSource cache = new InMemoryViewComputationCacheSource(s_fudgeContext);
    ViewComputationCacheServer server = new ViewComputationCacheServer(cache);
    DirectFudgeConnection conduit1 = new DirectFudgeConnection(cache.getFudgeContext());
    conduit1.connectEnd2(server);
    DirectFudgeConnection conduit2 = new DirectFudgeConnection(cache.getFudgeContext());
    conduit2.connectEnd2(server);
    final RemoteCacheClient client = new RemoteCacheClient(conduit1.getEnd1(), conduit2.getEnd1());
    final IdentifierMap identifierMap = new RemoteIdentifierMap(client);

    final ConcurrentMap<String, Long> _idsByValueName = new ConcurrentHashMap<String, Long>();
View Full Code Here

Examples of com.opengamma.engine.cache.InMemoryViewComputationCacheSource

    assertFalse("One thread failed. Check logs.", failed.get());
  }

  @Test(timeOut = 30000l)
  public void multiThreadLookupDifferentIdentifierValuesRepeatedDifferentClient() throws InterruptedException {
    InMemoryViewComputationCacheSource cache = new InMemoryViewComputationCacheSource(s_fudgeContext);
    final ViewComputationCacheServer server = new ViewComputationCacheServer(cache);

    final ConcurrentMap<String, Long> _idsByValueName = new ConcurrentHashMap<String, Long>();
    final Random rand = new Random();
    final AtomicBoolean failed = new AtomicBoolean(false);
    List<Thread> threads = new ArrayList<Thread>();
    for (int i = 0; i < 10; i++) {
      final DirectFudgeConnection conduit = new DirectFudgeConnection(cache.getFudgeContext());
      conduit.connectEnd2(server);
      Thread t = new Thread(new Runnable() {
        @Override
        public void run() {
          final RemoteCacheClient client = new RemoteCacheClient(conduit.getEnd1());
View Full Code Here

Examples of com.opengamma.engine.cache.InMemoryViewComputationCacheSource

  }

  // @Test(timeout=10000l)
  @Test
  public void singleThreadPutLoad() throws InterruptedException {
    InMemoryViewComputationCacheSource cache = new InMemoryViewComputationCacheSource(s_fudgeContext);
    ViewComputationCacheServer server = new ViewComputationCacheServer(cache);
    DirectFudgeConnection conduit = new DirectFudgeConnection(cache.getFudgeContext());
    conduit.connectEnd2(server);
    RemoteCacheClient client = new RemoteCacheClient(conduit.getEnd1());
    FudgeMessageStore dataStore = new RemoteFudgeMessageStore(client, new ViewComputationCacheKey(UniqueId.of("Test", "ViewCycle1"), "Config1"));

    // Single value
View Full Code Here

Examples of com.opengamma.engine.cache.InMemoryViewComputationCacheSource

    assertEquals(inputValue2.getAllFields(), outputMap.get(identifier2).getAllFields());
  }

  @Test(timeOut = 10000l)
  public void singleThreadPutLoadPurgeLoad() throws InterruptedException {
    InMemoryViewComputationCacheSource cache = new InMemoryViewComputationCacheSource(s_fudgeContext);
    ViewComputationCacheServer server = new ViewComputationCacheServer(cache);
    DirectFudgeConnection conduit = new DirectFudgeConnection(cache.getFudgeContext());
    conduit.connectEnd2(server);
    RemoteCacheClient client = new RemoteCacheClient(conduit.getEnd1());
    FudgeMessageStore dataStore = new RemoteFudgeMessageStore(client, new ViewComputationCacheKey(
        UniqueId.of("Test", "ViewCycle1"), "Config1"));
    final MutableFudgeMsg inputValue = s_fudgeContext.newMessage();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.