gpt4 book ai didi

hadoop - 区 block 大小效果Hadoop

转载 作者:行者123 更新时间:2023-12-02 20:58:19 26 4
gpt4 key购买 nike

iam正在hadoop apache 2.7.1上工作

和iam添加大小不超过100 Kb的文件

所以如果我将块大小配置为1 mb或默认值是
128兆字节

不会影响我的文件,因为它们只会保存在一个块中

当我们下载文件时,将检索一个块

但是块存储大小会有什么不同
我的意思是当文件小于1 mb时,以1 mb的块大小存储文件不同于以128 mb的块大小存储文件

我的意思是,当将1 mb的文件存储在大小为128 m的块中时,它将保留整个块,并且该块将不用于其他文件,或者将空的空间用于具有指针引用的其他文件在块中归档开始位置

我发现上传和下载时间没有区别
还有其他我要考虑的问题吗

最佳答案

我将为此引用我编写的(现已停产的)SO文档,因为为什么不这样做。

Say for example you have a file of size 1024 MBs. if your block size is 128 MB, you will get 8 blocks of 128MB each. This means that your namenode will need to store metadata of 8 x 3 = 24 files (3 being the replication factor).

Consider the same scenario with a block size of 4 KBs. It will result in 1GB / 4KB = 250000 blocks and that will require the namenode to save the metadata for 750000 blocks for just a 1GB file. Since all these metadata related information is stored in-memory, larger block size is preferred to save that bit of extra load on the NameNode.

关于hadoop - 区 block 大小效果Hadoop,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43892234/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com