[
https://issues.apache.org/jira/browse/HDFS-9850?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15517539#comment-15517539
]
Lei (Eddy) Xu commented on HDFS-9850:
-------------------------------------
Hi, [~manojg] Thanks for working on this issue.
{code}
public FsVolumeReference getFsVolumeReference(String volUuid) {
for (FsVolumeImpl fsVolume : volumes.getVolumes()) {
if (fsVolume.getStorageID().equals(volUuid)) {
try {
return fsVolume.obtainReference();
} catch (ClosedChannelException e) {
LOG.warn("Unable to get a reference for the Volume: " + volUuid, e);
}
}
}
return null;
}
{code}
I think it'd be better to throw {{CloseChannelException}} instead of
swallowing it. This function has two expected errors: 1) the volume with the
given {{volUuid}} does not exist, which should return {{null}}. or 2) the
volume exists, but be closed already. In this case, it is better to throw the
exception. Similarly, {{FsDatasetSpi#getFsVolumeReference}} should throw
{{CCE}} as well.
* In {{testDiskBalancerWhenRemovingVolumes()}}, do you need to start
{{MiniDFSCluster}} by calling {{waitActive}}?
* In {{DiskBalancer#copyBLocks}}. I think you need to hold {{volume reference}}
when you do the block movement.
Thanks.
> DiskBalancer : Explore removing references to FsVolumeSpi
> ----------------------------------------------------------
>
> Key: HDFS-9850
> URL: https://issues.apache.org/jira/browse/HDFS-9850
> Project: Hadoop HDFS
> Issue Type: Sub-task
> Components: balancer & mover
> Affects Versions: 3.0.0-alpha2
> Reporter: Anu Engineer
> Assignee: Manoj Govindassamy
> Attachments: HDFS-9850.001.patch
>
>
> In HDFS-9671, [~arpitagarwal] commented that we should explore the
> possibility of removing references to FsVolumeSpi at any point and only deal
> with storage ID. We are not sure if this is possible, this JIRA is to explore
> if that can be done without issues.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]