Flume-ng hdfs sink .tmp文件刷新率控制proprty

时间:2015-05-26 21:43:04

标签: cloudera flume hortonworks-data-platform flume-ng flume-twitter

我正在尝试每5分钟刷新一次.tmp文件,我的源代码很慢,我的hdfs接收器需要30分钟才能获得128MB文件。

在flume hdfs sink中是否有任何属性,我可以在文件转换为HDFS之前控制.tmp文件的刷新率。

我需要这个来使用.tmp文件中的hive表来查看HDFS中的数据。

目前我正在使用hive表查看.tmp文件中的数据,但由于卷大小为128MB,.tmp文件长时间不刷新。

1 个答案:

答案 0 :(得分:0)

考虑降低频道的容量和transactionCapacity设置:

capacity    100 The maximum number of events stored in the channel
transactionCapacity 100 The maximum number of events the channel will take from a source or give to a sink per transaction

这些设置负责控制在刷新到接收器之前假脱机的事件数。例如,如果将其降低到10,则每10个事件将刷新到您的tmp文件。

更改hdfs接收器中的batchSize所需的第二个值:

hdfs.batchSize  100 number of events written to file before it is flushed to HDFS

如果您的源非常慢并且您希望更频繁地查看事件,则默认值100可能会过高。

相关问题