private boolean isStatePresentForAggregationDuration(TimePeriod.Duration recreateForDuration) {
        if (isPersistedAggregation) {
            if (log.isDebugEnabled()) {
                log.debug("Aggregation will be completed under the mode 'Persisted Aggregation' hence the state will"
                        + " be ignored");
            }
            return false;
        } else {
            IncrementalExecutor incrementalExecutor = (IncrementalExecutor) incrementalExecutorMap.get(
                    recreateForDuration);
            BaseIncrementalValueStore baseIncrementalValueStore = incrementalExecutor.getBaseIncrementalValueStore();
            StateHolder<BaseIncrementalValueStore.StoreState> storeStateHolder =
                    baseIncrementalValueStore.getStoreStateHolder();
            return (storeStateHolder instanceof SingleSyncStateHolder) &&
                    ((SingleSyncStateHolder) storeStateHolder).isStatePresent();
        }
    }
This class is used to recreate in-memory data from the tables (Such as RDBMS) in incremental aggregation.
This ensures that the aggregation calculations are done correctly in case of server restart.
modules/siddhi-core/src/main/java/io/siddhi/core/aggregation/IncrementalExecutorsInitialiser.java