[ https://issues.apache.org/jira/browse/HDFS-6482?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14019111#comment-14019111 ]
Colin Patrick McCabe commented on HDFS-6482: -------------------------------------------- bq. * @param genStamp generation stamp of the blockFile dir = Looks like a bad search-and-replace. bq. public static File getDirectoryNoCreate(File root, long blockId) { Maybe rather than having an {{IdBasedBlockDirectory}} class, we should just put a static method like {{idToBlockDir}} inside {{DatanodeUtil}}, that simply returns a {{File}}. Code that wants to call {{mkdir}} can always do it on its own (with appropriate try/catch blocks.) I don't see a lot of value in having a separate class, since the only interesting thing there is the {{File}} contained inside. I also don't like the side effect in the constructor. I guess we've done that kind of thing in the past. But usually when we do that, there is a {{close}} method that undoes the side-effect. In this case it just feels kind of arbitrary... why should creating this object do a mkdir somewhere? You don't need the object to use the directory, and you don't need to keep the object around to keep the directory around. bq. "The block ID of a block uniquely determines its position in the " + "directory structure"); Should be "finalized block" Looks good aside from that. > Use block ID-based block layout on datanodes > -------------------------------------------- > > Key: HDFS-6482 > URL: https://issues.apache.org/jira/browse/HDFS-6482 > Project: Hadoop HDFS > Issue Type: Improvement > Components: datanode > Affects Versions: 2.5.0 > Reporter: James Thomas > Assignee: James Thomas > Attachments: HDFS-6482.1.patch, HDFS-6482.patch > > > Right now blocks are placed into directories that are split into many > subdirectories when capacity is reached. Instead we can use a block's ID to > determine the path it should go in. This eliminates the need for the LDir > data structure that facilitates the splitting of directories when they reach > capacity as well as fields in ReplicaInfo that keep track of a replica's > location. > An extension of the work in HDFS-3290. -- This message was sent by Atlassian JIRA (v6.2#6252)