Github user tdas commented on a diff in the pull request:

    https://github.com/apache/spark/pull/2991#discussion_r20196611
  
    --- Diff: 
external/kafka/src/main/scala/org/apache/spark/streaming/kafka/KafkaInputDStream.scala
 ---
    @@ -53,112 +46,17 @@ class KafkaInputDStream[
         @transient ssc_ : StreamingContext,
         kafkaParams: Map[String, String],
         topics: Map[String, Int],
    +    reliableReceiveEnabled: Boolean,
         storageLevel: StorageLevel
       ) extends ReceiverInputDStream[(K, V)](ssc_) with Logging {
     
       def getReceiver(): Receiver[(K, V)] = {
    -    new KafkaReceiver[K, V, U, T](kafkaParams, topics, storageLevel)
    +    if (!reliableReceiveEnabled) {
    +      new KafkaReceiver[K, V, U, T](kafkaParams, topics, storageLevel)
    +        .asInstanceOf[Receiver[(K, V)]]
    +    } else {
    +      new ReliableKafkaReceiver[K, V, U, T](kafkaParams, topics, 
storageLevel)
             .asInstanceOf[Receiver[(K, V)]]
    --- End diff --
    
    If you make the ReliableKafkaReceiver extend Receiver[(K, V)], then this 
`asInstanceOf` is not necessary.


---
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]

Reply via email to