apache-spark - Spark 结构化流 - 限制? (源性能、不支持的操作、Spark UI)

标签 apache-spark apache-kafka spark-structured-streaming

我已经开始探索 Spark Structured Streaming 来编写一些一直在使用的应用程序 DStreams在这之前。

我正在尝试了解 Structured Streaming 的局限性,因为我已经开始使用它,但想知道它的缺点(如果有的话)。

一季度。对于结构化流应用程序中的每个接收器,它将独立地从源(例如 Kafka)读取。这意味着如果你从一个主题 A 中读取,并写入 3 个地方(例如 ES、Kafka、S3),它实际上会设置 3 source connections independent of each other .

这会导致性能下降吗?因为它将需要管理 3 个独立的连接而不是一个(DStream 方法)

Q2。我知道加入 2 个流数据集是 unsupported .如何对 2 个流执行计算?

如果我有来自主题 A 的数据和来自主题 B 的其他数据,是否可以以某种方式对这两个数据进行计算?

Q3。在 Spark Streaming UI 中,有一个用于度量和查看应用程序吞吐量的 Streaming 选项卡。在结构化流中,这不再可用。

为什么是这样?是否打算以编程方式获取所有指标并推送到单独的监控服务?

最佳答案

For each sink in the structured streaming app, it will independently read from a source (eg. Kafka). Meaning if you read from one topic A, and write to 3 places (e.g. ES, Kafka, S3) it will actually set up 3 source connections independent of each other.



开箱即用,是的。每个 Sink 描述不同的执行流程。但是,您可以通过不使用内置接收器并创建自己的自定义接收器来解决此问题,该接收器控制您如何进行写入。

Will this be a performance degradation? As it will require 3 independent connections managed instead of one (DStream approach)



大概。您通常不想一遍又一遍地读取和处理相同的内容,因为您有多个 Sink 用于同一个源。同样,您可以通过构建自己的 Sink 来适应这一点(这应该不会有太多工作)

Q2. I know that joining 2 streaming data sets is unsupported. How can I perform calculations on 2 streams?



As of Spark 2.3, this is supported OOTB.

Q3. In Spark Streaming UI, there is a Streaming tab for metrics and to view the throughput of the application. In Structured Streaming this is not available anymore. Why is this? Is the intention to obtain all metrics programmatically and push to a separate monitoring service?



你是对的。您在 Structured Streaming 中拥有的精美 UI(尚)在 Spark 中不存在。我问过 Michael Armburst 这个问题,他的回答是“优先事项”,他们根本没有时间投入工作来创造像 Spark Streaming 那样奇特的东西,因为他们想挤进更多的功能。 OSS 是您可以随时自行贡献缺失的部分。

总而言之,Structured Streaming 是 Spark 的 future 。没有更多的工作投入到 DStreams 中。对于高吞吐量系统,我可以说加入结构化流媒体潮流有很大的好处。我已经在 2.1 发布后切换了它,这绝对是一个性能提升,尤其是在有状态的流管道领域。

关于apache-spark - Spark 结构化流 - 限制? (源性能、不支持的操作、Spark UI),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50483121/

相关文章:

hadoop - 如何处理(遍历)hadoop/Spark 集群上的大型 JSON 文件?

hadoop - 从 kafka Spark 流接收时获取空值

java - Flink 将 csv 文件映射到元组中

java - 如何将模式转换为Java结构化流中的列?

r - 无法在 dplyr.spark.hive 包中创建由 SparkSQL 支持的 dplyr src

python - 更改 Spark Web UI 的根路径?

linux - 必须设置环境变量 AWS_ACCESS_KEY_ID

apache-kafka - Storm : KafkaSpout - where is my consumer group?

apache-spark - 如何从套接字读取流数据集?

apache-spark - 如何在awaitTermination后获取流查询的进度?