public override void WriteToTopology(InternalTopologyBuilder builder)
        {
            // TODO: we assume source KTables can only be timestamped-key-value stores for now.
            // should be expanded for other types of stores as well.
            StoreBuilder <State.ITimestampedKeyValueStore <K, V> > storeBuilder = new TimestampedKeyValueStoreMaterializer <K, V>(materialized as Materialized <K, V, IKeyValueStore <Bytes, byte[]> >).Materialize();

            if (isGlobalKTable)
            {
                builder.AddGlobalStore(topicName, storeBuilder, sourceName, consumed, processorParameters);
            }
            else
            {
                builder.AddSourceOperator(topicName, sourceName, consumed);
                builder.AddProcessor(processorParameters.ProcessorName, processorParameters.Processor, sourceName);

                //// only add state store if the source KTable should be materialized
                KTableSource <K, V> ktableSource = (KTableSource <K, V>)processorParameters.Processor;
                if (ktableSource.QueryableName != null)
                {
                    builder.AddStateStore(storeBuilder, this.streamGraphNode);

                    if (shouldReuseSourceTopicForChangelog)
                    {
                        storeBuilder.WithLoggingDisabled();
                        builder.ConnectSourceStoreAndTopic(storeBuilder.Name, topicName);
                    }
                }
            }
        }