@Override
    public State getState() {
        String partitionFlowId = SiddhiAppContext.getPartitionFlowId();
        String groupByFlowId = SiddhiAppContext.getGroupByFlowId();
        Map<String, State> partitionStates = states.computeIfAbsent(partitionFlowId, k -> new HashMap<>());
        return partitionStates.computeIfAbsent(groupByFlowId, s -> stateFactory.createNewState());
    }
State holder for  partitioned use case
modules/siddhi-core/src/main/java/io/siddhi/core/util/snapshot/state/PartitionStateHolder.java