eventsPerStream = lookupEventsPerStream[row];
Object lookupValue = evaluators[valueNum].evaluate(eventsPerStream, true, exprEvaluatorContext);
lookupValues[valueNum] = lookupValue;
}
EventTable result = null;
// try the threadlocal iteration cache, if set
if (localDataCache != null)
{
result = localDataCache.getCached(lookupValues);
}
// try the connection cache
if (result == null)
{
result = dataCache.getCached(lookupValues);
if ((result != null) && (localDataCache != null))
{
localDataCache.put(lookupValues, result);
}
}
// use the result from cache
if (result != null) // found in cache
{
resultPerInputRow[row] = result;
}
else // not found in cache, get from actual polling (db query)
{
try
{
if (!strategyStarted)
{
pollExecStrategy.start();
strategyStarted = true;
}
// Poll using the polling execution strategy and lookup values
List<EventBean> pollResult = pollExecStrategy.poll(lookupValues);
// index the result, if required, using an indexing strategy
EventTable indexTable = indexingStrategy.index(pollResult, dataCache.isActive());
// assign to row
resultPerInputRow[row] = indexTable;
// save in cache