You are viewing a plain text version of this content. The canonical link for it is here.
Posted to mapreduce-issues@hadoop.apache.org by "Jason Lowe (JIRA)" <ji...@apache.org> on 2017/09/07 15:04:00 UTC
[jira] [Commented] (MAPREDUCE-6952) Using
DistributedCache.addFileToClasspath with a rename fragment fails during job
submit
[ https://issues.apache.org/jira/browse/MAPREDUCE-6952?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16157050#comment-16157050 ]
Jason Lowe commented on MAPREDUCE-6952:
---------------------------------------
Calling this code during job submit where /tmp/f1 exists in the default filesystem:
{code}
DistributedCache.addFileToClassPath(new Path(new URI("/tmp/f1#fizgig")), conf);
{code}
causes job submission to fail with this error:
{noformat}
java.io.FileNotFoundException: File does not exist: hdfs://localhost:8020/tmp/f1#fizgig
at org.apache.hadoop.hdfs.DistributedFileSystem$29.doCall(DistributedFileSystem.java:1480)
at org.apache.hadoop.hdfs.DistributedFileSystem$29.doCall(DistributedFileSystem.java:1473)
at org.apache.hadoop.fs.FileSystemLinkResolver.resolve(FileSystemLinkResolver.java:81)
at org.apache.hadoop.hdfs.DistributedFileSystem.getFileStatus(DistributedFileSystem.java:1488)
at org.apache.hadoop.fs.FileSystem.resolvePath(FileSystem.java:902)
at org.apache.hadoop.mapreduce.v2.util.MRApps.addToClasspathIfNotJar(MRApps.java:339)
at org.apache.hadoop.mapreduce.v2.util.MRApps.setClasspath(MRApps.java:272)
at org.apache.hadoop.mapred.YARNRunner.setupContainerLaunchContextForAM(YARNRunner.java:480)
at org.apache.hadoop.mapred.YARNRunner.createApplicationSubmissionContext(YARNRunner.java:538)
at org.apache.hadoop.mapred.YARNRunner.submitJob(YARNRunner.java:317)
at org.apache.hadoop.mapreduce.JobSubmitter.submitJobInternal(JobSubmitter.java:253)
at org.apache.hadoop.mapreduce.Job$11.run(Job.java:1344)
at org.apache.hadoop.mapreduce.Job$11.run(Job.java:1341)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:422)
at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1962)
at org.apache.hadoop.mapreduce.Job.submit(Job.java:1341)
at org.apache.hadoop.mapreduce.Job.waitForCompletion(Job.java:1362)
at org.apache.hadoop.mapreduce.SleepJob.run(SleepJob.java:282)
at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:76)
at org.apache.hadoop.mapreduce.SleepJob.main(SleepJob.java:197)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.apache.hadoop.util.ProgramDriver$ProgramDescription.invoke(ProgramDriver.java:71)
at org.apache.hadoop.util.ProgramDriver.run(ProgramDriver.java:144)
at org.apache.hadoop.test.MapredTestDriver.run(MapredTestDriver.java:139)
at org.apache.hadoop.test.MapredTestDriver.main(MapredTestDriver.java:147)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.apache.hadoop.util.RunJar.run(RunJar.java:239)
at org.apache.hadoop.util.RunJar.main(RunJar.java:153)
{noformat}
The intent is to have /tmp/f1 localized as "fizgig" in the container directory path just like one can with the -libjars flag for files on the client's local filesystem.
The problem occurs because DistributedCache.getFileClasspaths should interpret the strings as URIs rather than Paths here:
{code}
public static Path[] getFileClassPaths(Configuration conf) {
ArrayList<String> list = (ArrayList<String>)conf.getStringCollection(
MRJobConfig.CLASSPATH_FILES);
if (list.size() == 0) {
return null;
}
Path[] paths = new Path[list.size()];
for (int i = 0; i < list.size(); i++) {
paths[i] = new Path(list.get(i));
}
return paths;
}
{code}
> Using DistributedCache.addFileToClasspath with a rename fragment fails during job submit
> ----------------------------------------------------------------------------------------
>
> Key: MAPREDUCE-6952
> URL: https://issues.apache.org/jira/browse/MAPREDUCE-6952
> Project: Hadoop Map/Reduce
> Issue Type: Bug
> Components: client
> Affects Versions: 2.7.4, 2.8.1
> Reporter: Jason Lowe
>
> Calling DistributedCache.addFileToClasspath with a Path that specifies a URI fragment, used to rename the file during localization, causes job submission to fail with a FileNotFoundException.
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)
---------------------------------------------------------------------
To unsubscribe, e-mail: mapreduce-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: mapreduce-issues-help@hadoop.apache.org