@Override
    public void writeToTopology(final InternalTopologyBuilder topologyBuilder) {
        processorParameters().addProcessorTo(topologyBuilder, parentNodeNames());

        if (storeNames != null && storeNames.length > 0) {
            topologyBuilder.connectProcessorAndStateStores(processorParameters().processorName(), storeNames);
        }

        if (storeFactory != null) {
            topologyBuilder.addStateStore(storeFactory, processorParameters().processorName());
        }
    }
Create a node representing a stateful processor,
where the store needs to be built and registered as part of building this node.
streams/src/main/java/org/apache/kafka/streams/kstream/internals/graph/StatefulProcessorNode.java