You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-issues@hadoop.apache.org by "Manoj Govindassamy (JIRA)" <ji...@apache.org> on 2016/10/13 22:04:21 UTC
[jira] [Updated] (HADOOP-13721) Remove stale method
ViewFileSystem#getTrashCanLocation
[ https://issues.apache.org/jira/browse/HADOOP-13721?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Manoj Govindassamy updated HADOOP-13721:
----------------------------------------
Attachment: HADOOP-13721.01.patch
* {{expunge}} command relies on {{fs.trash.classname}} property or the default impl {{TrashPolicyDefault}}. The default Trash policy relies on {{FileSystem#getTrashRoot}} to get the trash directory.
* Currently I couldn't find any users for {{ViewFileSystem#getTrashCanLocation}}. Also the implementation is wrong, which return the home directory for the trash can.
So, inclined to remove this method {{ViewFileSystem#getTrashCanLocation}} for good.
[~andrew.wang] can you please let me know if I am overlooking something very obvious here.
> Remove stale method ViewFileSystem#getTrashCanLocation
> ------------------------------------------------------
>
> Key: HADOOP-13721
> URL: https://issues.apache.org/jira/browse/HADOOP-13721
> Project: Hadoop Common
> Issue Type: Bug
> Affects Versions: 3.0.0-alpha2
> Reporter: Manoj Govindassamy
> Assignee: Manoj Govindassamy
> Priority: Minor
> Attachments: HADOOP-13721.01.patch
>
>
> {{ViewFileSystem}} which extends {{FileSystem}} has a public method {{getTrashCanLocation}} which is neither overridden nor used by anybody. Looks like it existed when the file was created, and also I see the implementation returning homeDirectory which might not be the expected one in cases of {{expunge}}. So, inclined to remove this stale and potentially dangerous method unless anyone has any concerns.
> {code}
> public Path getTrashCanLocation(final Path f) throws FileNotFoundException {
> final InodeTree.ResolveResult<FileSystem> res =
> fsState.resolve(getUriPath(f), true);
> return res.isInternalDir() ? null : res.targetFileSystem.getHomeDirectory();
> }
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-issues-help@hadoop.apache.org