@Override
    public State cleanGroupByStates() {
        String partitionFlowId = SiddhiAppContext.getPartitionFlowId();
        Map<String, State> groupByStates = states.remove(partitionFlowId);
        if (groupByStates != null) {
            return groupByStates.values().stream().findFirst().orElse(null);
        }
        return null;
    }
State holder for  partitioned use case
modules/siddhi-core/src/main/java/io/siddhi/core/util/snapshot/state/PartitionStateHolder.java