hadoop-common-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chris Nauroth (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HADOOP-9887) globStatus does not correctly handle paths starting with a drive spec on Windows
Date Wed, 21 Aug 2013 21:26:51 GMT

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

Chris Nauroth commented on HADOOP-9887:
---------------------------------------

[~chuanliu], do you think it would make more sense to fix this in {{Globber#getPathComponents}},
conditional on whether or not the pattern was absolute like in the old {{FileSystem#globStatusInternal}}?
 Right now, this method doesn't seem to adhere to its contract stated in the comments.  (It
doesn't skip the first path component.)  Perhaps we won't need a Windows-specific special
case.

{code}
  /**
   * Translate an absolute path into a list of path components.
   * We merge double slashes into a single slash here.
   * The first path component (i.e. root) does not get an entry in the list.
   */
  private static List<String> getPathComponents(String path)
      throws IOException {
    ArrayList<String> ret = new ArrayList<String>();
    for (String component : path.split(Path.SEPARATOR)) {
      if (!component.isEmpty()) {
        ret.add(component);
      }
    }
    return ret;
  }
{code}

                
> globStatus does not correctly handle paths starting with a drive spec on Windows
> --------------------------------------------------------------------------------
>
>                 Key: HADOOP-9887
>                 URL: https://issues.apache.org/jira/browse/HADOOP-9887
>             Project: Hadoop Common
>          Issue Type: Bug
>          Components: fs
>    Affects Versions: 3.0.0, 2.3.0
>            Reporter: Chris Nauroth
>            Assignee: Chuan Liu
>         Attachments: HADOOP-9887-trunk.patch
>
>
> Recent file system changes have caused globStatus to stop working for paths starting
with a drive spec on Windows.  The problem is most easily visible by running {{TestFileUtil#createJarWithClassPath}}
on Windows.  This method attempts a globStatus with pattern {{*\{.jar,.JAR\}}}, and it no
longer correctly identifies files at the path ending in .jar or .JAR.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message