[
https://issues.apache.org/jira/browse/HDFS-7610?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14284413#comment-14284413
]
Colin Patrick McCabe commented on HDFS-7610:
--------------------------------------------
{code}
+ try {
+ volumeSet.add(sl.getFile().getCanonicalFile());
+ } catch (IOException e) {
+ // Thrown because File#getCanoicalFile(). Ignored.
+ }
{code}
We can't ignore exceptions like this. Anyway, I don't think we need the
"canonical" filename anyway. If someone is playing games with symlinks, that's
their own problem, not ours. Just get the absolute pathname, an operation that
can't fail.
{code}
- Set<String> expectedVolumes = new HashSet<String>();
+ Set<String> expectedVolumes = new HashSet<>();
{code}
Changes like this are just churn that makes it harder to read the diff, so
let's not
thanks
> Should use StorageDirectory.getCurrentDIr() to construct FsVolumeImpl
> ---------------------------------------------------------------------
>
> Key: HDFS-7610
> URL: https://issues.apache.org/jira/browse/HDFS-7610
> Project: Hadoop HDFS
> Issue Type: Bug
> Components: datanode
> Affects Versions: 2.6.0
> Reporter: Lei (Eddy) Xu
> Assignee: Lei (Eddy) Xu
> Attachments: HDFS-7610.000.patch
>
>
> In the hot swap feature, {{FsDatasetImpl#addVolume}} uses the base volume dir
> (e.g. "{{/foo/data0}}", instead of volume's current dir
> "{{/foo/data/current}}" to construct {{FsVolumeImpl}}. As a result, DataNode
> can not remove this newly added volume, because its
> {{FsVolumeImpl#getBasePath}} returns "{{/foo}}".
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)