@Override
    public boolean contains(StateEvent matchingEvent, CompiledCondition compiledCondition)
            throws ConnectionUnavailableException {
        containsMatchingEvent = matchingEvent;
        RecordStoreCompiledCondition recordStoreCompiledCondition;
        CompiledConditionWithCache compiledConditionWithCache;
        if (cacheEnabled) {
            RecordStoreCompiledCondition compiledConditionTemp = (RecordStoreCompiledCondition) compiledCondition;
            compiledConditionWithCache = (CompiledConditionWithCache)
                    compiledConditionTemp.getCompiledCondition();
            recordStoreCompiledCondition = new RecordStoreCompiledCondition(compiledConditionTemp.
                    variableExpressionExecutorMap, compiledConditionWithCache.getStoreCompileCondition(),
                    compiledConditionTemp.getSiddhiQueryContext());

            readWriteLock.readLock().lock();
            try {
                if (cacheTable.contains(matchingEvent, compiledConditionWithCache.getCacheCompileCondition())) {
                    return true;
                }
                return super.contains(matchingEvent, recordStoreCompiledCondition);
            } finally {
                readWriteLock.readLock().unlock();
            }
        } else {
            return super.contains(matchingEvent, compiledCondition);
        }
    }
An abstract implementation of table. Abstract implementation will handle {@link ComplexEventChunk} so that
developer can directly work with event data.
modules/siddhi-core/src/main/java/io/siddhi/core/table/record/AbstractQueryableRecordTable.java