Package com.opengamma.engine.calcnode.msg

Examples of com.opengamma.engine.calcnode.msg.Ready


  private static final FudgeContext s_fudgeContext = OpenGammaFudgeContext.getInstance();
  private static final long TIMEOUT = Timeout.standardTimeoutMillis();

  public void simpleInvocation() {
    final JobDispatcher jobDispatcher = new JobDispatcher();
    final Ready initialMessage = new Ready(1, "Test");
    final DirectFudgeConnection conduit = new DirectFudgeConnection(s_fudgeContext);
    final RemoteNodeJobInvoker jobInvoker = new RemoteNodeJobInvoker(Executors.newCachedThreadPool(), initialMessage, conduit.getEnd1(), new InMemoryIdentifierMap(), new FunctionCosts(),
        new DummyFunctionBlacklistQuery(), new DummyFunctionBlacklistMaintainer());
    jobDispatcher.registerJobInvoker(jobInvoker);
    final TestJobResultReceiver resultReceiver = new TestJobResultReceiver();
View Full Code Here


    assertNotNull(resultReceiver.waitForResult(TIMEOUT));
  }

  public void saturate() {
    final JobDispatcher jobDispatcher = new JobDispatcher();
    final Ready initialMessage = new Ready(3, "Test");
    final DirectFudgeConnection conduit = new DirectFudgeConnection(s_fudgeContext);
    final RemoteNodeJobInvoker jobInvoker = new RemoteNodeJobInvoker(Executors.newCachedThreadPool(), initialMessage, conduit.getEnd1(), new InMemoryIdentifierMap(), new FunctionCosts(),
        new DummyFunctionBlacklistQuery(), new DummyFunctionBlacklistMaintainer());
    jobDispatcher.registerJobInvoker(jobInvoker);
    final FudgeConnection remoteNode = conduit.getEnd2();
View Full Code Here

    s_logger.debug("Sending message ({} fields) to {}", msg.getNumFields(), _connection);
    sender.send(msg);
  }

  protected void sendCapabilities() {
    final Ready ready = new Ready(getTotalNodeCount(), getHostId());
    // TODO any other capabilities to add
    sendMessage(ready);
  }
View Full Code Here

    messages.clear();
    final FudgeDeserializer dcontext = new FudgeDeserializer(s_fudgeContext);
    final FudgeSerializer scontext = new FudgeSerializer(s_fudgeContext);
    final RemoteCalcNodeMessage readyMessage = dcontext.fudgeMsgToObject(RemoteCalcNodeMessage.class, readyMsgEnvelope.getMessage());
    assertTrue(readyMessage instanceof Ready);
    final Ready ready = (Ready) readyMessage;
    assertEquals(1, ready.getCapacity());
    conduit.getEnd2 ().getFudgeMessageSender().send (FudgeSerializer.addClassHeader(scontext.objectToFudgeMsg (new Init(0)), Init.class, RemoteCalcNodeMessage.class));
    final CalculationJob job = createTestCalculationJob();
    AbstractIdentifierMap.convertIdentifiers(identifierMap, job);
    conduit.getEnd2().getFudgeMessageSender().send(
        FudgeSerializer.addClassHeader(scontext.objectToFudgeMsg(new Execute(job)), Execute.class, RemoteCalcNodeMessage.class));
View Full Code Here

    messages.clear();
    final FudgeDeserializer dcontext = new FudgeDeserializer(s_fudgeContext);
    final FudgeSerializer scontext = new FudgeSerializer(s_fudgeContext);
    final RemoteCalcNodeMessage readyMessage = dcontext.fudgeMsgToObject(RemoteCalcNodeMessage.class, readyMsgEnvelope.getMessage());
    assertTrue(readyMessage instanceof Ready);
    final Ready ready = (Ready) readyMessage;
    assertEquals(1, ready.getCapacity());
    conduit.getEnd2 ().getFudgeMessageSender().send (FudgeSerializer.addClassHeader(scontext.objectToFudgeMsg (new Init(0)), Init.class, RemoteCalcNodeMessage.class));
    final CalculationJob job = createTestCalculationJob();
    AbstractIdentifierMap.convertIdentifiers(identifierMap, job);
    conduit.getEnd2().getFudgeMessageSender().send(
        FudgeSerializer.addClassHeader(scontext.objectToFudgeMsg(new Execute(job)), Execute.class, RemoteCalcNodeMessage.class));
View Full Code Here

TOP

Related Classes of com.opengamma.engine.calcnode.msg.Ready

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.