Are multiple files stored in a single block?

前端 未结 4 986
轻奢々
轻奢々 2020-12-28 11:27

When I store many small files into HDFS, will they get stored in a single block?

In my opinion, these small files should get stored into a single block according to

4条回答
  •  渐次进展
    2020-12-28 11:41

    Below is what specified in Hadoop Definitive Guide:

    Unlike a filesystem for a single disk, a file in HDFS that is smaller than a single block does not occupy a full block’s worth of underlying storage

    For example, if you have 30 MB file and your block size is of 64 MB, then this file will get stored in one block logically, but in the physical file system, HDFS uses only 30 MB to store the file. The remaining 30 MB will be free to use.

提交回复
热议问题