Github user koeninger commented on the pull request:
https://github.com/apache/spark/pull/8133#issuecomment-131859733
KafkaRDD attempts to instantiate the value decoder right before connecting
the consumer:
val valueDecoder = classTag[T].runtimeClass.getConstructor(classOf[
VerifiableProperties])
.newInstance(kc.config.props)
.asInstanceOf[Decoder[V]]
val consumer = connectLeader
Something's wrong with your SwipeDecoder
On Mon, Aug 17, 2015 at 3:16 AM, Shyam S Kumar <[email protected]>
wrote:
> I get the same NPE issue in Spark 1.4.1 also. I'm not sure what's wrong
> (yet) as my spark streaming job was running fine printing out Array[Byte]
> data, but after I added a custom decoder (Avro to my class Swipe) it
> keeps spitting the NPE error (consumer is null). Any hints on what could
> be the root cause?
>
> val swipes = KafkaUtils.createDirectStream[Array[Byte], Array[Byte],
> DefaultDecoder, DefaultDecoder](ssc, kafkaParams, topics) works, but
> val swipes = KafkaUtils.createDirectStream[Array[Byte], Swipe,
> DefaultDecoder, SwipeDecoder](ssc, kafkaParams, topics) doesn't. In that
> aspect the NPE is sorta misleading (maybe).
>
> â
> Reply to this email directly or view it on GitHub
> <https://github.com/apache/spark/pull/8133#issuecomment-131740417>.
>
---
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]