Hi community, I am trying to read HDFS 2.7.0 source code and notice that GSet is used a lot, in a way which I cannot understand. For example, as comments in BlocksMap class say,
/** * This class maintains the map from a block to its metadata. * block's metadata currently includes blockCollection it belongs to and * the datanodes that store the block. */ it maps Block to BlockInfoContiguous, which is a subclass of Block, my question is, why not just create a class that contains data in both Block and BlockInfoContiguous, so that we can access information of a block directly ? What is the reason for this? Thanks.