論述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




發佈了391 篇原創文章 · 獲贊 11 · 訪問量 39萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章