[
https://issues.apache.org/jira/browse/FLUME-2251?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14134422#comment-14134422
]
Hari Shreedharan commented on FLUME-2251:
-----------------------------------------
+1.
I made one change (below) and a couple of formatting changes. I will commit
this after running tests.
- This code causes two lookups into the map:
{code}
if (headers.containsKey("topic")) {
eventTopic = headers.get("topic");
}
{code}
I changed this to:
{code}
if((eventTopic = headers.get("topic")) == null) {
eventTopic = topic;
}
{code}
Looking at the Kafka code, it looks like KeyedMessage can have a null key -
which in this case it will have if the key is not specified in the event,
correct?
> 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-6.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)