论述flume中batchSize,capacity,transactionCapacity参数之间的关系
论述flume中batchSize,capacity,transactionCapacity参数之间的关系
举例:
a1.sources = r1
a1.sinks = k1
a1.channels = c1
##source
a1.sources.r1.type = exec
a1.sources.r1.command = tail -f /home/hadoop/test.txt
#sink
a1.sinks.k1.type = hdfs
a1.sinks.k1.hdfs.path=hdfs://192.168.156.65:9000/flume/events
a1.sinks.k1.hdfs.filePrefix=events
a1.sinks.k1.hdfs.rollInterval=30
a1.sinks.k1.hdfs.rollSize=33554432
a1.sinks.k1.hdfs.rollCount=0
a1.sinks.k1.hdfs.batchSize=3000 ##number of events written to file before it is flushed to HDFS,batchsize <=transactionCapacity<=capacity
a1.sinks.k1.hdfs.codeC=gzip
a1.sinks.k1.hdfs.fileType=CompressedStream
#channel
a1.channels.c1.type = memory
a1.channels.c1.capacity=1000000 #The maximum number of events stored in the channel
a1.channels.c1.transactionCapacity=5000 #The maximum number of events the channel will take from a source or give to a sink per transaction
###bind the source and sink to the channel
a1.sources.r1.channels=c1
a1.sinks.k1.channel=c1
a1.sinks.k1.hdfs.batchSize 官方解释:
##number of events written to file before it is flushed to HDFS
a1.channels.c1.capacity 官方解释 :
#The maximum number of events stored in the channel
a1.channels.c1.transactionCapacity 官方解释 :
#The maximum number of events the channel will take from a source or give to a sink per transaction
这三者之间的关系:
,batchsize <=transactionCapacity<=capacity
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· Manus的开源复刻OpenManus初探
· 写一个简单的SQL生成工具
· AI 智能体引爆开源社区「GitHub 热点速览」
· C#/.NET/.NET Core技术前沿周刊 | 第 29 期(2025年3.1-3.9)
2016-03-31 Visual Studio的调试技巧