private void addPartitionReceiver(String streamId, boolean isInnerStream, MetaStreamEvent metaStreamEvent,
                                      List<PartitionExecutor> partitionExecutors) {
        if (!partitionStreamReceivers.containsKey(streamId) && !isInnerStream &&
                metaStreamEvent.getEventType() == MetaStreamEvent.EventType.DEFAULT) {
            StreamDefinition streamDefinition = (StreamDefinition) streamDefinitionMap.get(streamId);
            if (streamDefinition == null) {
                streamDefinition = (StreamDefinition) windowDefinitionMap.get(streamId);
            }
            PartitionStreamReceiver partitionStreamReceiver = new PartitionStreamReceiver(
                    siddhiAppContext, metaStreamEvent, streamDefinition, partitionExecutors, this);
            partitionStreamReceivers.put(partitionStreamReceiver.getStreamId(), partitionStreamReceiver);
            streamJunctionMap.get(partitionStreamReceiver.getStreamId()).subscribe(partitionStreamReceiver);
        }

    }
Runtime class to handle partitioning. It will hold all information regarding current partitions and wil create
partition dynamically during runtime.
modules/siddhi-core/src/main/java/io/siddhi/core/partition/PartitionRuntimeImpl.java