简体   繁体   English

如何在一个微批量的 Spark 结构化流中设置批量大小

[英]How to set batch size in one micro-batch of spark structured streaming

I am reading streaming data from Kafka source, but all the data from kafka is read in a single micro batch.我正在从 Kafka 源读取流数据,但是来自 kafka 的所有数据都是在一个微批处理中读取的。

spark.readStream.format("kafka").option("kafka.bootstrap.servers",bootstrap_servers).option("subscribe", topics).option("startingOffsets", "earliest").load()

Which parameter or option is used to set max batch size in one micro-batch of spark structured streaming?哪个参数或选项用于在一个微批次的 spark 结构化流中设置最大批量大小?

use maxOffsetsPerTrigger to limit the no of messages.使用maxOffsetsPerTrigger来限制消息的数量。

as per spark doc "maxOffsetsPerTrigger - Rate limit on maximum number of offsets processed per trigger interval. The specified total number of offsets will be proportionally split across topicPartitions of different volume."根据 spark doc “maxOffsetsPerTrigger - 每个触发间隔处理的最大偏移数的速率限制。指定的偏移总数将按比例分配到不同卷的 topicPartitions。”

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Spark Streaming 和 Spark Structured Streaming 使用相同的微批处理引擎吗? - Do Spark Streaming and Spark Structured Streaming use same micro-batch engine? Structured Streaming 是如何为每个微批次规划流式查询的逻辑计划的? - How does Structured Streaming plan logical plan of streaming query for every micro-batch? 如何在一个微批处理中设置最大行数? - How to set maximum number of rows in one micro-batch? 在Spark Streaming中的微批量结束之前执行操作 - Perform actions before end of the micro-batch in Spark Streaming Spark流中的每个微批处理后调用Java函数 - Invoking a java function after each micro-batch in Spark streaming 控制微型批次的结构化火花流 - Control micro batch of Structured Spark Streaming 在Spark流微批处理结束时是否持久化了内存持久的RDD? - Are memory-persisted RDD unpersisted at the end of a Spark streaming micro-batch? 在当前微批处理期间,Spark 流式接收器是否继续为每个块间隔提取数据 - Does Spark streaming receivers continue pulling data for every block interval during the current micro-batch 为什么围绕 Spark Streaming 微批处理(使用 kafka 作为源)受到如此多的批评? - Why so much criticism around Spark Streaming micro-batch (when using kafka as source)? Spark结构化流式批处理 - Spark Structured Streaming Batch
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM