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

Chris Nauroth commented on MAPREDUCE-5021:
------------------------------------------

{quote}
The method isn't exactly suitable for the feature described here, but it might 
be an opportunity for refactoring and reuse.
{quote}

What I meant by this comment is that calling 
{{FileUtil#createJarWithClassPath}} won't help build this feature, but the 
method contains code that might be reusable if refactored out.  The method 
contains code very similar to what you just posted:

{code}
// Append all jars that match the wildcard
Path globPath = new Path(classPathEntry).suffix("{.jar,.JAR}");
FileStatus[] wildcardJars = FileContext.getLocalFSFileContext().util()
  .globStatus(globPath);
if (wildcardJars != null) {
  for (FileStatus wildcardJar: wildcardJars) {
    classPathEntryList.add(wildcardJar.getPath().toUri().toURL()
      .toExternalForm());
  }
}
{code}

                
> Add an addDirectoryToClassPath method DistributedCache
> ------------------------------------------------------
>
>                 Key: MAPREDUCE-5021
>                 URL: https://issues.apache.org/jira/browse/MAPREDUCE-5021
>             Project: Hadoop Map/Reduce
>          Issue Type: Improvement
>          Components: client, distributed-cache
>    Affects Versions: 2.0.3-alpha
>            Reporter: Sandy Ryza
>
> As adding a directory of jars to the class path is a common use for the 
> distributed cache it would be easier on API consumers if they were able to 
> call a method that would add all the the files in a directory for them. 

--
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

Reply via email to