* Fetches the override operation to apply to market data in the given configuration. If there is no operation to apply, returns null.
*
* @return the shift operation, or null for non
*/
private OverrideOperation getCacheMarketDataOperation(ViewCalculationConfiguration calcConfig) {
OverrideOperationCompiler compiler = null;
ComputationTargetResolver.AtVersionCorrection resolver = null;
final Set<String> marketDataShift = calcConfig.getDefaultProperties().getValues(MARKET_DATA_SHIFT_PROPERTY);
OverrideOperation operation = null;
if (marketDataShift != null) {
if (marketDataShift.size() != 1) {
// This doesn't really mean much
s_logger.error("Market data shift for {} not valid - {}", calcConfig.getName(), marketDataShift);
} else {
if (compiler == null) {
compiler = getViewProcessContext().getOverrideOperationCompiler();
resolver = getViewProcessContext().getFunctionCompilationService().getFunctionCompilationContext().getRawComputationTargetResolver().atVersionCorrection(getVersionCorrection());
}
final String shiftExpr = marketDataShift.iterator().next();
try {
operation = compiler.compile(shiftExpr, resolver);
} catch (final IllegalArgumentException e) {
s_logger.error("Market data shift for {} not valid - {}", calcConfig.getName(), shiftExpr);
s_logger.info("Invalid market data shift", e);
}
}