Package com.opengamma.engine.calcnode

Examples of com.opengamma.engine.calcnode.SimpleCalculationNode


    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();
    final GraphExecutorStatisticsGathererProvider graphExecutorStatisticsProvider = new DiscardingGraphStatisticsGathererProvider();
    final ViewDefinition viewDefinition = new ViewDefinition("TestView", UserPrincipal.getTestUser());
    viewDefinition.addViewCalculationConfiguration(new ViewCalculationConfiguration(viewDefinition, "default"));
View Full Code Here


    final FunctionExecutionContext functionExecutionContext = getFunctionExecutionContext() != null ? getFunctionExecutionContext() : generateFunctionExecutionContext();
    functionExecutionContext.setSecuritySource(securitySource);

    final ThreadLocalLogEventListener threadLocalLogListener = new ThreadLocalLogEventListener();
    LogBridge.getInstance().addListener(threadLocalLogListener);
    final SimpleCalculationNode localCalcNode = new SimpleCalculationNode(cacheSource, compiledFunctions, functionExecutionContext, "node", Executors.newCachedThreadPool(),
        new DiscardingInvocationStatisticsGatherer(), new CalculationNodeLogEventListener(threadLocalLogListener));
    final LocalNodeJobInvoker jobInvoker = new LocalNodeJobInvoker(localCalcNode);
    vpFactBean.setComputationJobDispatcher(new JobDispatcher(jobInvoker));
    vpFactBean.setFunctionResolver(generateFunctionResolver(compiledFunctions));
    vpFactBean.setViewResultListenerFactory(_viewResultListenerFactory);
View Full Code Here

  }

  @Override
  public String removeNode() {
    for (int i = 10; i > 0; i--) {
      final SimpleCalculationNode node = getContainer().removeNode();
      if (node != null) {
        return "Removed " + node.getNodeId() + " from container";
      }
      if (getTotalNodeCount() == 0) {
        return "Total node count is zero";
      }
      if (i > 1) {
View Full Code Here

    return "No available nodes to remove";
  }

  @Override
  public String addNode() {
    final SimpleCalculationNode node = getNodeFactory().createNode();
    getContainer().addNode(node);
    return "Added " + node.getNodeId() + " to container";
  }
View Full Code Here

    final IdentifierMap identifierMap = new InMemoryIdentifierMap ();
    final DirectFudgeConnection conduit = new DirectFudgeConnection(s_fudgeContext);
    final CollectingFudgeMessageReceiver messages = new CollectingFudgeMessageReceiver();
    conduit.getEnd2().setFudgeMessageReceiver(messages);
    final RemoteNodeClient client = new RemoteNodeClient(conduit.getEnd1(), new CompiledFunctionService (new InMemoryFunctionRepository (), new CachingFunctionRepositoryCompiler(), new FunctionCompilationContext ()), new InMemoryIdentifierMap (), new FunctionInvocationStatisticsSender ());
    final SimpleCalculationNode node = new TestCalculationNode();
    assertEquals(0, messages.getMessages().size());
    client.addNode(node);
    assertEquals(0, messages.getMessages().size());
    client.start();
    assertEquals(1, messages.getMessages().size());
View Full Code Here

    final IdentifierMap identifierMap = new InMemoryIdentifierMap ();
    final DirectFudgeConnection conduit = new DirectFudgeConnection(s_fudgeContext);
    final CollectingFudgeMessageReceiver messages = new CollectingFudgeMessageReceiver();
    conduit.getEnd2().setFudgeMessageReceiver(messages);
    final RemoteNodeClient client = new RemoteNodeClient(conduit.getEnd1(), new CompiledFunctionService (new InMemoryFunctionRepository (), new CachingFunctionRepositoryCompiler(), new FunctionCompilationContext ()), new InMemoryIdentifierMap (), new FunctionInvocationStatisticsSender ());
    final SimpleCalculationNode failingNode = new TestCalculationNode() {
     
      @Override
      public CalculationJobResult executeJob(CalculationJob job) {
        throw new OpenGammaRuntimeException ("Remote node not working");
      }
View Full Code Here

TOP

Related Classes of com.opengamma.engine.calcnode.SimpleCalculationNode

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.