[ 
https://issues.apache.org/jira/browse/HDFS-9799?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15151112#comment-15151112
 ] 

Andrew Wang commented on HDFS-9799:
-----------------------------------

The ideal way of doing partial results is something like Optional, though 
that's Java 8 and still won't work perfectly since if we fail to list, we won't 
know the number of homedirs/EZs. It's something we could consider for trunk, if 
we really care about it.

IMO the current idea is good. The most likely cause of IOExceptions is if 
something throws an AccessControlException if it's not being run as a 
superuser, and the logging should help with that.

One little nit though is that we aren't printing the exception in these logs, 
which would help with debugging:

{code}
LOG.warn("Cannot get all trash roots.");
...
DFSClient.LOG.warn("Cannot get all encrypted trash roots.");
{code}

Otherwise I'm +1, thanks Zhe.

> Reimplement getCurrentTrashDir to remove incompatibility
> --------------------------------------------------------
>
>                 Key: HDFS-9799
>                 URL: https://issues.apache.org/jira/browse/HDFS-9799
>             Project: Hadoop HDFS
>          Issue Type: Bug
>    Affects Versions: 2.8.0
>            Reporter: Zhe Zhang
>            Assignee: Zhe Zhang
>            Priority: Blocker
>         Attachments: HDFS-9799.00.patch, HDFS-9799.01.patch, 
> HDFS-9799.02.patch, HDFS-9799.03.patch, HDFS-9799.04.patch, HDFS-9799.05.patch
>
>
> HDFS-8831 changed the signature of {{TrashPolicy#getCurrentTrashDir}} by 
> adding an IOException. This breaks other applications using this public API. 
> This JIRA aims to reimplement the logic to safely handle the IOException 
> within HDFS.



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

Reply via email to