Skip to content

Commit

Permalink
Clarify how to create map of topics
Browse files Browse the repository at this point in the history
  • Loading branch information
miguno committed Sep 29, 2014
1 parent 3f476ae commit 09cca52
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -170,12 +170,11 @@ class KafkaSparkStreamingSpec extends FeatureSpec with Matchers with BeforeAndAf
//
// And yes, the way we do this looks quite strange -- we combine a hardcoded `1` in the topic map with a
// subsequent `(1..N)` construct. But this approach is the recommended way.
val topics = Map(inputTopic.name -> 1)
val streams = (1 to inputTopic.partitions) map { _ =>
KafkaUtils.createStream[Array[Byte], Array[Byte], DefaultDecoder, DefaultDecoder](
ssc,
kafkaParams,
topics,
Map(inputTopic.name -> 1),
storageLevel = StorageLevel.MEMORY_ONLY_SER // or: StorageLevel.MEMORY_AND_DISK_SER
).map(_._2)
}
Expand Down

0 comments on commit 09cca52

Please sign in to comment.