You are viewing a plain text version of this content. The canonical link for it is here.
Posted to hdfs-issues@hadoop.apache.org by "Lei (Eddy) Xu (JIRA)" <ji...@apache.org> on 2015/04/17 03:35:59 UTC

[jira] [Updated] (HDFS-7758) Retire FsDatasetSpi#getVolumes() and use FsDatasetSpi#getVolumeRefs() instead

     [ https://issues.apache.org/jira/browse/HDFS-7758?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Lei (Eddy) Xu updated HDFS-7758:
--------------------------------
    Attachment: HDFS-7758.004.patch

Thanks a lot for detailed review, [~cmccabe].  Sorry for updating this late.

bq. Instead of ReferredFsVolumeList, how about calling the class FsVolumeRefs?

I changed it to {{ReferredFsVolumes}}. Because I'd like to give people an impression that this is a collection of {{FsVolume}}, as they can run:

{code}
for (FsVolumeSpi volume : referredVolumes)
// or
FsVolumeSpi volume = referredVolumes.get(123)
{code}

No internal {{FsVolumeReference}} is exposed through this class.

bq. This looks like a bugfix, separate from this code cleanup. 

Done

bq. What's the motivation for switching from an interface to an abstract class?

This was because I added {{FsVolumeReference#releaseVolumes()}}. Now I changed it back after this function is removed.

bq. Why do we need both ReferredFsVolumeListImpl and ReferredFsVolumeList?

Done. Only {{ReferredFsVolumes}} now.

Thanks again!

> Retire FsDatasetSpi#getVolumes() and use FsDatasetSpi#getVolumeRefs() instead
> -----------------------------------------------------------------------------
>
>                 Key: HDFS-7758
>                 URL: https://issues.apache.org/jira/browse/HDFS-7758
>             Project: Hadoop HDFS
>          Issue Type: Improvement
>          Components: datanode
>    Affects Versions: 2.6.0
>            Reporter: Lei (Eddy) Xu
>            Assignee: Lei (Eddy) Xu
>         Attachments: HDFS-7758.000.patch, HDFS-7758.001.patch, HDFS-7758.002.patch, HDFS-7758.003.patch, HDFS-7758.004.patch
>
>
> HDFS-7496 introduced reference-counting  the volume instances being used to prevent race condition when hot swapping a volume.
> However, {{FsDatasetSpi#getVolumes()}} can still leak the volume instance without increasing its reference count. In this JIRA, we retire the {{FsDatasetSpi#getVolumes()}} and propose {{FsDatasetSpi#getVolumeRefs()}} and etc. method to access {{FsVolume}}. Thus it makes sure that the consumer of {{FsVolume}} always has correct reference count.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)