hadoop-common-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bharath Mundlapudi (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HADOOP-7342) Add an utility API in FileUtil for JDK File.list
Date Wed, 01 Jun 2011 17:32:47 GMT

    [ https://issues.apache.org/jira/browse/HADOOP-7342?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13042309#comment-13042309

Bharath Mundlapudi commented on HADOOP-7342:

Hi Konstantin,

Thanks for your comments and for reviewing the code. 

My comments:
If you see most of the code in HDFS does have IOException handling around most of the methods.
Only the problem is NPE are not handled. We have seen in our tests, NPE can have bad impact
on certain cases when disks go bad. 

IMO, this is the problem with JDK API. Instead of asking user to have these null checks everywhere
for these calls, API should have been consistent with the return values.

Regarding asserts, I have not put the messages for assertEquals only because this call will
assert saying what is expected and actual values should be if it fails. This will be clear
from the logs that assertEquals failed. 

> Add an utility API in FileUtil for JDK File.list
> ------------------------------------------------
>                 Key: HADOOP-7342
>                 URL: https://issues.apache.org/jira/browse/HADOOP-7342
>             Project: Hadoop Common
>          Issue Type: Bug
>    Affects Versions: 0.23.0
>            Reporter: Bharath Mundlapudi
>            Assignee: Bharath Mundlapudi
>            Priority: Minor
>             Fix For: 0.23.0
>         Attachments: HADOOP-7342-1.patch
> Java File.list API can return null when disk is bad or directory is not a directory.
This utility API in FileUtil will throw an exception when this happens rather than returning

This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

View raw message