[
https://issues.apache.org/jira/browse/HDFS-8982?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14717680#comment-14717680
]
Zhe Zhang commented on HDFS-8982:
---------------------------------
For example, this section in {{FSEditLogLoader}} is using the two methods
inconsistently.
{code}
if (!op.shouldCompleteLastBlock()) {
// TODO: shouldn't this only be true for the last block?
// what about an old-version fsync() where fsync isn't called
// until several blocks in?
newBI = new BlockInfoContiguous(newBlock,
file.getPreferredBlockReplication());
newBI.convertToBlockUnderConstruction(
HdfsServerConstants.BlockUCState.UNDER_CONSTRUCTION, null);
} else {
// OP_CLOSE should add finalized blocks. This code path
// is only executed when loading edits written by prior
// versions of Hadoop. Current versions always log
// OP_ADD operations as each block is allocated.
newBI = new BlockInfoContiguous(newBlock,
file.getFileReplication());
}
{code}
[~wheat9] Why did HDFS-8823 change {{getPreferredBlockReplication}} to
{{getFileReplication}} in the else statement?
> Consolidate getFileReplication and getPreferredBlockReplication in INodeFile
> ----------------------------------------------------------------------------
>
> Key: HDFS-8982
> URL: https://issues.apache.org/jira/browse/HDFS-8982
> Project: Hadoop HDFS
> Issue Type: Improvement
> Components: namenode
> Affects Versions: 2.7.1
> Reporter: Zhe Zhang
>
> Currently {{INodeFile}} provides both {{getFileReplication}} and
> {{getPreferredBlockReplication}} interfaces. At the very least they should be
> renamed (e.g. {{getCurrentFileReplication}} and
> {{getMaxConfiguredFileReplication}}), with clearer Javadoc.
> I also suspect we are not using them correctly in all places right now.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)