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

Jason Lowe commented on MAPREDUCE-6128:
---------------------------------------

Thanks Gera, I think we're close.

I was actually joking about the DO_TESTMRJOBS_HACK name.  If we're going to 
bother to create a config for this and place it in MRJobConfig then we should 
try to give it a name we won't regret later, hence the 
MINICLUSTER_JOB_FILTER_TEST_CLASSES suggestion.  Again, my preference is to not 
add a config at all.

The "-libjars" comment in the job submitter code is a little misleading, since 
any entry in the distributed cache applies.

Nit: The Iterables use seems a bit unnecessary, and there's separate movements 
afoot to try to wean some of our usage of Guava since it's so problematic from 
a compatibility standpoint.  Couldn't we just factor out the code that walks a 
list of distcache candidates to add them to the hashset and simply call that 
code for cache files, cache archives, and the job jar?

Nit: Rather than using a HashSet, I think it'd be nice to have a HashMap that 
tracks what basename goes with what path.  Then when there's a conflict, 
distcache or otherwise, it can report the manifest path conflicting and which 
path in the distcache is superceding just like it does for manifest collisions.

I'm a bit surprised the last jar in the manifest classpath wins since if they 
really are the same jar (but possibly different versions) then the first one in 
the classpath will win in practice, not the last.

I don't understand the logic behind this part of the patch:
{code}
+          // help gc
+          nonManifestJarSet.clear();
+          manifestJars.clear();
{code}
The two local variables are just about to fall out of scope anyway before any 
other allocation, so I don't see how clearing them here makes it noticably 
easier for the garbage collector.  Even if doing this helps, why not set them 
to null instead of clearing them?  I could see potentially setting 
nonManifestJarSet to null before the final for loop that copies the manifest 
jars, since that local is no longer needed.

I should point out that we don't have to exclude dependencies that conflict 
with the same basename, since we could generate a unique linkname for them when 
they're localized.  Classpath ordering if there's a class-level conflict gets a 
bit complicated since it uses PWD/* to generate the classpath and that's not 
deterministic on some platforms, but that's not new with this change.  Anyway 
not something we need to do for this patch, but I wanted to make sure that was 
a known option instead of skipping when a conflict occurs.

> Automatic addition of bundled jars to distributed cache 
> --------------------------------------------------------
>
>                 Key: MAPREDUCE-6128
>                 URL: https://issues.apache.org/jira/browse/MAPREDUCE-6128
>             Project: Hadoop Map/Reduce
>          Issue Type: Improvement
>          Components: client
>    Affects Versions: 2.5.1
>            Reporter: Gera Shegalov
>            Assignee: Gera Shegalov
>         Attachments: MAPREDUCE-6128.v01.patch, MAPREDUCE-6128.v02.patch, 
> MAPREDUCE-6128.v03.patch, MAPREDUCE-6128.v04.patch, MAPREDUCE-6128.v05.patch, 
> MAPREDUCE-6128.v06.patch, MAPREDUCE-6128.v07.patch, MAPREDUCE-6128.v08.patch
>
>
> On the client side, JDK adds Class-Path elements from the job jar manifest
> on the classpath. In theory there could be many bundled jars in many 
> directories such that adding them manually via libjars or similar means to 
> task classpaths is cumbersome. If this property is enabled, the same jars are 
> added
> to the task classpaths automatically.



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

Reply via email to