public override void WriteToTopology(InternalTopologyBuilder builder)
 {
     if (ProcessorParameters != null)
     {
         builder.AddInternalTopic(RepartitionTopic, NumberOfPartition);
         builder.AddProcessor(ProcessorParameters.ProcessorName, ProcessorParameters.Processor,
                              ParentNodeNames());
         builder.AddSinkOperator(
             new StaticTopicNameExtractor <K, V>(RepartitionTopic),
             SinkName,
             Produced <K, V> .Create(KeySerdes, ValueSerdes).WithPartitioner(StreamPartitioner),
             ProcessorParameters.ProcessorName);
         builder.AddSourceOperator(
             RepartitionTopic,
             SourceName,
             new ConsumedInternal <K, V>(SourceName, KeySerdes, ValueSerdes, new FailOnInvalidTimestamp()));
     }
     else
     {
         builder.AddInternalTopic(RepartitionTopic, NumberOfPartition);
         builder.AddSinkOperator(
             new StaticTopicNameExtractor <K, V>(RepartitionTopic),
             SinkName,
             Produced <K, V> .Create(KeySerdes, ValueSerdes).WithPartitioner(StreamPartitioner),
             ParentNodeNames());
         builder.AddSourceOperator(
             RepartitionTopic,
             SourceName,
             new ConsumedInternal <K, V>(SourceName, KeySerdes, ValueSerdes, new FailOnInvalidTimestamp()));
     }
 }
示例#2
0
        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.TimestampedKeyValueStore <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(this.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);

                    // TODO :

                    //if (shouldReuseSourceTopicForChangelog)
                    //{
                    //    storeBuilder.withLoggingDisabled();
                    //    topologyBuilder.connectSourceStoreAndTopic(storeBuilder.name(), topicName);
                    //}
                }
            }
        }
示例#3
0
 public override void WriteToTopology(InternalTopologyBuilder builder)
 {
     builder.AddSourceOperator(topicName, this.streamGraphNode, consumed);
 }