ableegoldman commented on code in PR #18149:
URL: https://github.com/apache/kafka/pull/18149#discussion_r1881209707
##########
streams/src/main/java/org/apache/kafka/streams/kstream/internals/graph/StreamToTableNode.java:
##########
@@ -17,51 +17,28 @@
package org.apache.kafka.streams.kstream.internals.graph;
-import org.apache.kafka.common.utils.Bytes;
-import org.apache.kafka.streams.kstream.internals.KTableSource;
-import org.apache.kafka.streams.kstream.internals.KeyValueStoreMaterializer;
-import org.apache.kafka.streams.kstream.internals.MaterializedInternal;
import org.apache.kafka.streams.processor.internals.InternalTopologyBuilder;
-import org.apache.kafka.streams.processor.internals.StoreFactory;
-import org.apache.kafka.streams.state.KeyValueStore;
/**
* Represents a KTable convert From KStream
*/
public class StreamToTableNode<K, V> extends GraphNode {
private final ProcessorParameters<K, V, ?, ?> processorParameters;
- private final MaterializedInternal<K, V, ?> materializedInternal;
public StreamToTableNode(final String nodeName,
- final ProcessorParameters<K, V, ?, ?>
processorParameters,
- final MaterializedInternal<K, V, ?>
materializedInternal) {
+ final ProcessorParameters<K, V, ?, ?>
processorParameters) {
super(nodeName);
this.processorParameters = processorParameters;
- this.materializedInternal = materializedInternal;
}
@Override
public String toString() {
- return "StreamToTableNode{" +
- ", processorParameters=" + processorParameters +
- ", materializedInternal=" + materializedInternal +
- "} " + super.toString();
+ return "StreamToTableNode{" + super.toString() + "}";
}
- @SuppressWarnings("unchecked")
@Override
public void writeToTopology(final InternalTopologyBuilder topologyBuilder)
{
- final StoreFactory storeFactory =
- new KeyValueStoreMaterializer<>((MaterializedInternal<K, V,
KeyValueStore<Bytes, byte[]>>) materializedInternal);
-
- final String processorName = processorParameters.processorName();
- final KTableSource<K, V> tableSource =
processorParameters.processorSupplier() instanceof KTableSource ?
- (KTableSource<K, V>) processorParameters.processorSupplier() :
null;
- topologyBuilder.addProcessor(processorName,
processorParameters.processorSupplier(), parentNodeNames());
-
- if (storeFactory != null && tableSource.materialized()) {
Review Comment:
nice to get rid of this no-op null check lol
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]