Guozhang Wang created KAFKA-5698:
------------------------------------
Summary: Sort processor node based on name suffix in
TopologyDescription.toString()
Key: KAFKA-5698
URL: https://issues.apache.org/jira/browse/KAFKA-5698
Project: Kafka
Issue Type: Bug
Components: streams
Reporter: Guozhang Wang
Today when we print the topology via the {{Topology#describe()#toString}}, the
processor nodes are not sorted inside the {{TopologyDescription.toString()}}
function. For example, for the word count demo topology we get:
{code}
Sub-topologies:
Sub-topology: 0
Processor: KSTREAM-FILTER-0000000005(stores: []) -->
KSTREAM-SINK-0000000004 <-- KSTREAM-MAP-0000000002
Source: KSTREAM-SOURCE-0000000000(topics: streams-wordcount-input) -->
KSTREAM-FLATMAPVALUES-0000000001
Processor: KSTREAM-FLATMAPVALUES-0000000001(stores: []) -->
KSTREAM-MAP-0000000002 <-- KSTREAM-SOURCE-0000000000
Processor: KSTREAM-MAP-0000000002(stores: []) --> KSTREAM-FILTER-0000000005
<-- KSTREAM-FLATMAPVALUES-0000000001
Sink: KSTREAM-SINK-0000000004(topic: Counts-repartition) <--
KSTREAM-FILTER-0000000005
Sub-topology: 1
Source: KSTREAM-SOURCE-0000000006(topics: Counts-repartition) -->
KSTREAM-AGGREGATE-0000000003
Sink: KSTREAM-SINK-0000000008(topic: streams-wordcount-output) <--
KTABLE-TOSTREAM-0000000007
Processor: KTABLE-TOSTREAM-0000000007(stores: []) -->
KSTREAM-SINK-0000000008 <-- KSTREAM-AGGREGATE-0000000003
Processor: KSTREAM-AGGREGATE-0000000003(stores: [Counts]) -->
KTABLE-TOSTREAM-0000000007 <-- KSTREAM-SOURCE-0000000006
{code}
While ideally we want:
{code}
Sub-topologies:
Sub-topology: 0
Source: KSTREAM-SOURCE-0000000000(topics: streams-wordcount-input) -->
KSTREAM-FLATMAPVALUES-0000000001
Processor: KSTREAM-FLATMAPVALUES-0000000001(stores: []) -->
KSTREAM-MAP-0000000002 <-- KSTREAM-SOURCE-0000000000
Processor: KSTREAM-MAP-0000000002(stores: []) --> KSTREAM-FILTER-0000000005
<-- KSTREAM-FLATMAPVALUES-0000000001
Processor: KSTREAM-FILTER-0000000005(stores: []) -->
KSTREAM-SINK-0000000004 <-- KSTREAM-MAP-0000000002
Sink: KSTREAM-SINK-0000000004(topic: Counts-repartition) <--
KSTREAM-FILTER-0000000005
Sub-topology: 1
Source: KSTREAM-SOURCE-0000000006(topics: Counts-repartition) -->
KSTREAM-AGGREGATE-0000000003
Processor: KSTREAM-AGGREGATE-0000000003(stores: [Counts]) -->
KTABLE-TOSTREAM-0000000007 <-- KSTREAM-SOURCE-0000000006
Processor: KTABLE-TOSTREAM-0000000007(stores: []) -->
KSTREAM-SINK-0000000008 <-- KSTREAM-AGGREGATE-0000000003
Sink: KSTREAM-SINK-0000000008(topic: streams-wordcount-output) <--
KTABLE-TOSTREAM-0000000007
{code}
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)