[
https://issues.apache.org/jira/browse/HDFS-9251?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14961607#comment-14961607
]
Colin Patrick McCabe commented on HDFS-9251:
--------------------------------------------
Thanks, [~eddyxu].
{code}
222 Preconditions.checkArgument(volume instanceof FsVolumeImpl);
{code}
We should not have these lines. The test is {{FsDatasetImplTestUtils.java}},
so we know that the volume must be an instance of {{FsVolumeImpl}}. The only
way it could not be is if there was a bug, which we don't want to hide.
Looks good aside from that.
> Refactor TestWriteToReplica and TestFsDatasetImpl to avoid explicitly
> creating Files in tests code.
> ---------------------------------------------------------------------------------------------------
>
> Key: HDFS-9251
> URL: https://issues.apache.org/jira/browse/HDFS-9251
> Project: Hadoop HDFS
> Issue Type: Improvement
> Components: HDFS
> Affects Versions: 2.7.1
> Reporter: Lei (Eddy) Xu
> Assignee: Lei (Eddy) Xu
> Attachments: HDFS-9251.00.patch, HDFS-9251.01.patch
>
>
> In {{TestWriteToReplica}} and {{TestFsDatasetImpl}}, tests directly creates
> block and metadata files:
> {code}
> replicaInfo.getBlockFile().createNewFile();
> replicaInfo.getMetaFile().createNewFile();
> {code}
> It leaks the implementation details of {{FsDatasetImpl}}. This JIRA proposes
> to use {{FsDatasetImplTestUtils}} (HDFS-9188) to create replicas.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)