【发布时间】:2021-04-01 17:39:33
【问题描述】:
我是 Spark Streaming 的新手。我有一些基本的疑问..有人可以帮我澄清一下吗:
-
我的消息大小是标准的。每条消息1Kb。
-
Topic 分区数为 30,使用 dstream 方式消费来自 kafka 的消息。
-
spark 作业的核心数为:
(spark.max.cores=6| spark.executor.cores=2)
-
据我了解,Kafka 分区数=RDD 分区数:
In this case dstream approach: dstream.forEachRdd(rdd->{ rdd.forEachPartition{ } **Question**:This loop forEachPartiton will execute 30 times??As there are 30 Kafka partitions}
-
另外由于我给了6核,从kafka会并行消耗多少个分区
问题:一次是6个分区吗 或
30/6 = 一次 5 个分区? 有人可以详细说明这在 dstream 方法中是如何工作的吗?
【问题讨论】:
标签: scala apache-spark apache-kafka spark-streaming spark-kafka-integration