public void init(LockWrapper lockWrapper, String queryName) {
        this.lockWrapper = lockWrapper;
        this.queryName = queryName;
        String id = "Scheduler_" + queryName + "_" + siddhiQueryContext.generateNewId();
        this.stateHolder = siddhiQueryContext.generateStateHolder(id, false, () -> new SchedulerState());
    }
Scheduler implementation to take periodic snapshots
modules/siddhi-core/src/main/java/io/siddhi/core/util/Scheduler.java