Re: creating a single kafka producer object for all partitions

2015-01-12 Thread Cody Koeninger
You should take a look at https://issues.apache.org/jira/browse/SPARK-4122 which is implementing writing to kafka in a pretty similar way (make a new producer inside foreachPartition) On Mon, Jan 12, 2015 at 5:24 AM, Sean Owen wrote: > Leader-not-found suggests a problem with zookeeper config.

Re: creating a single kafka producer object for all partitions

2015-01-12 Thread Sean Owen
Leader-not-found suggests a problem with zookeeper config. It depends a lot on the specifics of your error. But this is really a Kafka question, better for the Kafka list. On Mon, Jan 12, 2015 at 11:10 AM, Hafiz Mujadid wrote: > Actually this code is producing error leader not found exception. I

Re: creating a single kafka producer object for all partitions

2015-01-12 Thread Hafiz Mujadid
Actually this code is producing error leader not found exception. I am unable to find the reason On Mon, Jan 12, 2015 at 4:03 PM, kevinkim [via Apache Spark User List] < ml-node+s1001560n21098...@n3.nabble.com> wrote: > Well, you can use coalesce() to decrease number of partition to 1. > (It will

Re: creating a single kafka producer object for all partitions

2015-01-12 Thread Sean Owen
I might be missing something, but why are multiple Producer objects a problem? they're all sending to the same topic here. On Mon, Jan 12, 2015 at 10:56 AM, Hafiz Mujadid wrote: > Hi experts! > > > I have a schemaRDD of messages to be pushed in kafka. So I am using > following piece of code to do

Re: creating a single kafka producer object for all partitions

2015-01-12 Thread kevinkim
Well, you can use coalesce() to decrease number of partition to 1. (It will take time and quite not efficient, tough) Regards, Kevin. On Mon Jan 12 2015 at 7:57:39 PM Hafiz Mujadid [via Apache Spark User List] wrote: > Hi experts! > > > I have a schemaRDD of messages to be pushed in kafka. So I