who is responsible for dividing data into Block size (128MB).Where this process occurs .


1 Answer(s)


Hi Rakesh,

Neither Namenode nor Datanode divide the file, it is done by client(HDFS). Let's understand step by step-

1) When the file gets created on HDFS, the client specifies the block file for this file.
2) The client asks the namenode on which datanode(s) the first block should be stored.
3) The client starts the transmission of the data to the datanode(s).
4) As soon the client has transferred enough data to fill up the first block, the client asks the namenode where to store the next block.
5) step 3 and 4 are repeated until the client has transferred the whole file content.

For more information, check the link below and search for "Persistence of the File System MetaData:

https://hadoop.apache.org/docs/r1.2.1/hdfs_design.html#Data+Organization

Hope this helps.

Thanks.