hadoop-common-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "zhihai xu (JIRA)" <j...@apache.org>
Subject [jira] [Created] (HADOOP-12258) Need translate java.nio.file.NoSuchFileException to FileNotFoundException in DeprecatedRawLocalFileStatus constructor
Date Thu, 23 Jul 2015 04:23:04 GMT
zhihai xu created HADOOP-12258:
----------------------------------

             Summary: Need translate java.nio.file.NoSuchFileException to FileNotFoundException
in DeprecatedRawLocalFileStatus constructor
                 Key: HADOOP-12258
                 URL: https://issues.apache.org/jira/browse/HADOOP-12258
             Project: Hadoop Common
          Issue Type: Bug
          Components: fs
            Reporter: zhihai xu
            Assignee: zhihai xu
            Priority: Blocker


need translate java.nio.file.NoSuchFileException to FileNotFoundException in DeprecatedRawLocalFileStatus
constructor. 
HADOOP-12045 adds nio to support access time, but nio will create java.nio.file.NoSuchFileException
instead of FileNotFoundException.
many hadoop codes depend on FileNotFoundException to decide whether a file exists. for example
{{FileContext.util().exists()}}. 
{code}
    public boolean exists(final Path f) throws AccessControlException,
      UnsupportedFileSystemException, IOException {
      try {
        FileStatus fs = FileContext.this.getFileStatus(f);
        assert fs != null;
        return true;
      } catch (FileNotFoundException e) {
        return false;
      }
    }
{code}
same for {{FileSystem#exists}}
{code}
  public boolean exists(Path f) throws IOException {
    try {
      return getFileStatus(f) != null;
    } catch (FileNotFoundException e) {
      return false;
    }
  }
{code}
NoSuchFileException will break these functions.

Several test failures are caused by this issue:
https://builds.apache.org/job/PreCommit-YARN-Build/8630/testReport/org.apache.hadoop.yarn.server.nodemanager/TestDeletionService/testRelativeDelete/
https://builds.apache.org/job/PreCommit-YARN-Build/8632/testReport/org.apache.hadoop.yarn.server.nodemanager/TestDeletionService/testAbsDelete/



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

Mime
View raw message