Github user lw-lin commented on a diff in the pull request: https://github.com/apache/spark/pull/15681#discussion_r85640467 --- Diff: external/kafka-0-10/src/main/scala/org/apache/spark/streaming/kafka010/KafkaUtils.scala --- @@ -56,32 +57,18 @@ object KafkaUtils extends Logging { @Experimental def createRDD[K, V]( sc: SparkContext, - kafkaParams: ju.Map[String, Object], + kafkaParams: collection.Map[String, Object], offsetRanges: Array[OffsetRange], locationStrategy: LocationStrategy ): RDD[ConsumerRecord[K, V]] = { - val preferredHosts = locationStrategy match { - case PreferBrokers => - throw new AssertionError( - "If you want to prefer brokers, you must provide a mapping using PreferFixed " + - "A single KafkaRDD does not have a driver consumer and cannot look up brokers for you.") - case PreferConsistent => ju.Collections.emptyMap[TopicPartition, String]() - case PreferFixed(hostMap) => hostMap - } - val kp = new ju.HashMap[String, Object](kafkaParams) - fixKafkaParams(kp) - val osr = offsetRanges.clone() - - new KafkaRDD[K, V](sc, kp, osr, preferredHosts, true) --- End diff -- all is exacted into a `private createRDDInternal()` method untouched
--- 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 infrastruct...@apache.org or file a JIRA ticket with INFRA. --- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org