Search in sources :

Example 6 with ProcessorNode

use of org.apache.kafka.streams.processor.internals.ProcessorNode in project kafka by apache.

the class MockProcessorContext method forward.

@Override
@SuppressWarnings("unchecked")
public <K, V> void forward(K key, V value, int childIndex) {
    ProcessorNode thisNode = currentNode;
    ProcessorNode childNode = (ProcessorNode<K, V>) thisNode.children().get(childIndex);
    currentNode = childNode;
    try {
        childNode.process(key, value);
    } finally {
        currentNode = thisNode;
    }
}
Also used : ProcessorNode(org.apache.kafka.streams.processor.internals.ProcessorNode)

Aggregations

ProcessorNode (org.apache.kafka.streams.processor.internals.ProcessorNode)6 ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 HashSet (java.util.HashSet)1 LinkedHashMap (java.util.LinkedHashMap)1 List (java.util.List)1 TopologyBuilderException (org.apache.kafka.streams.errors.TopologyBuilderException)1 ProcessorTopology (org.apache.kafka.streams.processor.internals.ProcessorTopology)1 SinkNode (org.apache.kafka.streams.processor.internals.SinkNode)1 SourceNode (org.apache.kafka.streams.processor.internals.SourceNode)1