Package com.opengamma.engine.view

Examples of com.opengamma.engine.view.ViewResultEntry


   * @return only result in batch master for this computation target, null if not found
   * @throws IllegalArgumentException if there is more than 1 entry in batch master for the
   *  given computation target
   */
  public ViewResultEntry getData(ComputationTargetSpecification spec) {
    ViewResultEntry result = null;
    for (ViewResultEntry item : _data) {
      ComputationTargetSpecification match = item.getComputedValue().getSpecification().getTargetSpecification();
      if (spec.equals(match)) {
        if (result != null) {
          throw new IllegalArgumentException("More than 1 entry in batch DB for " + spec);
View Full Code Here


      final UniqueId targetId = UniqueId.of(targetTypeIdScheme, targetTypeIdValue, targetTypeIdVersion);
      final ValueProperties valueProperties = RiskValueProperties.parseJson(valueRequirementsSyntheticForm);
      final String configurationName = rs.getString("config_name");
      final ValueSpecification valueSpecification = ValueSpecification.of(valueName, computationTargetType, targetId, valueProperties);
      final ComputedValueResult computedValue = new ComputedValueResult(valueSpecification, value, AggregatedExecutionLog.EMPTY);
      final ViewResultEntry viewResultEntry = new ViewResultEntry(configurationName, computedValue);

      return viewResultEntry;
    }
View Full Code Here

    //cvr.setRequirements(newHashSet(_requirement));
    result.addValue("config_1", cvr);
    _batchMaster.addJobResults(run.getObjectId(), result);
   
    List<ViewResultEntry> resultEntries = _batchMaster.getBatchValues(run.getObjectId(), PagingRequest.ALL).getFirst();
    ViewResultEntry resultEntry = Iterables.getOnlyElement(resultEntries);
    assertEquals(0d, resultEntry.getComputedValue().getValue());
  }
View Full Code Here

  @SuppressWarnings("unchecked")
  @Test
  public void testGetBatchValues() {
    PagingRequest pagingRequest = PagingRequest.FIRST_PAGE;
    ViewResultEntry mockViewResultEntry = mock(ViewResultEntry.class);
   
    List<ViewResultEntry> viewResultEntries = newArrayList(mockViewResultEntry);
    Paging paging = Paging.of(pagingRequest, viewResultEntries);
   
    when(_underlying.getBatchValues(_riskRunId, pagingRequest)).thenReturn(Pair.of(viewResultEntries, paging));
View Full Code Here

        final Collection<ComputedValueResult> computedValues = config.getValue().getAllValues(target);
        totalComputedValues += computedValues.size();
        targetsSeen++;
        results.ensureCapacity(numTargets * (totalComputedValues / targetsSeen));
        for (ComputedValueResult computedValue : computedValues) {
          results.add(new ViewResultEntry(config.getKey(), computedValue));
        }
      }
    }
    return results;
  }
View Full Code Here

  @Override
  public ViewResultEntry buildObject(FudgeDeserializer deserializer, FudgeMsg msg) {
    String calcConfig = msg.getString(CALC_CONFIG_FIELD);
    ComputedValueResult value = deserializer.fieldValueToObject(ComputedValueResult.class, msg.getByName(VALUE_FIELD));
    return new ViewResultEntry(calcConfig, value);
  }
View Full Code Here

TOP

Related Classes of com.opengamma.engine.view.ViewResultEntry

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.