Skip to content

Commit

Permalink
KAFKA-12829: Remove deprecated Topology#addProcessor of old Processor…
Browse files Browse the repository at this point in the history
… API
  • Loading branch information
pegasas committed Oct 6, 2024
1 parent 420f69a commit 8466f4c
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 611 deletions.
43 changes: 0 additions & 43 deletions streams/src/main/java/org/apache/kafka/streams/Topology.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
import org.apache.kafka.streams.processor.api.Processor;
import org.apache.kafka.streams.processor.api.ProcessorSupplier;
import org.apache.kafka.streams.processor.internals.InternalTopologyBuilder;
import org.apache.kafka.streams.processor.internals.ProcessorAdapter;
import org.apache.kafka.streams.processor.internals.ProcessorNode;
import org.apache.kafka.streams.processor.internals.ProcessorTopology;
import org.apache.kafka.streams.processor.internals.SinkNode;
Expand Down Expand Up @@ -655,48 +654,6 @@ public synchronized <K, V> Topology addSink(final String name,
return this;
}

/**
* Add a new processor node that receives and processes records output by one or more parent source or processor
* node.
* Any new record output by this processor will be forwarded to its child processor or sink nodes.
* The supplier should always generate a new instance each time
* {@link org.apache.kafka.streams.processor.ProcessorSupplier#get()} gets called. Creating a single
* {@link org.apache.kafka.streams.processor.Processor} object and returning the same object reference in
* {@link org.apache.kafka.streams.processor.ProcessorSupplier#get()} would be a violation of the supplier pattern
* and leads to runtime exceptions.
* If {@code supplier} provides stores via {@link ConnectedStoreProvider#stores()}, the provided {@link StoreBuilder}s
* will be added to the topology and connected to this processor automatically.
*
* @param name the unique name of the processor node
* @param supplier the supplier used to obtain this node's {@link org.apache.kafka.streams.processor.Processor} instance
* @param parentNames the name of one or more source or processor nodes whose output records this processor should receive
* and process
* @return itself
* @throws TopologyException if parent processor is not added yet, or if this processor's name is equal to the parent's name
* @deprecated Since 2.7.0 Use {@link #addProcessor(String, ProcessorSupplier, String...)} instead.
*/
@SuppressWarnings("rawtypes")
@Deprecated
public synchronized Topology addProcessor(final String name,
final org.apache.kafka.streams.processor.ProcessorSupplier supplier,
final String... parentNames) {
return addProcessor(
name,
new ProcessorSupplier<Object, Object, Object, Object>() {
@Override
public Set<StoreBuilder<?>> stores() {
return supplier.stores();
}

@Override
public org.apache.kafka.streams.processor.api.Processor<Object, Object, Object, Object> get() {
return ProcessorAdapter.adaptRaw(supplier.get());
}
},
parentNames
);
}

/**
* Add a new processor node that receives and processes records output by one or more parent source or processor
* node.
Expand Down
Loading

0 comments on commit 8466f4c

Please sign in to comment.