GitHub user HyukjinKwon opened a pull request:
https://github.com/apache/spark/pull/14416
[SPARK-16776][STREAMING] Replace deprecated API in KafkaTestUtils for
0.10.0.
## What changes were proposed in this pull request?
This PR replaces the old Kafka API to 0.10.0 ones in `KafkaTestUtils`.
The change include:
- `Producer` to `KafkaProducer`
- Change configurations to equalvant ones. (I referred
[here](http://kafka.apache.org/documentation.html#producerconfigs) for 0.10.0
and [here](http://kafka.apache.org/082/documentation.html#producerconfigs
) for old, 0.8.2.
This PR will remove the build warning as below:
```scala
[WARNING]
.../spark/external/kafka-0-10/src/main/scala/org/apache/spark/streaming/kafka010/KafkaTestUtils.scala:71:
class Producer in package producer is deprecated: This class has been
deprecated and will be removed in a future release. Please use
org.apache.kafka.clients.producer.KafkaProducer instead.
[WARNING] private var producer: Producer[String, String] = _
[WARNING] ^
[WARNING]
.../spark/external/kafka-0-10/src/main/scala/org/apache/spark/streaming/kafka010/KafkaTestUtils.scala:181:
class Producer in package producer is deprecated: This class has been
deprecated and will be removed in a future release. Please use
org.apache.kafka.clients.producer.KafkaProducer instead.
[WARNING] producer = new Producer[String, String](new
ProducerConfig(producerConfiguration))
[WARNING] ^
[WARNING] .../spark/streaming/kafka010/KafkaTestUtils.scala:181: class
ProducerConfig in package producer is deprecated: This class has been
deprecated and will be removed in a future release. Please use
org.apache.kafka.clients.producer.ProducerConfig instead.
[WARNING] producer = new Producer[String, String](new
ProducerConfig(producerConfiguration))
[WARNING] ^
[WARNING]
.../spark/external/kafka-0-10/src/main/scala/org/apache/spark/streaming/kafka010/KafkaTestUtils.scala:182:
class KeyedMessage in package producer is deprecated: This class has been
deprecated and will be removed in a future release. Please use
org.apache.kafka.clients.producer.ProducerRecord instead.
[WARNING] producer.send(messages.map { new KeyedMessage[String,
String](topic, _ ) }: _*)
[WARNING] ^
[WARNING] four warnings found
[WARNING] warning: [options] bootstrap class path not set in conjunction
with -source 1.7
[WARNING] 1 warning
```
## How was this patch tested?
Existing tests that use `KafkaTestUtils` should cover this.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/HyukjinKwon/spark SPARK-16776
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/spark/pull/14416.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 #14416
----
commit bb9f635a556bc1ed2f9fd9593a5a3f2c6af62cf9
Author: hyukjinkwon <[email protected]>
Date: 2016-07-30T04:19:48Z
Remove deprecated API in KafkaTestUtils
----
---
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]