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

Hari Shreedharan commented on FLUME-2251:
-----------------------------------------

Some minor comments:

- Please put all code in an if conditional inside {} even if it just one line.
- There are some lines > 80 characters. Please wrap them.
- These lines are in the hot path:
{code}
        logger.debug("{Event} " + eventTopic + " : "+ eventKey + " : " + new 
String(eventBody,"UTF-8"));

        logger.debug("event #{}",processedEvents);
{code}
Please wrap them if (logger.isDebugEnabled())
- Formatting is off (should be 1 less indent):
{code}
        // publish batch and commit.
        producer.send(messageList);
        transaction.commit();
{code}

- The messageList can be reused between process calls to avoid reallocation of 
the array each time. You can pre-allocate it to batchSize.
- You probably want to check for messageList.size > 0 before calling 
producer.send()

> Add support for Kafka Sink
> --------------------------
>
>                 Key: FLUME-2251
>                 URL: https://issues.apache.org/jira/browse/FLUME-2251
>             Project: Flume
>          Issue Type: Sub-task
>          Components: Sinks+Sources
>    Affects Versions: v1.4.0
>            Reporter: Ashish Paliwal
>            Priority: Minor
>              Labels: feature, patch
>         Attachments: FLUME-2251-0.patch, FLUME-2251-2.patch, 
> FLUME-2251-3.patch, FLUME-2251-4.patch, FLUME-2251-5.patch, FLUME-2251.patch, 
> FLUME-2251.patch, Flume-2251-1.patch
>
>
> Add support for Kafka Sink



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

Reply via email to