前面2个描述了datanode以及INodeFile,还缺个Block的描述,这里补上,针对block的结构还有些不是特别明确,这个需要举例子才好说明,先把大体的类图结构描述下
Block
- /**************************************************
- * A Block is a Hadoop FS primitive, identified by a
- * long.
- *
- **************************************************/
BlocksMap
- /**
- * This class maintains the map from a block to its metadata.
- * block's metadata currently includes INode it belongs to and
- * the datanodes that store the block.
- */
BlockInfo
- /**
- * Internal class for block metadata.
- */
Object[] triplets
- /**
- * This array contains triplets of references.
- * For each i-th data-node the block belongs to
- * triplets[3*i] is the reference to the DatanodeDescriptor
- * and triplets[3*i+1] and triplets[3*i+2] are references
- * to the previous and the next blocks, respectively, in the
- * list of blocks belonging to this data-node.
- */
更多信息请查看 java进阶网 http://www.javady.com