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

ASF GitHub Bot commented on STORM-854:
--------------------------------------

Github user HeartSaVioR commented on a diff in the pull request:

    https://github.com/apache/storm/pull/669#discussion_r37170060
  
    --- Diff: external/storm-kafka/src/jvm/storm/kafka/PartitionManager.java ---
    @@ -137,8 +137,14 @@ public EmitState next(SpoutOutputCollector collector) {
                 }
                 Iterable<List<Object>> tups = 
KafkaUtils.generateTuples(_spoutConfig, toEmit.msg);
                 if (tups != null) {
    -                for (List<Object> tup : tups) {
    -                    collector.emit(tup, new KafkaMessageId(_partition, 
toEmit.offset));
    +           if(_spoutConfig.topicAsStreamId) {
    +               for (List<Object> tup : tups) {
    --- End diff --
    
    @harshach 
    @rohanag12's approach reduces execution of if statement to just once.
    (And I'm not sure compiler optimization takes care of it.)
    It may hurt readability slightly by code duplication, but I think it is 
small enough.


> [Storm-Kafka] KafkaSpout can  set the topic name as the output streamid
> -----------------------------------------------------------------------
>
>                 Key: STORM-854
>                 URL: https://issues.apache.org/jira/browse/STORM-854
>             Project: Apache Storm
>          Issue Type: Improvement
>          Components: storm-kafka
>    Affects Versions: 0.9.5
>            Reporter: zhiwei
>             Fix For: 0.10.0
>
>
> KafkaSpout can  set the topic name as the output streamid



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to