以下示例在Hadoop中创建了多少个块? [英] how many blocks are made in Hadoop for the following example?

查看:173
本文介绍了以下示例在Hadoop中创建了多少个块?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

假设我的HDFS块大小为64 MB。

我有4个文件:

文件A: 64MB * 3 + 2MB;

文件B:62 MB;

文件应该有4个块每个包含64 MB和一个包含2 MB的文件。

文件B应该有一个62 MB的块。



所以总共应该有6个块



仅仅因为在存储仅2 MB的文件A的一个块中存在空闲空间,
文件B不会附加到同一个块。是否正确?



我看过一些教程,他们说块中的空闲空间被利用。

解决方案

正确的话,会有6个方块。所有这一切都意味着2MB的数据块仅在物理上占据了2MB的数据节点的硬盘空间,而不是一个完整的块大小,这将浪费空间。

Assume my HDFS block size is 64 MB.

I have 4 files:

File A: 64MB * 3 + 2 MB;

File B: 62 MB;

There should be 4 blocks for File A each with 64 MB and one with 2 MB.

There should be one block for File B with 62 MB.

So in total there should be 6 blocks

Just because there is "free" space in the one of the blocks of File A which stores only 2 MB, file B does NOT get appended to same block. Is it correct?

I have seen some tutorials where they say the "free" space in the block is utilized.

解决方案

Correct, there will be 6 blocks. All this means is that a 2MB block only physically takes up 2MB on the datanode's hard disk and not a full block size which would be a waste of space.

这篇关于以下示例在Hadoop中创建了多少个块?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆