sources study-part 2-hdfs get file

as writing a file to hdfs,the client get a DistributedSystem to communicate with Namenode.and the DS will create a DFSClient to create DFSInputstream which is encasluted to FSDataInputStream.

 

off course ,the input stream get a LocatedBlock which contains 10 blocks and theirs address by default a time through  communcating with NN.and each block has a datanodes arry of prioritied(optimized by distance) locations,like this :

[local node,local rack node, others ]

 

the blocks whick saved in DNs are the raw blocks which transformed by client for writing files.so the input stream will truncat e the extra info from chunk,e.g. checksum value,block head info etc.

 

你可能感兴趣的:(rack)