@Override
    protected StreamEvent addRequiredFields(ComplexEvent event, SiddhiAppContext siddhiAppContext,
                                            boolean cacheExpiryEnabled) {
        Object[] outputDataForCache;
        Object[] outputData = event.getOutputData();
        if (cacheExpiryEnabled) {
            outputDataForCache = new Object[numColumns];
            outputDataForCache[expiryAttributePosition] = outputDataForCache[cachePolicyAttributePosition] =
                    siddhiAppContext.getTimestampGenerator().currentTime();
        } else {
            outputDataForCache = new Object[numColumns];
            outputDataForCache[cachePolicyAttributePosition] =
                    siddhiAppContext.getTimestampGenerator().currentTime();
        }
        System.arraycopy(outputData, 0, outputDataForCache, 0, outputData.length);
        StreamEvent eventForCache = new StreamEvent(0, 0, outputDataForCache.length);
        eventForCache.setOutputData(outputDataForCache);
        return eventForCache;
    }
cache table with LRU entry removal
modules/siddhi-core/src/main/java/io/siddhi/core/table/CacheTableLRU.java