CombineFileInputFormat

CombineFileInputFormat

我正在尝试编写一个Map Reduce程序,为此,我要输入大约1000个小文件(每个文件的大小为几MB)。据我了解,这将导致大约1000个映射器任务被创建(HDFS块大小默认为64MB)。因此,在这种情况下,使用CombineFileInputFormat比TextInputFormat更有效。我对么?

如果是这样,如何在我的程序中使用CombineFileInputFormat?

最佳答案

Hadoop API尚未提供CombineFileInputFormat的完全具体的实现。
我自己实现了一些。看看:https://github.com/thomachan/Custom-MR/tree/master/src/mapreduce/hi/api/input/defaultcustom

09-11 02:49