我想集成Apache Kafka和Spark Streaming,我正在使用spark-streaming-kafka-0-8_2.11,我发现下面显示了此函数,但是Kafka中的值类型是字节数组。如何使用此功能从Kafka获取字节数组?
import org.apache.spark.streaming.kafka.*;
JavaPairInputDStream<String, String> directKafkaStream =
KafkaUtils.createDirectStream(streamingContext,
[key class], [value class], [key decoder class], [value decoder class],
[map of Kafka parameters], [set of topics to consume]);