Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/algorithm/10.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Apache spark Kafka直接API批输入大小_Apache Spark_Spark Streaming_Kafka Consumer Api_Kafka Directconsumer - Fatal编程技术网

Apache spark Kafka直接API批输入大小

Apache spark Kafka直接API批输入大小,apache-spark,spark-streaming,kafka-consumer-api,kafka-directconsumer,Apache Spark,Spark Streaming,Kafka Consumer Api,Kafka Directconsumer,根据Kafka Direct API,输入记录的数量计算如下 maxInputSize = maxRatePerPartition * #numOfPartitions# * #BATCH_DURATION_SECONDS# 我真的不明白为什么输入大小是这样确定的。假设我的作业在5分钟内处理100个文件 如果我设置maxRatePerPartition=1,主题中的numOfPartitions为6,那么批处理持续时间应该是多少,因为如果我将批处理持续时间秒设置为300,我将获取1800个文件

根据Kafka Direct API,输入记录的数量计算如下

maxInputSize = maxRatePerPartition * #numOfPartitions# * #BATCH_DURATION_SECONDS#
我真的不明白为什么输入大小是这样确定的。假设我的作业在5分钟内处理100个文件

如果我设置maxRatePerPartition=1,主题中的numOfPartitions为6,那么批处理持续时间应该是多少,因为如果我将批处理持续时间秒设置为300,我将获取1800个文件作为输入,将有一长串的批处理等待处理,1800个文件将需要大约半小时来处理,内存问题和其他限制除外

我如何处理这个问题。我应该能够控制输入中的记录。我可以在5分钟内处理10条记录,我应该只能加载这些记录