private Map<TopicPartition, RecordQueue> createPartitionQueues() {
        final Map<TopicPartition, RecordQueue> partitionQueues = new HashMap<>();
        for (final TopicPartition partition : inputPartitions()) {
            partitionQueues.put(partition, recordQueueCreator.createQueue(partition));
        }
        return partitionQueues;
    }
A StreamTask is associated with a {@link AbstractPartitionGroup}, and is assigned to a StreamThread for processing.
streams/src/main/java/org/apache/kafka/streams/processor/internals/StreamTask.java