[
https://issues.apache.org/jira/browse/HDFS-8655?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14600199#comment-14600199
]
Jing Zhao commented on HDFS-8655:
---------------------------------
Thanks for working on this, Zhe. One thing I agree with [~wheat9] is that
changes like this rename makes sense only in EC branch with other changes.
Considering this change is small (not like the BlockInfo/BlockInfoContiguous
changes before), we can leave it in the EC branch I guess.
Some other minors comments about the patch:
# Let's also verify if blks is null or empty in the following code.
{code}
void concatBlocks(INodeFile[] inodes) {
- int size = this.blocks.length;
+ BlockInfo[] blks = getBlocks();
+ int size = blks.length;
int totalAddedBlocks = 0;
for(INodeFile f : inodes) {
- totalAddedBlocks += f.blocks.length;
+ totalAddedBlocks += f.getBlocks().length;
}
{code}
# We can also add check for null block array when we use it for
{{System.arraycopy}}.
> Refactor accesses to INodeFile#blocks
> -------------------------------------
>
> Key: HDFS-8655
> URL: https://issues.apache.org/jira/browse/HDFS-8655
> Project: Hadoop HDFS
> Issue Type: Improvement
> Components: namenode
> Affects Versions: 2.7.0
> Reporter: Zhe Zhang
> Assignee: Zhe Zhang
> Attachments: HDFS-8655.00.patch
>
>
> When enabling INodeFile support for striped blocks (mainly in HDFS-7749),
> HDFS-7285 branch generalized the concept of blocks under an inode. Now
> {{INodeFile#blocks}} only contains contiguous blocks of an inode. This JIRA
> separates out code refactors for this purpose. Two main changes:
> # Rename {{setBlocks}} to {{setContiguousBlocks}}
> # Replace direct accesses to {{INodeFile#blocks}} to {{getBlocks}}
> It also contains some code cleanups introduced in the branch.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)