[ 
https://issues.apache.org/jira/browse/KAFKA-5698?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16113746#comment-16113746
 ] 

ASF GitHub Bot commented on KAFKA-5698:
---------------------------------------

GitHub user guozhangwang opened a pull request:

    https://github.com/apache/kafka/pull/3618

    KAFKA-5698: Sort processor nodes based on its sub-tree size

    1. Sort processor nodes within a sub-topology by its sub-tree size: nodes 
with largest sizes are source nodes and hence printed earlier.
    
    2. Minor: start newlines for predecessor and successor.
    
    3. Minor: space between processor nodes and stores / topics; maintain `[]` 
for the topic names.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/guozhangwang/kafka 
K5698-topology-description-sorting

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/kafka/pull/3618.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #3618
    
----
commit bce7ea7d448fe15bebc45e4a12de5831c3f727db
Author: Guozhang Wang <wangg...@gmail.com>
Date:   2017-08-04T00:43:30Z

    sort processor nodes based on its sub-tree size

----


> 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
>              Labels: newbie++
>
> 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)

Reply via email to