[ https://issues.apache.org/jira/browse/HDFS-8058?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Zhe Zhang updated HDFS-8058: ---------------------------- Attachment: HDFS-8058-HDFS-7285.003.patch Updated patch based on the original idea. In general, I think we should use the {{BlockInfo}} abstraction in most cases, and use specific subclasses when: # Creating new instances # Calling striping specific operations (e.g. {{getCellSize}}) and UC specific ones. To verify the properties of a {{BlockInfo}} instance we should use {{isXxx}} interfaces. This is perhaps the only way to address the multi-inheritance problem for {{BlockInfo}}. In the future we are likely to have more types of {{BlockInfo}} that we want to handle specially, like non-striping erasure-coded blocks (HDFS-8030), and the multi-inheritance relationship will be too complex to handle via subclassing. The patch also has 2 changes to ensure a file has all striped or all contiguous blocks: # {{isStriped}} checking in {{addBlock}} and {{concatBlocks}} # Removed public {{setBlocks}} and replaced with {{clearBlocks}} > Erasure coding: use BlockInfo[] for both striped and contiguous blocks in > INodeFile > ----------------------------------------------------------------------------------- > > Key: HDFS-8058 > URL: https://issues.apache.org/jira/browse/HDFS-8058 > Project: Hadoop HDFS > Issue Type: Sub-task > Affects Versions: HDFS-7285 > Reporter: Yi Liu > Assignee: Yi Liu > Attachments: HDFS-8058-HDFS-7285.003.patch, HDFS-8058.001.patch, > HDFS-8058.002.patch > > > This JIRA is to use {{BlockInfo[] blocks}} for both striped and contiguous > blocks in INodeFile. > Currently {{FileWithStripedBlocksFeature}} keeps separate list for striped > blocks, and the methods there duplicate with those in INodeFile, and current > code need to judge {{isStriped}} then do different things. Also if file is > striped, the {{blocks}} in INodeFile occupy a reference memory space. > These are not necessary, and we can use the same {{blocks}} to make code more > clear. > I keep {{FileWithStripedBlocksFeature}} as empty for follow use: I will file > a new JIRA to move {{dataBlockNum}} and {{parityBlockNum}} from > *BlockInfoStriped* to INodeFile, since ideally they are the same for all > striped blocks in a file, and store them in block will waste NN memory. -- This message was sent by Atlassian JIRA (v6.3.4#6332)