GitHub user jerryshao opened a pull request:
https://github.com/apache/spark/pull/7410
[SPARK-8337][Streaming][Pyspark] Add MessageHandler for Kafka Python API
Propose a way to add messageHandler for Kafka Python API, offer user a
similar pattern to use message like Scala/Java:
```python
def getOffset(m):
return m and m.offset
KafkaUtils.createDirectStream(ssc, topic, kafkaParams,
messageHandler=getOffset)
```
Internally serialize the Kafka `MessageAndMetadata` to Python using Pickler.
Please help to review, thanks a lot.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/jerryshao/apache-spark SPARK-8337
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/spark/pull/7410.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 #7410
----
commit 798b047c9fd7c5fe474aa9d21745a43dbd3316e0
Author: jerryshao <[email protected]>
Date: 2015-07-15T02:48:06Z
Add MessageHandler for Kafka Python API
----
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]