FileInputFormat及其拆分

时间:2016-04-14 16:35:58

标签: hadoop mapreduce

我正在使用具有hadoop 1.x的群集。默认块大小为64MB

在Mapreduce中,FileInputFormat为文件或块创建拆分?

情景1:

假设有一个hdfs目录,在该目录中我加载了两个文件。

/user/cloudera/inputfiles

  words1.txt
  words2.txt

words1.txt的大小为64 MB,words2.txt的大小为70 MB

我使用TextInputFormat作为InputFormat。

现在FileInputFormat创建了多少个拆分?

3 splits are formed because there are going to be 3 blocks

2 splits are formed because there are 2 files.

从以上两个陈述中哪一个是正确的?

情景2:

如果words1.txt的大小为1 mb,且words2.txt的大小为1 mb,那么FileInputFormat会创建多少个拆分?

0 个答案:

没有答案
相关问题