Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Stateless operations like stream(), map(), filter(), generate a single underlaying processor. The method depicted above will directly change the processor name.

Statefull operations

Stateful operations like table(), join() are translated to multiple processors (aka. nodes). The given name should be used to describe the first processor and as a prefix for all subsequent processors.

...

Code Block
languagejava
final StreamsBuilder builder = new StreamsBuilder();


KStream<String, String> stream = buildbuilderer1builder.stream("topic-input");
        stream.as(Described.withName("STREAM-FROM-TOPIC-INPUT"))
        .filter( (k, v) -> true ).as(Described.withName("FILTER-NULL-VALUE"))
        .map( (k, v) -> KeyValue.pair(k, v.toUpperCase())).as(Described.withName("MAP-TO-UPPERCASE"))
        .to("topic-output");

System.out.println(builder.build().describe());
---- (output)----
Topologies:
   Sub-topology: 0
    Source: STREAM-FROM-TOPIC-INPUT (topics: [topic-input])
      --> FILTER-NULL-VALUE
    Processor: FILTER-NULL-VALUE (stores: [])
      --> MAP-TO-UPPERCASE
      <-- STREAM-FROM-TOPIC-INPUT
    Processor: MAP-TO-UPPERCASE (stores: [])
      --> KSTREAM-SINK-0000000003
      <-- FILTER-NULL-VALUE
    Sink: KSTREAM-SINK-0000000003 (topic: topic-output)
      <-- MAP-TO-UPPERCASE

...