final Collection<ValueSpecification> marketDataRequirements = calcConfig.getMarketDataRequirements();
final Set<ValueSpecification> terminalOutputs = calcConfig.getTerminalOutputSpecifications().keySet();
final Collection<ComputedValueResult> valuesToLoad = new ArrayList<>(marketDataRequirements.size());
for (ValueSpecification marketDataSpec : marketDataRequirements) {
Object marketDataValue = marketDataValues.get(marketDataSpec);
ComputedValueResult computedValueResult;
if (operation != null) {
if (marketDataValue != null) {
marketDataValue = operation.apply(marketDataSpec.toRequirementSpecification(), marketDataValue);
if (marketDataValue == null) {
s_logger.debug("Market data {} discarded by override operation", marketDataSpec);
}
}
}
if (marketDataValue == null) {
s_logger.debug("Unable to load market data value for {} from snapshot {}", marketDataSpec, getValuationTime());
missingMarketData++;
// TODO provide elevated logs if requested from market data providers
computedValueResult = new ComputedValueResult(marketDataSpec, MissingInput.MISSING_MARKET_DATA, MARKET_DATA_LOG);
} else {
computedValueResult = new ComputedValueResult(marketDataSpec, marketDataValue, AggregatedExecutionLog.EMPTY);
fragmentResultModel.addMarketData(computedValueResult);
fullResultModel.addMarketData(computedValueResult);
}
if (terminalOutputs.contains(marketDataSpec) && (resultModel.getOutputMode(marketDataSpec.getTargetSpecification().getType()) != ResultOutputMode.NONE)) {
fragmentResultModel.addValue(calcConfig.getName(), computedValueResult);